【问题标题】:how to scale daemon set about kubernetes using kubectl如何使用 kubectl 扩展关于 kubernetes 的守护进程集
【发布时间】:2020-03-30 17:55:03
【问题描述】:

现在我只有终端可以访问 kubernetes 集群,像这样检查入口控制器:

$ k get daemonset --all-namespaces
NAMESPACE     NAME                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                              AGE
kube-system   traefik-ingress-controller   0         0         0       0            0           IngressProxy=true                          60d
logging       fluentd-es                   0         0         0       0            0           beta.kubernetes.io/fluentd-ds-ready=true   28d

我现在使用 kubectl(v1.15.2) 来扩展守护程序集,如下所示:

kubectl scale --replicas=1 DaemonSet/traefik-ingress-controller -n kube-system

但它显示:

Error from server (NotFound): the server could not find the requested resource

我应该怎么做才能使用命令行在终端中启动 traefik?这是我的守护进程集描述输出:

~/Library/Mobile Documents/com~apple~CloudDocs/Document/k8s/work/traefik-deployment-yaml/k8s-backup ⌚ 17:49:58
$ k describe daemonset traefik-ingress-controller -n kube-system
Name:           traefik-ingress-controller
Selector:       app=traefik
Node-Selector:  IngressProxy=true
Labels:         app=traefik
Annotations:    deprecated.daemonset.template.generation: 18
                kubectl.kubernetes.io/last-applied-configuration:
                  {"apiVersion":"apps/v1","kind":"DaemonSet","metadata":{"annotations":{},"labels":{"app":"traefik"},"name":"traefik-ingress-controller","na...
Desired Number of Nodes Scheduled: 0
Current Number of Nodes Scheduled: 0
Number of Nodes Scheduled with Up-to-date Pods: 0
Number of Nodes Scheduled with Available Pods: 0
Number of Nodes Misscheduled: 0
Pods Status:  0 Running / 0 Waiting / 0 Succeeded / 0 Failed
Pod Template:
  Labels:           app=traefik
  Service Account:  traefik-ingress-controller
  Containers:
   traefik-ingress-lb:
    Image:       traefik:v2.1.6
    Ports:       80/TCP, 443/TCP, 8080/TCP
    Host Ports:  80/TCP, 443/TCP, 0/TCP
    Args:
      --configfile=/config/traefik.yaml
      --logLevel=INFO
      --metrics=true
      --metrics.prometheus=true
      --entryPoints.metrics.address=:8080
      --metrics.prometheus.entryPoint=metrics
      --metrics.prometheus.addServicesLabels=true
      --metrics.prometheus.addEntryPointsLabels=true
      --metrics.prometheus.buckets=0.100000, 0.300000, 1.200000, 5.000000
    Limits:
      cpu:     2
      memory:  1Gi
    Requests:
      cpu:        1
      memory:     1Gi
    Environment:  <none>
    Mounts:
      /config from config (rw)
  Volumes:
   config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      traefik-config
    Optional:  false
Events:
  Type     Reason            Age    From                  Message
  ----     ------            ----   ----                  -------
  Warning  FailedDaemonPod   3h32m  daemonset-controller  Found failed daemon pod kube-system/traefik-ingress-controller-wdpsq on node azshara-k8s03, will try to kill it
  Normal   SuccessfulDelete  3h32m  daemonset-controller  Deleted pod: traefik-ingress-controller-wdpsq
  Normal   SuccessfulCreate  3h32m  daemonset-controller  Created pod: traefik-ingress-controller-qmttl
  Warning  FailedDaemonPod   3h32m  daemonset-controller  Found failed daemon pod kube-system/traefik-ingress-controller-qmttl on node azshara-k8s03, will try to kill it
  Normal   SuccessfulDelete  3h32m  daemonset-controller  Deleted pod: traefik-ingress-controller-qmttl
  Normal   SuccessfulCreate  3h32m  daemonset-controller  Created pod: traefik-ingress-controller-nlxwc

【问题讨论】:

    标签: kubernetes


    【解决方案1】:

    您无需在 K8s 上扩展守护程序集。

    守护程序集可确保所有符合条件的节点都运行 Pod 的副本。

    随着节点被添加到集群中,Pods 也被添加到它们中。因此,您需要将新节点添加到集群中,并且将在那里安排守护程序集,除非您有一个非常独特的污点来禁止给定的守护程序集。

    【讨论】:

    • 如何知道 traefik pod 不启动的原因?@DT.
    猜你喜欢
    • 1970-01-01
    • 2021-07-16
    • 2022-06-11
    • 2018-11-30
    • 2012-08-05
    • 1970-01-01
    • 2020-01-10
    • 2019-05-07
    • 2020-12-20
    相关资源
    最近更新 更多