Kubernetes: ゟヌンの䞍均衡がある堎合、䞀郚のノヌドはスケゞュヌリングで考慮されたせん

䜜成日 2020幎05月30日  Â·  129コメント  Â·  ゜ヌス: kubernetes/kubernetes

䜕が起こったのか15個のkubernetesクラスタヌを1.17.5から1.18.2 / 1.18.3にアップグレヌドし、デヌモンセットが正しく機胜しなくなったこずを確認し始めたした。

問題は、すべおのデヌモンセットポッドがプロビゞョニングされないこずです。 次の゚ラヌメッセヌゞをむベントに返したす。

Events:
  Type     Reason            Age               From               Message
  ----     ------            ----              ----               -------
  Warning  FailedScheduling  9s (x5 over 71s)  default-scheduler  0/13 nodes are available: 12 node(s) didn't match node selector.

ただし、すべおのノヌドが䜿甚可胜であり、ノヌドセレクタヌはありたせん。 ノヌドにも汚染はありたせん。

デヌモンセットhttps://gist.github.com/zetaab/4a605cb3e15e349934cb7db29ec72bd8

% kubectl get nodes
NAME                                   STATUS   ROLES    AGE   VERSION
e2etest-1-kaasprod-k8s-local           Ready    node     46h   v1.18.3
e2etest-2-kaasprod-k8s-local           Ready    node     46h   v1.18.3
e2etest-3-kaasprod-k8s-local           Ready    node     44h   v1.18.3
e2etest-4-kaasprod-k8s-local           Ready    node     44h   v1.18.3
master-zone-1-1-1-kaasprod-k8s-local   Ready    master   47h   v1.18.3
master-zone-2-1-1-kaasprod-k8s-local   Ready    master   47h   v1.18.3
master-zone-3-1-1-kaasprod-k8s-local   Ready    master   47h   v1.18.3
nodes-z1-1-kaasprod-k8s-local          Ready    node     47h   v1.18.3
nodes-z1-2-kaasprod-k8s-local          Ready    node     47h   v1.18.3
nodes-z2-1-kaasprod-k8s-local          Ready    node     46h   v1.18.3
nodes-z2-2-kaasprod-k8s-local          Ready    node     46h   v1.18.3
nodes-z3-1-kaasprod-k8s-local          Ready    node     47h   v1.18.3
nodes-z3-2-kaasprod-k8s-local          Ready    node     46h   v1.18.3

% kubectl get pods -n weave -l weave-scope-component=agent -o wide
NAME                      READY   STATUS    RESTARTS   AGE     IP           NODE                                   NOMINATED NODE   READINESS GATES
weave-scope-agent-2drzw   1/1     Running   0          26h     10.1.32.23   e2etest-1-kaasprod-k8s-local           <none>           <none>
weave-scope-agent-4kpxc   1/1     Running   3          26h     10.1.32.12   nodes-z1-2-kaasprod-k8s-local          <none>           <none>
weave-scope-agent-78n7r   1/1     Running   0          26h     10.1.32.7    e2etest-4-kaasprod-k8s-local           <none>           <none>
weave-scope-agent-9m4n8   1/1     Running   0          26h     10.1.96.4    master-zone-1-1-1-kaasprod-k8s-local   <none>           <none>
weave-scope-agent-b2gnk   1/1     Running   1          26h     10.1.96.12   master-zone-3-1-1-kaasprod-k8s-local   <none>           <none>
weave-scope-agent-blwtx   1/1     Running   2          26h     10.1.32.20   nodes-z1-1-kaasprod-k8s-local          <none>           <none>
weave-scope-agent-cbhjg   1/1     Running   0          26h     10.1.64.15   e2etest-2-kaasprod-k8s-local           <none>           <none>
weave-scope-agent-csp49   1/1     Running   0          26h     10.1.96.14   e2etest-3-kaasprod-k8s-local           <none>           <none>
weave-scope-agent-g4k2x   1/1     Running   1          26h     10.1.64.10   nodes-z2-2-kaasprod-k8s-local          <none>           <none>
weave-scope-agent-kx85h   1/1     Running   2          26h     10.1.96.6    nodes-z3-1-kaasprod-k8s-local          <none>           <none>
weave-scope-agent-lllqc   0/1     Pending   0          5m56s   <none>       <none>                                 <none>           <none>
weave-scope-agent-nls2h   1/1     Running   0          26h     10.1.96.17   master-zone-2-1-1-kaasprod-k8s-local   <none>           <none>
weave-scope-agent-p8njs   1/1     Running   2          26h     10.1.96.19   nodes-z3-2-kaasprod-k8s-local          <none>           <none>

apiserver / schedules / controller-managersを再起動しようずしたしたが、圹に立ちたせん。 たた、スタックしおいる単䞀のノヌドnodes-z2-1-kaasprod-k8s-localを再起動しようずしたしたが、どちらも圹に立ちたせん。 そのノヌドを削陀しお再䜜成するだけで圹に立ちたす。

% kubectl describe node nodes-z2-1-kaasprod-k8s-local
Name:               nodes-z2-1-kaasprod-k8s-local
Roles:              node
Labels:             beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/instance-type=59cf4871-de1b-4294-9e9f-2ea7ca4b771f
                    beta.kubernetes.io/os=linux
                    failure-domain.beta.kubernetes.io/region=regionOne
                    failure-domain.beta.kubernetes.io/zone=zone-2
                    kops.k8s.io/instancegroup=nodes-z2
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=nodes-z2-1-kaasprod-k8s-local
                    kubernetes.io/os=linux
                    kubernetes.io/role=node
                    node-role.kubernetes.io/node=
                    node.kubernetes.io/instance-type=59cf4871-de1b-4294-9e9f-2ea7ca4b771f
                    topology.cinder.csi.openstack.org/zone=zone-2
                    topology.kubernetes.io/region=regionOne
                    topology.kubernetes.io/zone=zone-2
Annotations:        csi.volume.kubernetes.io/nodeid: {"cinder.csi.openstack.org":"faf14d22-010f-494a-9b34-888bdad1d2df"}
                    node.alpha.kubernetes.io/ttl: 0
                    projectcalico.org/IPv4Address: 10.1.64.32/19
                    projectcalico.org/IPv4IPIPTunnelAddr: 100.98.136.0
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Thu, 28 May 2020 13:28:24 +0300
Taints:             <none>
Unschedulable:      false
Lease:
  HolderIdentity:  nodes-z2-1-kaasprod-k8s-local
  AcquireTime:     <unset>
  RenewTime:       Sat, 30 May 2020 12:02:13 +0300
Conditions:
  Type                 Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----                 ------  -----------------                 ------------------                ------                       -------
  NetworkUnavailable   False   Fri, 29 May 2020 09:40:51 +0300   Fri, 29 May 2020 09:40:51 +0300   CalicoIsUp                   Calico is running on this node
  MemoryPressure       False   Sat, 30 May 2020 11:59:53 +0300   Fri, 29 May 2020 09:40:45 +0300   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure         False   Sat, 30 May 2020 11:59:53 +0300   Fri, 29 May 2020 09:40:45 +0300   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure          False   Sat, 30 May 2020 11:59:53 +0300   Fri, 29 May 2020 09:40:45 +0300   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready                True    Sat, 30 May 2020 11:59:53 +0300   Fri, 29 May 2020 09:40:45 +0300   KubeletReady                 kubelet is posting ready status. AppArmor enabled
Addresses:
  InternalIP:  10.1.64.32
  Hostname:    nodes-z2-1-kaasprod-k8s-local
Capacity:
  cpu:                4
  ephemeral-storage:  10287360Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             8172420Ki
  pods:               110
Allocatable:
  cpu:                4
  ephemeral-storage:  9480830961
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             8070020Ki
  pods:               110
System Info:
  Machine ID:                 c94284656ff04cf090852c1ddee7bcc2
  System UUID:                faf14d22-010f-494a-9b34-888bdad1d2df
  Boot ID:                    295dc3d9-0a90-49ee-92f3-9be45f2f8e3d
  Kernel Version:             4.19.0-8-cloud-amd64
  OS Image:                   Debian GNU/Linux 10 (buster)
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  docker://19.3.8
  Kubelet Version:            v1.18.3
  Kube-Proxy Version:         v1.18.3
PodCIDR:                      100.96.12.0/24
PodCIDRs:                     100.96.12.0/24
ProviderID:                   openstack:///faf14d22-010f-494a-9b34-888bdad1d2df
Non-terminated Pods:          (3 in total)
  Namespace                   Name                                        CPU Requests  CPU Limits  Memory Requests  Memory Limits  AGE
  ---------                   ----                                        ------------  ----------  ---------------  -------------  ---
  kube-system                 calico-node-77pqs                           100m (2%)     200m (5%)   100Mi (1%)       100Mi (1%)     46h
  kube-system                 kube-proxy-nodes-z2-1-kaasprod-k8s-local    100m (2%)     200m (5%)   100Mi (1%)       100Mi (1%)     46h
  volume                      csi-cinder-nodeplugin-5jbvl                 100m (2%)     400m (10%)  200Mi (2%)       200Mi (2%)     46h
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests    Limits
  --------           --------    ------
  cpu                300m (7%)   800m (20%)
  memory             400Mi (5%)  400Mi (5%)
  ephemeral-storage  0 (0%)      0 (0%)
Events:
  Type    Reason                   Age    From                                    Message
  ----    ------                   ----   ----                                    -------
  Normal  Starting                 7m27s  kubelet, nodes-z2-1-kaasprod-k8s-local  Starting kubelet.
  Normal  NodeHasSufficientMemory  7m26s  kubelet, nodes-z2-1-kaasprod-k8s-local  Node nodes-z2-1-kaasprod-k8s-local status is now: NodeHasSufficientMemory
  Normal  NodeHasNoDiskPressure    7m26s  kubelet, nodes-z2-1-kaasprod-k8s-local  Node nodes-z2-1-kaasprod-k8s-local status is now: NodeHasNoDiskPressure
  Normal  NodeHasSufficientPID     7m26s  kubelet, nodes-z2-1-kaasprod-k8s-local  Node nodes-z2-1-kaasprod-k8s-local status is now: NodeHasSufficientPID
  Normal  NodeAllocatableEnforced  7m26s  kubelet, nodes-z2-1-kaasprod-k8s-local  Updated Node Allocatable limit across pods

これは、すべおのクラスタヌでランダムに芋られたす。

予想されるこずdaemonsetがすべおのノヌドにプロビゞョニング

それを再珟する方法可胜な限り最小限か぀正確に 実際にはわかりたせん。1.18.xkubernetesをむンストヌルし、daemonsetをデプロむしお、その埌数日埅ちたす

他に知っおおくべきこずはありたすか これが発生するず、そのノヌドに他のデヌモンセットをプロビゞョニングするこずもできなくなりたす。 あなたが芋るこずができるように、ロギングの流暢なビットも欠けおいたす。 そのノヌドのkubeletログに゚ラヌが衚瀺されないので、前述のように、再起動しおも圹に立ちたせん。

% kubectl get ds --all-namespaces
NAMESPACE     NAME                       DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                     AGE
falco         falco-daemonset            13        13        12      13           12          <none>                            337d
kube-system   audit-webhook-deployment   3         3         3       3            3           node-role.kubernetes.io/master=   174d
kube-system   calico-node                13        13        13      13           13          kubernetes.io/os=linux            36d
kube-system   kops-controller            3         3         3       3            3           node-role.kubernetes.io/master=   193d
kube-system   metricbeat                 6         6         5       6            5           <none>                            35d
kube-system   openstack-cloud-provider   3         3         3       3            3           node-role.kubernetes.io/master=   337d
logging       fluent-bit                 13        13        12      13           12          <none>                            337d
monitoring    node-exporter              13        13        12      13           12          kubernetes.io/os=linux            58d
volume        csi-cinder-nodeplugin      6         6         6       6            6           <none>                            239d
weave         weave-scope-agent          13        13        12      13           12          <none>                            193d
weave         weavescope-iowait-plugin   6         6         5       6            5           <none>                            193d

ご芧のずおり、ほずんどのデヌモンセットには1぀のポッドがありたせん。

環境

  • Kubernetesバヌゞョン kubectl version 1.18.3
  • クラりドプロバむダヌたたはハヌドりェア構成openstack
  • OS䟋 cat /etc/os-release Debianバスタヌ
  • カヌネル䟋 uname -a Linuxノヌド-z2-1-kaasprod-k8s-local 4.19.0-8-cloud-amd641 SMP Debian 4.19.98-1 + deb10u12020-04-27 x86_64 GNU / Linux
  • ツヌルのむンストヌルkops
  • ネットワヌクプラグむンずバヌゞョンこれがネットワヌク関連のバグの堎合calico
  • その他
help wanted kinbug prioritimportant-soon sischeduling

最も参考になるコメント

珟圚、スナップショットのテストケヌスを远加しお、これが適切にテストされおいるこずを確認しおいたす。

党おのコメント129件

/ sigスケゞュヌリング

ノヌド、デヌモンセット、サンプルポッド、およびサヌバヌから取埗した名前空間の完党なyamlを提䟛できたすか

ノヌド
https://gist.github.com/zetaab/2a7e8d3fe6cb42a617e17abc0fa375f7

デヌモンセット
https://gist.github.com/zetaab/31bb406c8bd622b3017bf4f468d0154f

ポッドの䟋動䜜䞭
https://gist.github.com/zetaab/814871bec6f2879e371f5bbdc6f2e978

ポッドの䟋スケゞュヌリングではありたせん
https://gist.github.com/zetaab/f3488d65486c745af78dbe2e6173fd42

名前空間
https://gist.github.com/zetaab/4625b759f4e21b50757c79e5072cd7d9

DaemonSetポッドは、単䞀のノヌドにのみ䞀臎するnodeAffinityセレクタヌでスケゞュヌルされるため、「13のうち12が䞀臎したせんでした」ずいうメッセヌゞが衚瀺されたす。

スケゞュヌラヌがポッド/ノヌドの組み合わせに䞍満を抱く理由がわかりたせん podspecで競合する可胜性のあるポヌトがなく、ノヌドがスケゞュヌル䞍胜たたは汚染されおおらず、十分なリ゜ヌスがありたす

さお、3぀すべおのスケゞュヌラヌを再起動したしたそこに䜕か面癜いものが芋られる堎合は、ログレベルを4に倉曎したした。 ただし、問題は修正されたした

% kubectl get ds --all-namespaces
NAMESPACE     NAME                       DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                     AGE
falco         falco-daemonset            13        13        13      13           13          <none>                            338d
kube-system   audit-webhook-deployment   3         3         3       3            3           node-role.kubernetes.io/master=   175d
kube-system   calico-node                13        13        13      13           13          kubernetes.io/os=linux            36d
kube-system   kops-controller            3         3         3       3            3           node-role.kubernetes.io/master=   194d
kube-system   metricbeat                 6         6         6       6            6           <none>                            36d
kube-system   openstack-cloud-provider   3         3         3       3            3           node-role.kubernetes.io/master=   338d
logging       fluent-bit                 13        13        13      13           13          <none>                            338d
monitoring    node-exporter              13        13        13      13           13          kubernetes.io/os=linux            59d
volume        csi-cinder-nodeplugin      6         6         6       6            6           <none>                            239d
weave         weave-scope-agent          13        13        13      13           13          <none>                            194d
weave         weavescope-iowait-plugin   6         6         6       6            6           <none>                            194d

これで、すべおのデヌモンセットが正しくプロビゞョニングされたす。 奇劙な、ずにかくスケゞュヌラヌに䜕か問題があるようです

cc @ kubernetes / sig-scheduling-bugs @ ahg-g

v1.18.3でも同様の問題が発生し、デヌモンセットポッドに察しお1぀のノヌドをスケゞュヌルできたせん。
再起動スケゞュヌラが圹立ちたす。

[root@tesla-cb0434-csfp1-csfp1-control-03 ~]# kubectl get pod -A|grep Pending
kube-system   coredns-vc5ws                                                 0/1     Pending   0          2d16h
kube-system   local-volume-provisioner-mwk88                                0/1     Pending   0          2d16h
kube-system   svcwatcher-ltqb6                                              0/1     Pending   0          2d16h
ncms          bcmt-api-hfzl6                                                0/1     Pending   0          2d16h
ncms          bcmt-yum-repo-589d8bb756-5zbvh                                0/1     Pending   0          2d16h
[root@tesla-cb0434-csfp1-csfp1-control-03 ~]# kubectl get ds -A
NAMESPACE     NAME                       DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                   AGE
kube-system   coredns                    3         3         2       3            2           is_control=true                 2d16h
kube-system   danmep-cleaner             0         0         0       0            0           cbcs.nokia.com/danm_node=true   2d16h
kube-system   kube-proxy                 8         8         8       8            8           <none>                          2d16h
kube-system   local-volume-provisioner   8         8         7       8            7           <none>                          2d16h
kube-system   netwatcher                 0         0         0       0            0           cbcs.nokia.com/danm_node=true   2d16h
kube-system   sriov-device-plugin        0         0         0       0            0           sriov=enabled                   2d16h
kube-system   svcwatcher                 3         3         2       3            2           is_control=true                 2d16h
ncms          bcmt-api                   3         3         0       3            0           is_control=true                 2d16h
[root@tesla-cb0434-csfp1-csfp1-control-03 ~]# kubectl get node
NAME                                  STATUS   ROLES    AGE     VERSION
tesla-cb0434-csfp1-csfp1-control-01   Ready    <none>   2d16h   v1.18.3
tesla-cb0434-csfp1-csfp1-control-02   Ready    <none>   2d16h   v1.18.3
tesla-cb0434-csfp1-csfp1-control-03   Ready    <none>   2d16h   v1.18.3
tesla-cb0434-csfp1-csfp1-edge-01      Ready    <none>   2d16h   v1.18.3
tesla-cb0434-csfp1-csfp1-edge-02      Ready    <none>   2d16h   v1.18.3
tesla-cb0434-csfp1-csfp1-worker-01    Ready    <none>   2d16h   v1.18.3
tesla-cb0434-csfp1-csfp1-worker-02    Ready    <none>   2d16h   v1.18.3
tesla-cb0434-csfp1-csfp1-worker-03    Ready    <none>   2d16h   v1.18.3

再珟する方法を知らずにデバッグするのは難しい。 ポッドのスケゞュヌルに倱敗した堎合に備えお、スケゞュヌラログがありたすか

さお、3぀すべおのスケゞュヌラヌを再起動したした

そのうちの1぀だけがdefault-schedulerずいう名前だず思いたすよね

䜕か面癜いものが芋られる堎合は、ログレベルを4に倉曎したした

あなたが気づいたこずを共有できたすか

loglevelを9に蚭定したすが、これ以䞊興味深いものはないようです。以䞋のログはルヌプしおいたす。

I0601 01:45:05.039373       1 generic_scheduler.go:290] Preemption will not help schedule pod kube-system/coredns-vc5ws on any node.
I0601 01:45:05.039437       1 factory.go:462] Unable to schedule kube-system/coredns-vc5ws: no fit: 0/8 nodes are available: 7 node(s) didn't match node selector.; waiting
I0601 01:45:05.039494       1 scheduler.go:776] Updating pod condition for kube-system/coredns-vc5ws to (PodScheduled==False, Reason=Unschedulable)

ええ、私は同じ行以䞊のものを芋るこずができたせんでした

no fit: 0/8 nodes are available: 7 node(s) didn't match node selector.; waiting

奇劙なこずに、 https//github.com/kubernetes/kubernetes/issues/91340で報告されおいる問題のように、ログメッセヌゞには7぀のノヌドの結果のみが衚瀺され

/ cc @damemi

@ ahg-gこれは私がそこで報告したのず同じ問題のように芋えたす、゚ラヌを垞に報告するずは限らないフィルタヌプラグむンがあるか、掚枬しなければならない堎合にサむレントに倱敗する他の条件があるようです

私の問題では、スケゞュヌラヌを再起動するずそれも修正されたこずに泚意しおくださいこのスレッドでも蚀及されおいるようにhttps://github.com/kubernetes/kubernetes/issues/91601#issuecomment-636360092

私もデヌモンセットに関するものだったので、これは重耇しおいるず思いたす。 その堎合は、これを閉じおhttps://github.com/kubernetes/kubernetes/issues/91340でディスカッションを続けるこずができ

ずにかく、スケゞュヌラヌはより詳现なログオプションを必芁ずしたす。それが䜕をするかに぀いおのログがない堎合、これらの問題をデバッグするこずは䞍可胜です。

@zetaab +1の堎合、スケゞュヌラヌは珟圚のロギング機胜を倧幅に改善するこずができたす。 これは私がしばらく取り組む぀もりだったアップグレヌドであり、぀いにここで問題を開きたした https 

/割圓

私はこれを調べおいたす。 ケヌスを絞り蟌むのに圹立぀いく぀かの質問。 ただ再珟できおいたせん。

  • 最初に䜜成されたものデヌモンセットたたはノヌド
  • デフォルトのプロファむルを䜿甚しおいたすか
  • ゚クステンダヌはありたすか

ノヌドはデヌモンセットの前に䜜成されたした。
デフォルトのプロファむルを䜿甚したずしたしょう。どのプロファむルを意味し、どのように確認するのですか
゚クステンダヌはありたせん。

    command:
    - /usr/local/bin/kube-scheduler
    - --address=127.0.0.1
    - --kubeconfig=/etc/kubernetes/kube-scheduler.kubeconfig
    - --profiling=false
    - --v=1

圱響を䞎える可胜性のあるもう1぀のこずは、ディスクのパフォヌマンスがetcdにずっおあたり良くないこずです。たた、etcdは動䜜が遅いず䞍平を蚀いたす。

はい、これらのフラグにより​​、スケゞュヌラヌはデフォルトのプロファむルで実行されたす。 探し続けたす。 ただ再珟できたせんでした。

ただ䜕もありたせん...あなたが䜿甚しおいる他に圱響を䞎える可胜性があるず思うものはありたすか 汚染、ポヌト、その他のリ゜ヌス

これに関連しおいく぀かの詊みをしたした。 問題が発生しおいる堎合でも、ポッドをノヌドにスケゞュヌルできたす定矩なしたたは「nodeName」セレクタヌを䜿甚。

Affinity / Antiaffinityを䜿甚しようずするず、ポッドはノヌドにスケゞュヌルされたせん。

問題が発生しおいるずきに機胜する

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: nginx
  name: nginx
spec:
  nodeName: master-zone-3-1-1-test-cluster-k8s-local
  containers:
    - image: nginx
      name: nginx
      resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always

同時に機胜しない

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: nginx
  name: nginx
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
          - matchExpressions:
              - key: kubernetes.io/hostname
                operator: In
                values:
                  - master-zone-3-1-1-test-cluster-k8s-local
  containers:
    - image: nginx
      name: nginx
      resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always

たた、埌者をチェックするず、それらも非垞に興味深いものでした。

Warning  FailedScheduling  4m37s (x17 over 26m)  default-scheduler  0/9 nodes are available: 8 node(s) didn't match node selector.
Warning  FailedScheduling  97s (x6 over 3m39s)   default-scheduler  0/8 nodes are available: 8 node(s) didn't match node selector.
Warning  FailedScheduling  53s                   default-scheduler  0/8 nodes are available: 8 node(s) didn't match node selector.
Warning  FailedScheduling  7s (x5 over 32s)      default-scheduler  0/9 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 7 node(s) didn't match node selector.
  • 最初のむベントは、マニフェストが適甚されたずきですスケゞュヌル䞍可胜なノヌドには䜕も行われたせん。
  • 2番目ず3番目は、ノヌドがkubectlで削陀され、再起動されたずきです。
  • 4番目は、ノヌドが埩旧したずきに発生したした。 問題が発生したノヌドはマスタヌであったため、ノヌドはそこに移動したせんでしたただし、以前の3぀のむベントでノヌドが芋぀からなかったこずを瀺しおいたす。 4番目のむベントで興味深いのは、1぀のノヌドからの情報がただ欠萜しおいるこずです。 むベントでは、0/9ノヌドが䜿甚可胜であるず瀺されおいたすが、説明は8からのみです。

「nodeName」はセレクタヌではありたせん。 nodeNameを䜿甚するず、スケゞュヌリングがバむパスされたす。

4番目は、ノヌドが埩旧したずきに発生したした。 問題が発生したノヌドはマスタヌであったため、ノヌドはそこに移動したせんでしたただし、以前の3぀のむベントでノヌドが芋぀からなかったこずを瀺しおいたす。 4番目のむベントで興味深いのは、1぀のノヌドからの情報がただ欠萜しおいるこずです。 むベントでは、0/9ノヌドが䜿甚可胜であるず瀺されおいたすが、説明は8からのみです。

ポッドが欠萜しおいるノヌドでスケゞュヌルされるべきではなかった理由は、それがマスタヌであったためだず蚀っおいたすか

8 node(s) didn't match node selectorが7になっおいるのがわかりたす。この時点で削陀されたノヌドはないず思いたすよね

「nodeName」はセレクタヌではありたせん。 nodeNameを䜿甚するず、スケゞュヌリングがバむパスされたす。

「NodeName」の詊みはhighlighでした。そのノヌドは䜿甚可胜であり、必芁に応じおポッドがそこに到達したす。 ぀たり、ノヌドがポッドを起動できないこずではありたせん。

4番目は、ノヌドが埩旧したずきに発生したした。 問題が発生したノヌドはマスタヌであったため、ノヌドはそこに移動したせんでしたただし、以前の3぀のむベントでノヌドが芋぀からなかったこずを瀺しおいたす。 4番目のむベントで興味深いのは、1぀のノヌドからの情報がただ欠萜しおいるこずです。 むベントでは、0/9ノヌドが䜿甚可胜であるず瀺されおいたすが、説明は8からのみです。

ポッドが欠萜しおいるノヌドでスケゞュヌルされるべきではなかった理由は、それがマスタヌであったためだず蚀っおいたすか

8 node(s) didn't match node selectorが7になっおいるのがわかりたす。この時点で削陀されたノヌドはないず思いたすよね

テストクラスタヌには9぀のノヌドがありたす。 3人のマスタヌず6人の劎働者。 動䜜しおいないノヌドが正垞に開始される前に、むベントは䜿甚可胜なすべおのノヌドに関する情報を通知したした 0/8 nodes are available: 8 node(s) didn't match node selector. 。 しかし、ノヌドセレクタヌず䞀臎するノヌドが起動するず、むベントは0/9 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 7 node(s) didn't match node selector.を通知したした。説明は、䞀臎しない8぀があるこずを瀺しおいたすが、9番目前のむベントで確認枈みに぀いおは䜕も通知しおいたせん。

したがっお、むベントの状態

  • 最初のむベント9ノヌドが䜿甚可胜、daemonsetで゚ラヌが通知されたした
  • 2番目ず3番目のむベント8ノヌドが䜿甚可胜です。 ポッドを受信しお​​いなかったものが再起動しおいたした
  • 4番目のむベント9぀のノヌドが䜿甚可胜ですしたがっお、1぀が開始され、再起動されたした。

最埌に、テストポッドは汚染のために䞀臎するノヌドで開始されたせんでしたが、それは別の話ですそしお、最初のむベントですでにそうであったはずです。

「NodeName」の詊みはhighlighでした。そのノヌドは䜿甚可胜であり、必芁に応じおポッドがそこに到達したす。 ぀たり、ノヌドがポッドを起動できないこずではありたせん。

ノヌドのオヌバヌコミットを防ぐものは䜕もありたせんが、スケゞュヌラヌであるこずに泚意しおください。 したがっお、これは実際にはあたり衚瀺されたせん。

最埌に、テストポッドは汚染のために䞀臎するノヌドで開始されたせんでしたが、それは別の話ですそしお、最初のむベントですでにそうであったはずです。

私の質問は、9番目のノヌドが最初から汚染されおいたのかずいうこずです。 1状態に到達するための再珟可胜な手順、たたは2バグが発生する可胜性のある堎所を探しおいたす。

私の質問は、9番目のノヌドが最初から汚染されおいたのかずいうこずです。 1状態に到達するための再珟可胜な手順、たたは2バグが発生する可胜性のある堎所を探しおいたす。

はい、この堎合、非受信ノヌドがマスタヌであったため、汚染が垞に存圚しおいたした。 しかし、マスタヌずワヌカヌの䞡方で同じ問題が発生しおいたす。

問題がどこから来おいるのかはただわかりたせん。少なくずもノヌドの再䜜成ずノヌドの再起動によっお問題が修正されおいるようです。 しかし、それらは物事を修正するための少し「難しい」方法です。

ロングショットですが、もう䞀床遭遇した堎合は...ノヌドに指定されたポッドが衚瀺されないかどうかを確認できたすか

考えられるシナリオを考えお、質問を投皿しおいたす。

  • クラスタヌ内に他のマスタヌノヌドがありたすか
  • ゚クステンダヌはありたすか
* Do you have other master nodes in your cluster?

すべおのclusersには3぀のマスタヌがありたすしたがっお、それらの再起動は簡単です

* Do you have extenders?

番号。

今日気付いた興味深い点の1぀は、1぀のマスタヌがDaemonSetからポッドを受信しお​​いないクラスタヌがあったこずです。 ChaosMonkeyが䜿甚されおおり、ワヌカヌノヌドの1぀が終了したした。 これは興味深いこずです。これにより、ポッドは以前に受信しおいなかったマスタヌに移動したした。 したがっお、問題のあるノヌド以倖のノヌドを削陀するこずで、その時点で問題が修正されおいるように芋えたした。

その「修正」のために、指定されたポッドに぀いお回答できるようになるには、問題が再発するのを埅぀必芁がありたす。

私は今混乱しおいたす...あなたのデヌモンセットはマスタヌノヌドの汚染を蚱容したすか 蚀い換えれば...あなたにずっおのバグは単なるスケゞュヌルむベントですか、それずもポッドがスケゞュヌルされるべきだったずいう事実ですか

問題は、䞀臎するアフィニティたたはアンチアフィニティ蚭定が少なくずも1぀ある堎合でも、そのノヌドがスケゞュヌラによっお怜出されないこずです。

そのため、汚染゚ラヌが予想され、最初のむベントですでに存圚しおいるはずだず蚀いたした汚染は芪和性基準の䞀郚ではないため

理解したした。 私はあなたのセットアップを確認しお、䜕かが足りないこずを確認しようずしおいたした。

ノヌドがスケゞュヌラヌによっお「芋えない」ずは思わない。 0/9 nodes are availableが衚瀺されおいる堎合、ノヌドは実際にキャッシュ内にあるず結論付けるこずができたす。 予定倖の理由がどこかで倱われたようなものなので、むベントには含めたせん。

確かに、合蚈数は垞に実際のノヌド数ず䞀臎したす。 より説明的なむベントテキストがすべおのノヌドに衚瀺されるわけではありたせんが、前述のように別の問題になる可胜性がありたす。

kube-schedulerのログを芋るこずができたすか 関連するず思われるものはありたすか

@zetaabはそれをなかったず思いたす。 問題が再び発生したずきに詊すこずができたすおよび以前に尋ねられた指名されたポッドのこず

可胜であれば、誀っお問題を修正した堎合に備えお、1.18.5も実行しおください。

これ以䞊ログが必芁な堎合は、テストクラスタヌでこれを確実に再珟できたす。

@dilyevsky再珟手順を共有しおください。 䜕ずかしお、倱敗しおいるフィルタヌを特定できたすか

これは、dsポッドのノヌドのmetadata.nameにすぎないようです...奇劙です。 これがポッドyamlです

ポッドyaml

apiVersion: v1
kind: Pod
metadata:
  annotations:
    scheduler.alpha.kubernetes.io/critical-pod: ""
  creationTimestamp: "2020-07-09T23:17:53Z"
  generateName: cilium-
  labels:
    controller-revision-hash: 6c94db8bb8
    k8s-app: cilium
    pod-template-generation: "1"
  managedFields:
    # managed fields crap
  name: cilium-d5n4f
  namespace: kube-system
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: DaemonSet
    name: cilium
    uid: 0f00e8af-eb19-4985-a940-a02fa84fcbc5
  resourceVersion: "2840"
  selfLink: /api/v1/namespaces/kube-system/pods/cilium-d5n4f
  uid: e3f7d566-ee5b-4557-8d1b-f0964cde2f22
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchFields:
          - key: metadata.name
            operator: In
            values:
            - us-central1-dilyevsky-master-qmwnl
  containers:
  - args:
    - --config-dir=/tmp/cilium/config-map
    command:
    - cilium-agent
    env:
    - name: K8S_NODE_NAME
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: spec.nodeName
    - name: CILIUM_K8S_NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace
    - name: CILIUM_FLANNEL_MASTER_DEVICE
      valueFrom:
        configMapKeyRef:
          key: flannel-master-device
          name: cilium-config
          optional: true
    - name: CILIUM_FLANNEL_UNINSTALL_ON_EXIT
      valueFrom:
        configMapKeyRef:
          key: flannel-uninstall-on-exit
          name: cilium-config
          optional: true
    - name: CILIUM_CLUSTERMESH_CONFIG
      value: /var/lib/cilium/clustermesh/
    - name: CILIUM_CNI_CHAINING_MODE
      valueFrom:
        configMapKeyRef:
          key: cni-chaining-mode
          name: cilium-config
          optional: true
    - name: CILIUM_CUSTOM_CNI_CONF
      valueFrom:
        configMapKeyRef:
          key: custom-cni-conf
          name: cilium-config
          optional: true
    image: docker.io/cilium/cilium:v1.7.6
    imagePullPolicy: IfNotPresent
    lifecycle:
      postStart:
        exec:
          command:
          - /cni-install.sh
          - --enable-debug=false
      preStop:
        exec:
          command:
          - /cni-uninstall.sh
    livenessProbe:
      exec:
        command:
        - cilium
        - status
        - --brief
      failureThreshold: 10
      initialDelaySeconds: 120
      periodSeconds: 30
      successThreshold: 1
      timeoutSeconds: 5
    name: cilium-agent
    readinessProbe:
      exec:
        command:
        - cilium
        - status
        - --brief
      failureThreshold: 3
      initialDelaySeconds: 5
      periodSeconds: 30
      successThreshold: 1
      timeoutSeconds: 5
    resources: {}
    securityContext:
      capabilities:
        add:
        - NET_ADMIN
        - SYS_MODULE
      privileged: true
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/run/cilium
      name: cilium-run
    - mountPath: /host/opt/cni/bin
      name: cni-path
    - mountPath: /host/etc/cni/net.d
      name: etc-cni-netd
    - mountPath: /var/lib/cilium/clustermesh
      name: clustermesh-secrets
      readOnly: true
    - mountPath: /tmp/cilium/config-map
      name: cilium-config-path
      readOnly: true
    - mountPath: /lib/modules
      name: lib-modules
      readOnly: true
    - mountPath: /run/xtables.lock
      name: xtables-lock
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: cilium-token-j74lr
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  hostNetwork: true
  initContainers:
  - command:
    - /init-container.sh
    env:
    - name: CILIUM_ALL_STATE
      valueFrom:
        configMapKeyRef:
          key: clean-cilium-state
          name: cilium-config
          optional: true
    - name: CILIUM_BPF_STATE
      valueFrom:
        configMapKeyRef:
          key: clean-cilium-bpf-state
          name: cilium-config
          optional: true
    - name: CILIUM_WAIT_BPF_MOUNT
      valueFrom:
        configMapKeyRef:
          key: wait-bpf-mount
          name: cilium-config
          optional: true
    image: docker.io/cilium/cilium:v1.7.6
    imagePullPolicy: IfNotPresent
    name: clean-cilium-state
    resources: {}
    securityContext:
      capabilities:
        add:
        - NET_ADMIN
      privileged: true
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/run/cilium
      name: cilium-run
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: cilium-token-j74lr
      readOnly: true
  priority: 2000001000
  priorityClassName: system-node-critical
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext: {}
  serviceAccount: cilium
  serviceAccountName: cilium
  terminationGracePeriodSeconds: 1
  tolerations:
  - operator: Exists
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/disk-pressure
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/memory-pressure
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/pid-pressure
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/unschedulable
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/network-unavailable
    operator: Exists
  volumes:
  - hostPath:
      path: /var/run/cilium
      type: DirectoryOrCreate
    name: cilium-run
  - hostPath:
      path: /opt/cni/bin
      type: DirectoryOrCreate
    name: cni-path
  - hostPath:
      path: /etc/cni/net.d
      type: DirectoryOrCreate
    name: etc-cni-netd
  - hostPath:
      path: /lib/modules
      type: ""
    name: lib-modules
  - hostPath:
      path: /run/xtables.lock
      type: FileOrCreate
    name: xtables-lock
  - name: clustermesh-secrets
    secret:
      defaultMode: 420
      optional: true
      secretName: cilium-clustermesh
  - configMap:
      defaultMode: 420
      name: cilium-config
    name: cilium-config-path
  - name: cilium-token-j74lr
    secret:
      defaultMode: 420
      secretName: cilium-token-j74lr
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2020-07-09T23:17:53Z"
    message: '0/6 nodes are available: 5 node(s) didn''t match node selector.'
    reason: Unschedulable
    status: "False"
    type: PodScheduled
  phase: Pending
  qosClass: BestEffort

これを再珟する方法は、3぀のマスタヌず3぀のワヌカヌノヌドで新しいクラスタヌを起動しクラスタヌAPIを䜿甚、Cilium1.7.6を適甚するこずです。

繊毛yaml

---
# Source: cilium/charts/agent/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: cilium
  namespace: kube-system
---
# Source: cilium/charts/operator/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: cilium-operator
  namespace: kube-system
---
# Source: cilium/charts/config/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: cilium-config
  namespace: kube-system
data:

  # Identity allocation mode selects how identities are shared between cilium
  # nodes by setting how they are stored. The options are "crd" or "kvstore".
  # - "crd" stores identities in kubernetes as CRDs (custom resource definition).
  #   These can be queried with:
  #     kubectl get ciliumid
  # - "kvstore" stores identities in a kvstore, etcd or consul, that is
  #   configured below. Cilium versions before 1.6 supported only the kvstore
  #   backend. Upgrades from these older cilium versions should continue using
  #   the kvstore by commenting out the identity-allocation-mode below, or
  #   setting it to "kvstore".
  identity-allocation-mode: crd

  # If you want to run cilium in debug mode change this value to true
  debug: "false"

  # Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4
  # address.
  enable-ipv4: "true"

  # Enable IPv6 addressing. If enabled, all endpoints are allocated an IPv6
  # address.
  enable-ipv6: "false"

  # If you want cilium monitor to aggregate tracing for packets, set this level
  # to "low", "medium", or "maximum". The higher the level, the less packets
  # that will be seen in monitor output.
  monitor-aggregation: medium

  # The monitor aggregation interval governs the typical time between monitor
  # notification events for each allowed connection.
  #
  # Only effective when monitor aggregation is set to "medium" or higher.
  monitor-aggregation-interval: 5s

  # The monitor aggregation flags determine which TCP flags which, upon the
  # first observation, cause monitor notifications to be generated.
  #
  # Only effective when monitor aggregation is set to "medium" or higher.
  monitor-aggregation-flags: all

  # ct-global-max-entries-* specifies the maximum number of connections
  # supported across all endpoints, split by protocol: tcp or other. One pair
  # of maps uses these values for IPv4 connections, and another pair of maps
  # use these values for IPv6 connections.
  #
  # If these values are modified, then during the next Cilium startup the
  # tracking of ongoing connections may be disrupted. This may lead to brief
  # policy drops or a change in loadbalancing decisions for a connection.
  #
  # For users upgrading from Cilium 1.2 or earlier, to minimize disruption
  # during the upgrade process, comment out these options.
  bpf-ct-global-tcp-max: "524288"
  bpf-ct-global-any-max: "262144"

  # bpf-policy-map-max specified the maximum number of entries in endpoint
  # policy map (per endpoint)
  bpf-policy-map-max: "16384"

  # Pre-allocation of map entries allows per-packet latency to be reduced, at
  # the expense of up-front memory allocation for the entries in the maps. The
  # default value below will minimize memory usage in the default installation;
  # users who are sensitive to latency may consider setting this to "true".
  #
  # This option was introduced in Cilium 1.4. Cilium 1.3 and earlier ignore
  # this option and behave as though it is set to "true".
  #
  # If this value is modified, then during the next Cilium startup the restore
  # of existing endpoints and tracking of ongoing connections may be disrupted.
  # This may lead to policy drops or a change in loadbalancing decisions for a
  # connection for some time. Endpoints may need to be recreated to restore
  # connectivity.
  #
  # If this option is set to "false" during an upgrade from 1.3 or earlier to
  # 1.4 or later, then it may cause one-time disruptions during the upgrade.
  preallocate-bpf-maps: "false"

  # Regular expression matching compatible Istio sidecar istio-proxy
  # container image names
  sidecar-istio-proxy-image: "cilium/istio_proxy"

  # Encapsulation mode for communication between nodes
  # Possible values:
  #   - disabled
  #   - vxlan (default)
  #   - geneve
  tunnel: vxlan

  # Name of the cluster. Only relevant when building a mesh of clusters.
  cluster-name: default

  # DNS Polling periodically issues a DNS lookup for each `matchName` from
  # cilium-agent. The result is used to regenerate endpoint policy.
  # DNS lookups are repeated with an interval of 5 seconds, and are made for
  # A(IPv4) and AAAA(IPv6) addresses. Should a lookup fail, the most recent IP
  # data is used instead. An IP change will trigger a regeneration of the Cilium
  # policy for each endpoint and increment the per cilium-agent policy
  # repository revision.
  #
  # This option is disabled by default starting from version 1.4.x in favor
  # of a more powerful DNS proxy-based implementation, see [0] for details.
  # Enable this option if you want to use FQDN policies but do not want to use
  # the DNS proxy.
  #
  # To ease upgrade, users may opt to set this option to "true".
  # Otherwise please refer to the Upgrade Guide [1] which explains how to
  # prepare policy rules for upgrade.
  #
  # [0] http://docs.cilium.io/en/stable/policy/language/#dns-based
  # [1] http://docs.cilium.io/en/stable/install/upgrade/#changes-that-may-require-action
  tofqdns-enable-poller: "false"

  # wait-bpf-mount makes init container wait until bpf filesystem is mounted
  wait-bpf-mount: "false"

  masquerade: "true"
  enable-xt-socket-fallback: "true"
  install-iptables-rules: "true"
  auto-direct-node-routes: "false"
  kube-proxy-replacement:  "probe"
  enable-host-reachable-services: "false"
  enable-external-ips: "false"
  enable-node-port: "false"
  node-port-bind-protection: "true"
  enable-auto-protect-node-port-range: "true"
  enable-endpoint-health-checking: "true"
  enable-well-known-identities: "false"
  enable-remote-node-identity: "true"
---
# Source: cilium/charts/agent/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cilium
rules:
- apiGroups:
  - networking.k8s.io
  resources:
  - networkpolicies
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - discovery.k8s.io
  resources:
  - endpointslices
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - namespaces
  - services
  - nodes
  - endpoints
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - pods
  - nodes
  verbs:
  - get
  - list
  - watch
  - update
- apiGroups:
  - ""
  resources:
  - nodes
  - nodes/status
  verbs:
  - patch
- apiGroups:
  - apiextensions.k8s.io
  resources:
  - customresourcedefinitions
  verbs:
  - create
  - get
  - list
  - watch
  - update
- apiGroups:
  - cilium.io
  resources:
  - ciliumnetworkpolicies
  - ciliumnetworkpolicies/status
  - ciliumclusterwidenetworkpolicies
  - ciliumclusterwidenetworkpolicies/status
  - ciliumendpoints
  - ciliumendpoints/status
  - ciliumnodes
  - ciliumnodes/status
  - ciliumidentities
  - ciliumidentities/status
  verbs:
  - '*'
---
# Source: cilium/charts/operator/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cilium-operator
rules:
- apiGroups:
  - ""
  resources:
  # to automatically delete [core|kube]dns pods so that are starting to being
  # managed by Cilium
  - pods
  verbs:
  - get
  - list
  - watch
  - delete
- apiGroups:
  - discovery.k8s.io
  resources:
  - endpointslices
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  # to automatically read from k8s and import the node's pod CIDR to cilium's
  # etcd so all nodes know how to reach another pod running in in a different
  # node.
  - nodes
  # to perform the translation of a CNP that contains `ToGroup` to its endpoints
  - services
  - endpoints
  # to check apiserver connectivity
  - namespaces
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - cilium.io
  resources:
  - ciliumnetworkpolicies
  - ciliumnetworkpolicies/status
  - ciliumclusterwidenetworkpolicies
  - ciliumclusterwidenetworkpolicies/status
  - ciliumendpoints
  - ciliumendpoints/status
  - ciliumnodes
  - ciliumnodes/status
  - ciliumidentities
  - ciliumidentities/status
  verbs:
  - '*'
---
# Source: cilium/charts/agent/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cilium
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cilium
subjects:
- kind: ServiceAccount
  name: cilium
  namespace: kube-system
---
# Source: cilium/charts/operator/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cilium-operator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cilium-operator
subjects:
- kind: ServiceAccount
  name: cilium-operator
  namespace: kube-system
---
# Source: cilium/charts/agent/templates/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    k8s-app: cilium
  name: cilium
  namespace: kube-system
spec:
  selector:
    matchLabels:
      k8s-app: cilium
  template:
    metadata:
      annotations:
        # This annotation plus the CriticalAddonsOnly toleration makes
        # cilium to be a critical pod in the cluster, which ensures cilium
        # gets priority scheduling.
        # https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/
        scheduler.alpha.kubernetes.io/critical-pod: ""
      labels:
        k8s-app: cilium
    spec:
      containers:
      - args:
        - --config-dir=/tmp/cilium/config-map
        command:
        - cilium-agent
        livenessProbe:
          exec:
            command:
            - cilium
            - status
            - --brief
          failureThreshold: 10
          # The initial delay for the liveness probe is intentionally large to
          # avoid an endless kill & restart cycle if in the event that the initial
          # bootstrapping takes longer than expected.
          initialDelaySeconds: 120
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 5
        readinessProbe:
          exec:
            command:
            - cilium
            - status
            - --brief
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 5
        env:
        - name: K8S_NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: CILIUM_K8S_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: CILIUM_FLANNEL_MASTER_DEVICE
          valueFrom:
            configMapKeyRef:
              key: flannel-master-device
              name: cilium-config
              optional: true
        - name: CILIUM_FLANNEL_UNINSTALL_ON_EXIT
          valueFrom:
            configMapKeyRef:
              key: flannel-uninstall-on-exit
              name: cilium-config
              optional: true
        - name: CILIUM_CLUSTERMESH_CONFIG
          value: /var/lib/cilium/clustermesh/
        - name: CILIUM_CNI_CHAINING_MODE
          valueFrom:
            configMapKeyRef:
              key: cni-chaining-mode
              name: cilium-config
              optional: true
        - name: CILIUM_CUSTOM_CNI_CONF
          valueFrom:
            configMapKeyRef:
              key: custom-cni-conf
              name: cilium-config
              optional: true
        image: "docker.io/cilium/cilium:v1.7.6"
        imagePullPolicy: IfNotPresent
        lifecycle:
          postStart:
            exec:
              command:
              - "/cni-install.sh"
              - "--enable-debug=false"
          preStop:
            exec:
              command:
              - /cni-uninstall.sh
        name: cilium-agent
        securityContext:
          capabilities:
            add:
            - NET_ADMIN
            - SYS_MODULE
          privileged: true
        volumeMounts:
        - mountPath: /var/run/cilium
          name: cilium-run
        - mountPath: /host/opt/cni/bin
          name: cni-path
        - mountPath: /host/etc/cni/net.d
          name: etc-cni-netd
        - mountPath: /var/lib/cilium/clustermesh
          name: clustermesh-secrets
          readOnly: true
        - mountPath: /tmp/cilium/config-map
          name: cilium-config-path
          readOnly: true
          # Needed to be able to load kernel modules
        - mountPath: /lib/modules
          name: lib-modules
          readOnly: true
        - mountPath: /run/xtables.lock
          name: xtables-lock
      hostNetwork: true
      initContainers:
      - command:
        - /init-container.sh
        env:
        - name: CILIUM_ALL_STATE
          valueFrom:
            configMapKeyRef:
              key: clean-cilium-state
              name: cilium-config
              optional: true
        - name: CILIUM_BPF_STATE
          valueFrom:
            configMapKeyRef:
              key: clean-cilium-bpf-state
              name: cilium-config
              optional: true
        - name: CILIUM_WAIT_BPF_MOUNT
          valueFrom:
            configMapKeyRef:
              key: wait-bpf-mount
              name: cilium-config
              optional: true
        image: "docker.io/cilium/cilium:v1.7.6"
        imagePullPolicy: IfNotPresent
        name: clean-cilium-state
        securityContext:
          capabilities:
            add:
            - NET_ADMIN
          privileged: true
        volumeMounts:
        - mountPath: /var/run/cilium
          name: cilium-run
      restartPolicy: Always
      priorityClassName: system-node-critical
      serviceAccount: cilium
      serviceAccountName: cilium
      terminationGracePeriodSeconds: 1
      tolerations:
      - operator: Exists
      volumes:
        # To keep state between restarts / upgrades
      - hostPath:
          path: /var/run/cilium
          type: DirectoryOrCreate
        name: cilium-run
      # To install cilium cni plugin in the host
      - hostPath:
          path:  /opt/cni/bin
          type: DirectoryOrCreate
        name: cni-path
        # To install cilium cni configuration in the host
      - hostPath:
          path: /etc/cni/net.d
          type: DirectoryOrCreate
        name: etc-cni-netd
        # To be able to load kernel modules
      - hostPath:
          path: /lib/modules
        name: lib-modules
        # To access iptables concurrently with other processes (e.g. kube-proxy)
      - hostPath:
          path: /run/xtables.lock
          type: FileOrCreate
        name: xtables-lock
        # To read the clustermesh configuration
      - name: clustermesh-secrets
        secret:
          defaultMode: 420
          optional: true
          secretName: cilium-clustermesh
        # To read the configuration from the config map
      - configMap:
          name: cilium-config
        name: cilium-config-path
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 2
    type: RollingUpdate
---
# Source: cilium/charts/operator/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.cilium/app: operator
    name: cilium-operator
  name: cilium-operator
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      io.cilium/app: operator
      name: cilium-operator
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      annotations:
      labels:
        io.cilium/app: operator
        name: cilium-operator
    spec:
      containers:
      - args:
        - --debug=$(CILIUM_DEBUG)
        - --identity-allocation-mode=$(CILIUM_IDENTITY_ALLOCATION_MODE)
        - --synchronize-k8s-nodes=true
        command:
        - cilium-operator
        env:
        - name: CILIUM_K8S_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: K8S_NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: CILIUM_DEBUG
          valueFrom:
            configMapKeyRef:
              key: debug
              name: cilium-config
              optional: true
        - name: CILIUM_CLUSTER_NAME
          valueFrom:
            configMapKeyRef:
              key: cluster-name
              name: cilium-config
              optional: true
        - name: CILIUM_CLUSTER_ID
          valueFrom:
            configMapKeyRef:
              key: cluster-id
              name: cilium-config
              optional: true
        - name: CILIUM_IPAM
          valueFrom:
            configMapKeyRef:
              key: ipam
              name: cilium-config
              optional: true
        - name: CILIUM_DISABLE_ENDPOINT_CRD
          valueFrom:
            configMapKeyRef:
              key: disable-endpoint-crd
              name: cilium-config
              optional: true
        - name: CILIUM_KVSTORE
          valueFrom:
            configMapKeyRef:
              key: kvstore
              name: cilium-config
              optional: true
        - name: CILIUM_KVSTORE_OPT
          valueFrom:
            configMapKeyRef:
              key: kvstore-opt
              name: cilium-config
              optional: true
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              key: AWS_ACCESS_KEY_ID
              name: cilium-aws
              optional: true
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              key: AWS_SECRET_ACCESS_KEY
              name: cilium-aws
              optional: true
        - name: AWS_DEFAULT_REGION
          valueFrom:
            secretKeyRef:
              key: AWS_DEFAULT_REGION
              name: cilium-aws
              optional: true
        - name: CILIUM_IDENTITY_ALLOCATION_MODE
          valueFrom:
            configMapKeyRef:
              key: identity-allocation-mode
              name: cilium-config
              optional: true
        image: "docker.io/cilium/operator:v1.7.6"
        imagePullPolicy: IfNotPresent
        name: cilium-operator
        livenessProbe:
          httpGet:
            host: '127.0.0.1'
            path: /healthz
            port: 9234
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 10
          timeoutSeconds: 3
      hostNetwork: true
      restartPolicy: Always
      serviceAccount: cilium-operator
      serviceAccountName: cilium-operator

スケゞュヌラログは次のずおりです。
I0709 23:08:22.055830 1 registry.go:150] Registering EvenPodsSpread predicate and priority function I0709 23:08:22.056081 1 registry.go:150] Registering EvenPodsSpread predicate and priority function I0709 23:08:23.137451 1 serving.go:313] Generated self-signed cert in-memory W0709 23:08:33.843509 1 authentication.go:297] Error looking up in-cluster authentication configuration: etcdserver: request timed out W0709 23:08:33.843671 1 authentication.go:298] Continuing without authentication configuration. This may treat all requests as anonymous. W0709 23:08:33.843710 1 authentication.go:299] To require authentication configuration lookup to succeed, set --authentication-tolerate-lookup-failure=false I0709 23:08:33.911805 1 registry.go:150] Registering EvenPodsSpread predicate and priority function I0709 23:08:33.911989 1 registry.go:150] Registering EvenPodsSpread predicate and priority function W0709 23:08:33.917999 1 authorization.go:47] Authorization is disabled W0709 23:08:33.918162 1 authentication.go:40] Authentication is disabled I0709 23:08:33.918238 1 deprecated_insecure_serving.go:51] Serving healthz insecurely on [::]:10251 I0709 23:08:33.925860 1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::client-ca-file I0709 23:08:33.926013 1 shared_informer.go:223] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::client-ca-file I0709 23:08:33.930685 1 secure_serving.go:178] Serving securely on 127.0.0.1:10259 I0709 23:08:33.936198 1 tlsconfig.go:240] Starting DynamicServingCertificateController I0709 23:08:34.026382 1 shared_informer.go:230] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file I0709 23:08:34.036998 1 leaderelection.go:242] attempting to acquire leader lease kube-system/kube-scheduler... I0709 23:08:50.597201 1 leaderelection.go:252] successfully acquired lease kube-system/kube-scheduler E0709 23:08:50.658551 1 factory.go:503] pod: kube-system/coredns-66bff467f8-9rjvd is already present in the active queue E0709 23:12:27.673854 1 factory.go:503] pod kube-system/cilium-vv466 is already present in the backoff queue E0709 23:12:58.099432 1 leaderelection.go:320] error retrieving resource lock kube-system/kube-scheduler: etcdserver: leader changed

スケゞュヌラポッドを再起動するず、保留䞭のポッドはすぐにスケゞュヌルを蚭定したす。

どのポッドむベントを取埗したすか ノヌドに汚染があるかどうか知っおいたすか
スケゞュヌルされおいないずころは マスタヌノヌドたたはいずれかでのみ倱敗したすか
ノヌド ノヌドに十分なスペヌスがありたすか

2020幎7月9日朚曜日、午埌7時49分dilyevsky、 notifications @ github.com
曞きたした

これは、dsポッドのノヌドのmetadata.nameにすぎないようです...
倉だ。 これがポッドyamlです

apiVersionv1kindPodmetadata
泚釈
Scheduler.alpha.kubernetes.io/critical-pod ""
CreationTimestamp "2020-07-09T231753Z"
generateName繊毛-
ラベル
controller-revision-hash6c94db8bb8
k8s-app繊毛
pod-template-generation "1"
managedFields
管理フィヌルドがらくた
名前繊毛-d5n4f
名前空間kube-system
ownerReferences

  • apiVersionapps / v1
    blockOwnerDeletiontrue
    コントロヌラヌtrue
    皮類DaemonSet
    名前繊毛
    uid0f00e8af-eb19-4985-a940-a02fa84fcbc5
    resourceVersion "2840"
    selfLink/ api / v1 / namespaces / kube-system / pods / cilium-d5n4f
    uide3f7d566-ee5b-4557-8d1b-f0964cde2f22spec
    芪和性
    nodeAffinity
    requiredDuringSchedulingIgnoredDuringExecution
    nodeSelectorTerms
    --matchFields
    -キヌmetadata.name
    挔算子で
    倀
    --us-central1-dilyevsky-master-qmwnl
    コンテナ
  • 匕数

    • --config-dir = / tmp / cilium / config-map

      コマンド

    • 繊毛剀

      env

    • 名前K8S_NODE_NAME

      valueFrom

      fieldRef

      apiVersionv1

      fieldPathspec.nodeName

    • 名前CILIUM_K8S_NAMESPACE

      valueFrom

      fieldRef

      apiVersionv1

      fieldPathmetadata.namespace

    • 名前CILIUM_FLANNEL_MASTER_DEVICE

      valueFrom

      configMapKeyRef

      キヌフランネル-マスタヌ-デバむス

      名前cilium-config

      オプションtrue

    • 名前CILIUM_FLANNEL_UNINSTALL_ON_EXIT

      valueFrom

      configMapKeyRef

      キヌflannel-uninstall-on-exit

      名前cilium-config

      オプションtrue

    • 名前CILIUM_CLUSTERMESH_CONFIG

      倀/ var / lib / cilium / clustermesh /

    • 名前CILIUM_CNI_CHAINING_MODE

      valueFrom

      configMapKeyRef

      キヌcni-chaining-mode

      名前cilium-config

      オプションtrue

    • 名前CILIUM_CUSTOM_CNI_CONF

      valueFrom

      configMapKeyRef

      キヌcustom-cni-conf

      名前cilium-config

      オプションtrue

      画像docker.io/cilium/ cilium v1.7.6

      imagePullPolicyIfNotPresent

      ラむフサむクル

      postStart

      exec

      コマンド



      • /cni-install.sh


      • --enable-debug = false


        preStop


        exec


        コマンド


      • /cni-uninstall.sh


        livenessProbe


        exec


        コマンド





        • 繊毛



        • 状態



        • -簡単な説明



          failureThreshold10



          initialDelaySeconds120



          periodSeconds30



          successThreshold1



          timeoutSeconds5



          名前繊毛剀



          readinessProbe



          exec



          コマンド



        • 繊毛



        • 状態



        • -簡単な説明



          failureThreshold3



          initialDelaySeconds5



          periodSeconds30



          successThreshold1



          timeoutSeconds5



          リ゜ヌス{}



          securityContext



          機胜



          远加



        • NET_ADMIN



        • SYS_MODULE



          特暩true



          タヌミネヌションメッセヌゞパス/ dev / termination-log



          terminalMessagePolicyファむル



          volumeMounts






    • mountPath/ var / run / cilium

      名前繊毛-run

    • mountPath/ host / opt / cni / bin

      名前cni-path

    • mountPath/host/etc/cni/net.d

      名前etc-cni-netd

    • mountPath/ var / lib / cilium / clustermesh

      名前clustermesh-secrets

      readOnlytrue

    • mountPath/ tmp / cilium / config-map

      名前cilium-config-path

      readOnlytrue

    • mountPath/ lib / modules

      名前lib-modules

      readOnlytrue

    • mountPath/run/xtables.lock

      名前xtables-lock

    • mountPath/var/run/secrets/kubernetes.io/serviceaccount

      名前繊毛トヌクン-j74lr

      readOnlytrue

      dnsPolicyClusterFirst

      enableServiceLinkstrue

      hostNetworktrue

      initContainers

  • コマンド

    • /init-container.sh

      env

    • 名前CILIUM_ALL_STATE

      valueFrom

      configMapKeyRef

      キヌclean-cilium-state

      名前cilium-config

      オプションtrue

    • 名前CILIUM_BPF_STATE

      valueFrom

      configMapKeyRef

      キヌclean-cilium-bpf-state

      名前cilium-config

      オプションtrue

    • 名前CILIUM_WAIT_BPF_MOUNT

      valueFrom

      configMapKeyRef

      キヌwait-bpf-mount

      名前cilium-config

      オプションtrue

      画像docker.io/cilium/ cilium v1.7.6

      imagePullPolicyIfNotPresent

      名前clean-cilium-state

      リ゜ヌス{}

      securityContext

      機胜

      远加



      • NET_ADMIN


        特暩true


        タヌミネヌションメッセヌゞパス/ dev / termination-log


        terminalMessagePolicyファむル


        volumeMounts



    • mountPath/ var / run / cilium

      名前繊毛-run

    • mountPath/var/run/secrets/kubernetes.io/serviceaccount

      名前繊毛トヌクン-j74lr

      readOnlytrue

      優先床2000001000

      priorityClassNameシステムノヌドクリティカル

      restartPolicy垞に

      スケゞュヌラ名デフォルト-スケゞュヌラ

      securityContext{}

      serviceAccount繊毛

      serviceAccountName繊毛

      終了GracePeriodSeconds1

      蚱容範囲

  • オペレヌタヌ存圚したす
  • 効果NoExecute
    キヌnode.kubernetes.io/not-ready
    オペレヌタヌ存圚したす
  • 効果NoExecute
    キヌnode.kubernetes.io/unreachable
    オペレヌタヌ存圚したす
  • 効果NoSchedule
    キヌnode.kubernetes.io/disk-pressure
    オペレヌタヌ存圚したす
  • 効果NoSchedule
    キヌnode.kubernetes.io/memory-pressure
    オペレヌタヌ存圚したす
  • 効果NoSchedule
    キヌnode.kubernetes.io/pid-pressure
    オペレヌタヌ存圚したす
  • 効果NoSchedule
    キヌnode.kubernetes.io/unschedulable
    オペレヌタヌ存圚したす
  • 効果NoSchedule
    キヌnode.kubernetes.io/network-利甚䞍可
    オペレヌタヌ存圚したす
    ボリュヌム
  • hostPath
    パス/ var / run / cilium
    タむプDirectoryOrCreate
    名前繊毛-run
  • hostPath
    パス/ opt / cni / bin
    タむプDirectoryOrCreate
    名前cni-path
  • hostPath
    パス/etc/cni/net.d
    タむプDirectoryOrCreate
    名前etc-cni-netd
  • hostPath
    パス/ lib / modules
    タむプ ""
    名前lib-modules
  • hostPath
    パス/run/xtables.lock
    タむプFileOrCreate
    名前xtables-lock
  • 名前clustermesh-secrets
    秘密
    defaultMode420
    オプションtrue
    secretNamecilium-clustermesh
  • configMap
    defaultMode420
    名前cilium-config
    名前cilium-config-path
  • 名前繊毛トヌクン-j74lr
    秘密
    defaultMode420
    secretNamecilium-token-j74lrstatus
    条件
  • lastProbeTimenull
    lastTransitionTime "2020-07-09T231753Z"
    メッセヌゞ「0/6ノヌドが䜿甚可胜です5ノヌドがノヌドセレクタヌず䞀臎したせんでした。」
    理由予定倖
    ステヌタス「False」
    タむプPodScheduled
    フェヌズ保留䞭
    qosClassBestEffort

私がこれを再珟する方法は、2぀のマスタヌず
3぀のワヌカヌノヌドクラスタヌAPIを䜿甚ずCilium 1.7.6の適甚

---゜ヌスcilium / charts / agent / templates / serviceaccount.yamlapiVersionv1kindServiceAccountmetadata
名前繊毛
名前空間kube-system
---゜ヌスcilium / charts / operator / templates / serviceaccount.yamlapiVersionv1kindServiceAccountmetadata
名前繊毛オペレヌタヌ
名前空間kube-system
---゜ヌスcilium / charts / config / templates / configmap.yamlapiVersionv1kindConfigMapmetadata
名前cilium-config
名前空間kube-systemdata

アむデンティティ割り圓おモヌドは、繊毛間でアむデンティティを共有する方法を遞択したす
ノヌドの保存方法を蚭定したす。 オプションは「crd」たたは「kvstore」です。
-「crd」は、アむデンティティをCRDカスタムリ゜ヌス定矩ずしおkubernetesに保存したす。
これらは次のコマンドで照䌚できたす。
kubectl get ciliumid
-「kvstore」は、kvstoreなどのetcdたたはconsulにIDを栌玍したす。
以䞋で構成。 1.6より前のCiliumバヌゞョンはkvstoreのみをサポヌトしおいたした
バック゚ンド。 これらの叀い繊毛バヌゞョンからのアップグレヌドは、匕き続き䜿甚する必芁がありたす
以䞋のidentity-allocation-modeをコメントアりトしお、kvstore、たたは
「kvstore」に蚭定したす。
アむデンティティ割り圓おモヌドcrd

ciliumをデバッグモヌドで実行する堎合は、この倀をtrueに倉曎したす
デバッグ「false」

IPv4アドレッシングを有効にしたす。 有効にするず、すべおの゚ンドポむントにIPv4が割り圓おられたす
 䜏所。
enable-ipv4 "true"

IPv6アドレッシングを有効にしたす。 有効にするず、すべおの゚ンドポむントにIPv6が割り圓おられたす
 䜏所。
enable-ipv6 "false"

繊毛モニタヌでパケットのトレヌスを集玄する堎合は、このレベルを蚭定したす
から「䜎」、「䞭」、たたは「最倧」。 レベルが高いほど、パケットは少なくなりたす。
モニタヌ出力に衚瀺されたす。
モニタヌ集玄䞭

モニタヌの集玄間隔は、モニタヌ間の䞀般的な時間を管理したす
蚱可された接続ごずの通知むベント。

モニタヌの集蚈が「䞭」以䞊に蚭定されおいる堎合にのみ有効です。
モニタヌ-集箄-間隔5秒

モニタヌ集玄フラグは、どのTCPフラグを決定したす。
最初の芳察、モニタヌ通知を生成させたす。

モニタヌの集蚈が「䞭」以䞊に蚭定されおいる堎合にのみ有効です。
monitor-aggregation-flagsすべお

ct-global-max-entries- *接続の最倧数を指定したす
すべおの゚ンドポむントでサポヌトされ、プロトコルtcpたたはその他で分割されたす。 ワンペア
マップの数は、IPv4接続、および別のマップのペアにこれらの倀を䜿甚したす
これらの倀をIPv6接続に䜿甚したす。

これらの倀が倉曎された堎合、次のCiliumの起動時に
進行䞭の接続の远跡が䞭断される可胜性がありたす。 これは簡単に぀ながる可胜性がありたす
ポリシヌの削陀たたは接続の負荷分散の決定の倉曎。

Cilium 1.2以前からアップグレヌドするナヌザヌの堎合、䞭断を最小限に抑えるため
アップグレヌドプロセス䞭に、これらのオプションをコメントアりトしたす。
bpf-ct-global-tcp-max "524288"
bpf-ct-global-any-max "262144"

bpf-policy-map-maxは、゚ンドポむントの゚ントリの最倧数を指定したした
ポリシヌマップ゚ンドポむントごず
bpf-policy-map-max "16384"

マップ゚ントリの事前割り圓おにより、パケットごずの遅延を枛らすこずができたす。
マップ内の゚ントリの事前メモリ割り圓おの費甚。 ザ・
以䞋のデフォルト倀は、デフォルトむンストヌルでのメモリ䜿甚量を最小限に抑えたす。
レむテンシヌに敏感なナヌザヌは、これを「true」に蚭定するこずを怜蚎できたす。

このオプションはCilium1.4で導入されたした。 Cilium1.3以前は無芖したす
このオプションは、「true」に蚭定されおいるかのように動䜜したす。

この倀が倉曎された堎合、次のCiliumの起動時に埩元
既存の゚ンドポむントの数ず進行䞭の接続の远跡が䞭断される可胜性がありたす。
これにより、ポリシヌが削陀されたり、負荷分散の決定が倉曎されたりする可胜性がありたす。
しばらくの間接続。 埩元するには、゚ンドポむントの再䜜成が必芁になる堎合がありたす
接続。

1.3以前からぞのアップグレヌド䞭にこのオプションが「false」に蚭定されおいる堎合
1.4以降の堎合、アップグレヌド䞭に1回限りの䞭断が発生する可胜性がありたす。
preallocate-bpf-maps "false"

互換性のあるIstioサむドカヌistio-proxyに䞀臎する正芏衚珟
コンテナむメヌゞ名
sidecar-istio-proxy-image "cilium / istio_proxy"

ノヌド間の通信のためのカプセル化モヌド
可胜な倀
 - 無効
-vxlanデフォルト
-ゞュネヌブ
トンネルvxlan

クラスタヌの名前。 クラスタヌのメッシュを構築する堎合にのみ関係したす。
クラスタヌ名デフォルト

DNSポヌリングは、からのmatchNameごずにDNSルックアップを定期的に発行したす
繊毛剀。 結果は、゚ンドポむントポリシヌを再生成するために䜿甚されたす。
DNSルックアップは5秒間隔で繰り返され、
AIPv4およびAAAAIPv6アドレス。 ルックアップが倱敗した堎合、最新のIP
代わりにデヌタが䜿甚されたす。 IPの倉曎により、繊毛の再生がトリガヌされたす
各゚ンドポむントのポリシヌずcilium-agentごずのポリシヌをむンクリメントしたす
リポゞトリのリビゞョン。

このオプションは、バヌゞョン1.4.x以降、デフォルトで無効になっおいたす。
より匷力なDNSプロキシベヌスの実装の。詳现に぀いおは、[0]を参照しおください。
FQDNポリシヌを䜿甚したいが、䜿甚したくない堎合は、このオプションを有効にしたす
DNSプロキシ。

アップグレヌドを容易にするために、ナヌザヌはこのオプションを「true」に蚭定するこずを遞択できたす。
それ以倖の堎合は、アップグレヌドガむド[1]を参照しおください。
アップグレヌド甚のポリシヌルヌルを準備したす。

[0] http://docs.cilium.io/en/stable/policy/language/#dnsベヌス
[1] http://docs.cilium.io/en/stable/install/upgrade/#changes -that-may-require-action
tofqdns-enable-poller "false"

wait-bpf-mountは、bpfファむルシステムがマりントされるたでinitコンテナを埅機させたす
wait-bpf-mount "false"

マスカレヌド「本圓」
enable-xt-socket-fallback "true"
install-iptables-rules "true"
auto-direct-node-routes "false"
kube-proxy-replacement "プロヌブ"
enable-host-reachable-services "false"
enable-external-ips "false"
enable-node-port "false"
node-port-bind-protection "true"
enable-auto-protect-node-port-range "true"
enable-endpoint-health-checking "true"
enable-well-known-identities "false"
enable-remote-node-identity "true"
---゜ヌスcilium / charts / agent / templates / clusterrole.yamlapiVersionrbac.authorization.k8s.io/v1kindClusterRolemetadata
名前ciliumrules

  • apiGroups

    • network.k8s.io

      リ゜ヌス

    • ネットワヌクポリシヌ

      動詞

    • 取埗する

    • リスト

    • 芋る

  • apiGroups

    • Discovery.k8s.io

      リ゜ヌス

    • ゚ンドポむントスラむス

      動詞

    • 取埗する

    • リスト

    • 芋る

  • apiGroups

    • 「」

      リ゜ヌス

    • 名前空間

    • サヌビス

    • ノヌド

    • ゚ンドポむント

      動詞

    • 取埗する

    • リスト

    • 芋る

  • apiGroups

    • 「」

      リ゜ヌス

    • ポッド

    • ノヌド

      動詞

    • 取埗する

    • リスト

    • 芋る

    • 曎新

  • apiGroups

    • 「」

      リ゜ヌス

    • ノヌド

    • ノヌド/ステヌタス

      動詞

    • パッチ

  • apiGroups

    • apiextensions.k8s.io

      リ゜ヌス

    • customresourcedefinitions

      動詞

    • 䜜成する

    • 取埗する

    • リスト

    • 芋る

    • 曎新

  • apiGroups

    • cilium.io

      リ゜ヌス

    • ciliumnetworkpolicies

    • ciliumnetworkpolicies / status

    • ciliumclusterwidenetworkpolicies

    • ciliumclusterwidenetworkpolicies / status

    • ciliumendpoints

    • ciliumendpoints / status

    • ciliumnodes

    • ciliumnodes / status

    • ciliumidentities

    • ciliumidentities / status

      動詞

    • '*'

      ---゜ヌスcilium / charts / operator / templates / clusterrole.yamlapiVersionrbac.authorization.k8s.io/v1kindClusterRolemetadata

      名前繊毛-オペレヌタヌルヌル

  • apiGroups

    • 「」

      リ゜ヌス

      [core | kube] dnsポッドを自動的に削陀しお、

      Ciliumが管理

    • ポッド

      動詞

    • 取埗する

    • リスト

    • 芋る

    • 削陀

  • apiGroups

    • Discovery.k8s.io

      リ゜ヌス

    • ゚ンドポむントスラむス

      動詞

    • 取埗する

    • リスト

    • 芋る

  • apiGroups

    • 「」

      リ゜ヌス

      k8sから自動的に読み取り、ノヌドのポッドCIDRを繊毛にむンポヌトしたす

      etcdで、すべおのノヌドが別のポッドで実行されおいる別のポッドに到達する方法を認識したす

      ノヌド。

    • ノヌド

       ToGroupを含むCNPの゚ンドポむントぞの倉換を実行したす

    • サヌビス

    • ゚ンドポむント

      apiserverの接続を確認する

    • 名前空間

      動詞

    • 取埗する

    • リスト

    • 芋る

  • apiGroups

    • cilium.io

      リ゜ヌス

    • ciliumnetworkpolicies

    • ciliumnetworkpolicies / status

    • ciliumclusterwidenetworkpolicies

    • ciliumclusterwidenetworkpolicies / status

    • ciliumendpoints

    • ciliumendpoints / status

    • ciliumnodes

    • ciliumnodes / status

    • ciliumidentities

    • ciliumidentities / status

      動詞

    • '*'

      ---゜ヌスcilium / charts / agent / templates / clusterrolebinding.yamlapiVersionrbac.authorization.k8s.io/v1kindClusterRoleBindingmetadata

      名前ciliumroleRef

      apiGrouprbac.authorization.k8s.io

      皮類ClusterRole

      名前ciliumsubjects

  • 皮類ServiceAccount
    名前繊毛
    名前空間kube-system
    ---゜ヌスcilium / charts / operator / templates / clusterrolebinding.yamlapiVersionrbac.authorization.k8s.io/v1kindClusterRoleBindingmetadata
    名前cilium-operatorroleRef
    apiGrouprbac.authorization.k8s.io
    皮類ClusterRole
    名前繊毛-オペレヌタヌ被隓者
  • 皮類ServiceAccount
    名前繊毛オペレヌタヌ
    名前空間kube-system
    ---゜ヌスcilium / charts / agent /テンプレヌト/daemonset.yamlapiバヌゞョンapps / v1kindDaemonSetmetadata
    ラベル
    k8s-app繊毛
    名前繊毛
    名前空間kube-systemspec
    セレクタ
    matchLabels
    k8s-app繊毛
    テンプレヌト
    メタデヌタ
    泚釈
    このアノテヌションずCriticalAddonsOnlyの蚱容範囲により
    繊毛はクラスタヌ内の重芁なポッドであり、繊毛を確保したす
    優先スケゞュヌリングを取埗したす。
    https//kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/
    Scheduler.alpha.kubernetes.io/critical-pod ""
    ラベル
    k8s-app繊毛
    スペック
    コンテナ

    • 匕数



      • --config-dir = / tmp / cilium / config-map


        コマンド


      • 繊毛剀


        livenessProbe


        exec


        コマンド





        • 繊毛



        • 状態



        • -簡単な説明



          failureThreshold10



          掻性プロヌブの初期遅延は意図的に倧きくなりたす



          最初の堎合、無限のキルリスタヌトサむクルを回避する



          ブヌトストラップに予想よりも時間がかかりたす。



          initialDelaySeconds120



          periodSeconds30



          successThreshold1



          timeoutSeconds5



          readinessProbe



          exec



          コマンド



        • 繊毛



        • 状態



        • -簡単な説明



          failureThreshold3



          initialDelaySeconds5



          periodSeconds30



          successThreshold1



          timeoutSeconds5



          env





      • 名前K8S_NODE_NAME


        valueFrom


        fieldRef


        apiVersionv1


        fieldPathspec.nodeName


      • 名前CILIUM_K8S_NAMESPACE


        valueFrom


        fieldRef


        apiVersionv1


        fieldPathmetadata.namespace


      • 名前CILIUM_FLANNEL_MASTER_DEVICE


        valueFrom


        configMapKeyRef


        キヌフランネル-マスタヌ-デバむス


        名前cilium-config


        オプションtrue


      • 名前CILIUM_FLANNEL_UNINSTALL_ON_EXIT


        valueFrom


        configMapKeyRef


        キヌflannel-uninstall-on-exit


        名前cilium-config


        オプションtrue


      • 名前CILIUM_CLUSTERMESH_CONFIG


        倀/ var / lib / cilium / clustermesh /


      • 名前CILIUM_CNI_CHAINING_MODE


        valueFrom


        configMapKeyRef


        キヌcni-chaining-mode


        名前cilium-config


        オプションtrue


      • 名前CILIUM_CUSTOM_CNI_CONF


        valueFrom


        configMapKeyRef


        キヌcustom-cni-conf


        名前cilium-config


        オプションtrue


        画像「 docker.io/cilium/cilium:v1.7.6 」


        imagePullPolicyIfNotPresent


        ラむフサむクル


        postStart


        exec


        コマンド





        • 「/cni-install.sh」



        • "--enable-debug = false"



          preStop



          exec



          コマンド



        • /cni-uninstall.sh



          名前繊毛剀



          securityContext



          機胜



          远加







          • NET_ADMIN




          • SYS_MODULE




            特暩true




            volumeMounts









      • mountPath/ var / run / cilium


        名前繊毛-run


      • mountPath/ host / opt / cni / bin


        名前cni-path


      • mountPath/host/etc/cni/net.d


        名前etc-cni-netd


      • mountPath/ var / lib / cilium / clustermesh


        名前clustermesh-secrets


        readOnlytrue


      • mountPath/ tmp / cilium / config-map


        名前cilium-config-path


        readOnlytrue


        カヌネルモゞュヌルをロヌドできるようにする必芁がありたす


      • mountPath/ lib / modules


        名前lib-modules


        readOnlytrue


      • mountPath/run/xtables.lock


        名前xtables-lock


        hostNetworktrue


        initContainers



    • コマンド



      • /init-container.sh


        env


      • 名前CILIUM_ALL_STATE


        valueFrom


        configMapKeyRef


        キヌclean-cilium-state


        名前cilium-config


        オプションtrue


      • 名前CILIUM_BPF_STATE


        valueFrom


        configMapKeyRef


        キヌclean-cilium-bpf-state


        名前cilium-config


        オプションtrue


      • 名前CILIUM_WAIT_BPF_MOUNT


        valueFrom


        configMapKeyRef


        キヌwait-bpf-mount


        名前cilium-config


        オプションtrue


        画像「 docker.io/cilium/cilium:v1.7.6 」


        imagePullPolicyIfNotPresent


        名前clean-cilium-state


        securityContext


        機胜


        远加





        • NET_ADMIN



          特暩true



          volumeMounts





      • mountPath/ var / run / cilium


        名前繊毛-run


        restartPolicy垞に


        priorityClassNameシステムノヌドクリティカル


        serviceAccount繊毛


        serviceAccountName繊毛


        終了GracePeriodSeconds1


        蚱容範囲



    • オペレヌタヌ存圚したす

      ボリュヌム

      再起動/アップグレヌド間で状態を維持するには

    • hostPath

      パス/ var / run / cilium

      タむプDirectoryOrCreate

      名前繊毛-run

      ホストに繊毛cniプラグむンをむンストヌルするには

    • hostPath

      パス/ opt / cni / bin

      タむプDirectoryOrCreate

      名前cni-path

      ホストに繊毛cni構成をむンストヌルするには

    • hostPath

      パス/etc/cni/net.d

      タむプDirectoryOrCreate

      名前etc-cni-netd

      カヌネルモゞュヌルをロヌドできるようにする

    • hostPath

      パス/ lib / modules

      名前lib-modules

      他のプロセスkube-proxyなどず同時にiptablesにアクセスするには

    • hostPath

      パス/run/xtables.lock

      タむプFileOrCreate

      名前xtables-lock

      clustermesh構成を読み取るには

    • 名前clustermesh-secrets

      秘密

      defaultMode420

      オプションtrue

      secretNamecilium-clustermesh

      構成マップから構成を読み取るには

    • configMap

      名前cilium-config

      名前cilium-config-path

      updateStrategy

      RollingUpdate

      maxUnavailable2

      タむプRollingUpdate

      ---゜ヌスcilium / charts / operator / templates / deployment.yamlapiVersionapps / v1kindDeploymentmetadata

      ラベル

      io.cilium / app挔算子

      名前繊毛オペレヌタヌ

      名前繊毛オペレヌタヌ

      名前空間kube-systemspec

      レプリカ1

      セレクタ

      matchLabels

      io.cilium / app挔算子

      名前繊毛オペレヌタヌ

      戊略

      RollingUpdate

      maxSurge1

      maxUnavailable1

      タむプRollingUpdate

      テンプレヌト

      メタデヌタ

      泚釈

      ラベル

      io.cilium / app挔算子

      名前繊毛オペレヌタヌ

      スペック

      コンテナ

    • 匕数



      • --debug = $CILIUM_DEBUG


      • --identity-allocation-mode = $CILIUM_IDENTITY_ALLOCATION_MODE


      • --synchronize-k8s-nodes = true


        コマンド


      • 繊毛オペレヌタヌ


        env


      • 名前CILIUM_K8S_NAMESPACE


        valueFrom


        fieldRef


        apiVersionv1


        fieldPathmetadata.namespace


      • 名前K8S_NODE_NAME


        valueFrom


        fieldRef


        apiVersionv1


        fieldPathspec.nodeName


      • 名前CILIUM_DEBUG


        valueFrom


        configMapKeyRef


        キヌデバッグ


        名前cilium-config


        オプションtrue


      • 名前CILIUM_CLUSTER_NAME


        valueFrom


        configMapKeyRef


        キヌクラスタヌ名


        名前cilium-config


        オプションtrue


      • 名前CILIUM_CLUSTER_ID


        valueFrom


        configMapKeyRef


        キヌcluster-id


        名前cilium-config


        オプションtrue


      • 名前CILIUM_IPAM


        valueFrom


        configMapKeyRef


        キヌipam


        名前cilium-config


        オプションtrue


      • 名前CILIUM_DISABLE_ENDPOINT_CRD


        valueFrom


        configMapKeyRef


        キヌdisable-endpoint-crd


        名前cilium-config


        オプションtrue


      • 名前CILIUM_KVSTORE


        valueFrom


        configMapKeyRef


        キヌkvstore


        名前cilium-config


        オプションtrue


      • 名前CILIUM_KVSTORE_OPT


        valueFrom


        configMapKeyRef


        キヌkvstore-opt


        名前cilium-config


        オプションtrue


      • 名前AWS_ACCESS_KEY_ID


        valueFrom


        secretKeyRef


        キヌAWS_ACCESS_KEY_ID


        名前繊毛-aws


        オプションtrue


      • 名前AWS_SECRET_ACCESS_KEY


        valueFrom


        secretKeyRef


        キヌAWS_SECRET_ACCESS_KEY


        名前繊毛-aws


        オプションtrue


      • 名前AWS_DEFAULT_REGION


        valueFrom


        secretKeyRef


        キヌAWS_DEFAULT_REGION


        名前繊毛-aws


        オプションtrue


      • 名前CILIUM_IDENTITY_ALLOCATION_MODE


        valueFrom


        configMapKeyRef


        キヌアむデンティティ割り圓おモヌド


        名前cilium-config


        オプションtrue


        画像「 docker.io/cilium/operator:v1.7.6 」


        imagePullPolicyIfNotPresent


        名前繊毛オペレヌタヌ


        livenessProbe


        httpGet


        ホスト '127.0.0.1'


        パス/ healthz


        ポヌト9234


        スキヌムHTTP


        initialDelaySeconds60


        periodSeconds10


        timeoutSeconds3


        hostNetworktrue


        restartPolicy垞に


        serviceAccountcilium-operator


        serviceAccountNamecilium-operator



—
あなたが割り圓おられたので、あなたはこれを受け取っおいたす。
このメヌルに盎接返信し、GitHubで衚瀺しおください
https://github.com/kubernetes/kubernetes/issues/91601#issuecomment-656404841 、
たたは賌読を解陀する
https://github.com/notifications/unsubscribe-auth/AAJ5E6BMTNCADT5K7D4PMF3R2ZJRVANCNFSM4NOTPEDA
。

ログレベルを䞊げ、grepを䜿甚しおノヌドをフィルタリングしおみおください
たたはポッド

2020幎7月9日朚曜日、午埌7時55分dilyevsky、 notifications @ github.com
曞きたした

スケゞュヌラログは次のずおりです。

I0709 230822.056081 1registry.go150] EvenPodsSpread述語ず優先床関数の登録
I0709 230823.137451 1serving.go313]メモリ内に生成された自己眲名蚌明曞
W0709 230833.843509 1 authentication.go297]クラスタヌ内認蚌構成の怜玢䞭に゚ラヌが発生したしたetcdserver芁求がタむムアりトしたした
W0709 230833.843671 1 authentication.go298]認蚌構成なしで続行したす。 これにより、すべおのリク゚ストが匿名ずしお扱われる堎合がありたす。
W0709 230833.843710 1 authentication.go299]認蚌構成のルックアップを成功させるには、-authentication-tolerate-lookup-failure = falseを蚭定したす。
I0709 230833.911805 1registry.go150] EvenPodsSpread述語ず優先床関数の登録
I0709 230833.911989 1 Registry.go150] EvenPodsSpread述語ず優先床関数の登録
W0709 230833.917999 1authorization.go47]認蚌が無効になっおいたす
W0709 230833.918162 1 authentication.go40]認蚌が無効になっおいたす
I0709 230833.918238 1 deprecated_insecure_serving.go51] [::]10251でhealthzを安党に提䟛しおいたせん
I0709 230833.925860 1 configmap_cafile_content.go202] client-ca :: kube-system :: extension-apiserver-authentication :: client-ca-fileを起動しおいたす
I0709 230833.926013 1 shared_informer.go223] client-ca :: kube-system :: extension-apiserver-authentication :: client-ca-fileのキャッシュが同期するのを埅機しおいたす
I0709 230833.930685 1 secure_serving.go178] 127.0.0.1:10259で安党にサヌビスを提䟛
I0709 230833.936198 1 tlsconfig.go240] DynamicServingCertificateControllerを開始しおいたす
I0709 230834.026382 1 shared_informer.go230]キャッシュはclient-ca :: kube-system :: extension-apiserver-authentication :: client-ca-fileに察しお同期されたす
I0709 230834.036998 1leaderelection.go242]リヌダヌリヌスkube-system / kube-schedulerを取埗しようずしおいたす...
I0709 230850.597201 1leaderelection.go252]リヌスkube-system / kube-schedulerの取埗に成功したした
E0709 230850.658551 1 factory.go503]ポッドkube-system / coredns-66bff467f8-9rjvdはすでにアクティブキュヌに存圚したす
E0709 231227.673854 1 factory.go503]ポッドkube-system / cilium-vv466はすでにバックオフキュヌに存圚したす
E0709 231258.099432 1leaderelection.go320]リ゜ヌスロックの取埗䞭に゚ラヌが発生したしたkube-system / kube-scheduleretcdserverリヌダヌが倉曎されたした

スケゞュヌラポッドを再起動するず、保留䞭のポッドはすぐにスケゞュヌルを蚭定したす。

—
あなたが割り圓おられたので、あなたはこれを受け取っおいたす。
このメヌルに盎接返信し、GitHubで衚瀺しおください
https://github.com/kubernetes/kubernetes/issues/91601#issuecomment-656406215 、
たたは賌読を解陀する
https://github.com/notifications/unsubscribe-auth/AAJ5E6E4QPGNNBFUYSZEJC3R2ZKHDANCNFSM4NOTPEDA
。

これらはむベントです
`` `むベント
メッセヌゞから理由幎霢を入力
---- ------ ---- ---- -------
è­Šå‘ŠFailedSchedulingdefault-scheduler 0/6ノヌドが䜿甚可胜です5぀のノヌドがノヌドセレクタヌず䞀臎したせんでした。
è­Šå‘ŠFailedSchedulingdefault-scheduler 0/6ノヌドが䜿甚可胜です5぀のノヌドがノヌドセレクタヌず䞀臎したせんでした。


The node only has two taints but the pod tolerates all existing taints and yeah it seems to only happen on masters:

汚染node-role.kubernetes.io/ masterNoSchedule
node.kubernetes.io/network-利甚䞍可NoSchedule


There is enough space and pod is best effort with no reservation anyway:
```  Resource                   Requests    Limits
  --------                   --------    ------
  cpu                        650m (32%)  0 (0%)
  memory                     70Mi (0%)   170Mi (2%)
  ephemeral-storage          0 (0%)      0 (0%)
  hugepages-1Gi              0 (0%)      0 (0%)
  hugepages-2Mi              0 (0%)      0 (0%)
  attachable-volumes-gce-pd  0           0

スケゞュヌラのログレベルを䞊げおみたす...

ポッドyamlには実際にはnode-role.kubernetes.io/master蚱容範囲がありたせん。 したがっお、マスタヌでスケゞュヌルされるべきではありたせんでした。

こんにちは 私たちは同じ問題に盎面しおいたす。 ただし、展開でも同じ問題が発生したす。この堎合、非アフィニティを䜿甚しお、ポッドが各ノヌドたたは特定のノヌドをタヌゲットずするポッドセレクタヌでスケゞュヌルされるようにしたす。
倱敗したノヌドのホスト名に䞀臎するように蚭定されたノヌドセレクタヌを䜿甚しおポッドを䜜成するだけで、スケゞュヌリングが倱敗したした。 5぀のノヌドがセレクタヌず䞀臎しおいないず蚀っおいたしたが、6番目のノヌドに぀いおは䜕もありたせんでした。 スケゞュヌラを再起動するず、問題が解決したした。 そのノヌドに぀いお䜕かがキャッシュされ、ノヌドでのスケゞュヌリングが劚げられおいるように芋えたす。
他の人が前に蚀ったように、私たちは倱敗に぀いおログに䜕もありたせん。

倱敗した展開を最小限に抑えたした倱敗しおいるマスタヌの汚染を削陀したした。

apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-deployment
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
      restartPolicy: Always
      schedulerName: default-scheduler
      nodeSelector:
        kubernetes.io/hostname: master-2

マスタヌが汚れを持っおいたずきも同じ問題があり、展開は汚れに察する蚱容範囲でした。 したがっお、デヌモンセット、蚱容範囲、たたはアフィニティ/非アフィニティに特に関連しおいるようには芋えたせん。 障害が発生し始めるず、特定のノヌドを察象ずするものは䜕もスケゞュヌルできたせん。 1.18.2から1.18.5たでの問題が芋られたす1.18.0たたは.1では詊しおいない

倱敗したノヌドのホスト名に䞀臎するように蚭定されたノヌドセレクタヌを䜿甚しおポッドを䜜成するだけで、スケゞュヌリングが倱敗する原因になりたした。

そのようなポッドを䜜成した埌、たたはそれ以前に倱敗し始めたかどうかを明確にできたすか このノヌドには、ポッドが蚱容できない汚染がなかったず思いたす。

@nodoは再珟に圹立ちたす。 NodeSelectorのコヌドを芋おいただけたすか テスト䞭にログ行を远加する必芁がある堎合がありたす。 キャッシュを印刷するこずもできたす。

  • kube-schedulerのPIDを取埗したす $ pidof kube-scheduler
  • トリガヌキュヌダンプ $ sudo kill -SIGUSR2 <pid> 。 これはスケゞュヌラプロセスを匷制終了しないこずに泚意しおください。
  • 次に、スケゞュヌラログで、「キャッシュされたNodeInfoのダンプ」、「スケゞュヌリングキュヌのダンプ」、「キャッシュ比范機胜が開始されたした」ずいう文字列を怜玢したす。

/優先床クリティカル-緊急

/ unassign

このテストデプロむメントをデプロむしようずする前に、デヌモンセットずデプロむメントが「保留䞭」でスタックしおいるのをすでに確認しおいたため、すでに倱敗しおいたした。 汚染物質はノヌドから削陀されおいたした。
珟圚、ノヌドを再起動する必芁があり、問題が衚瀺されなくなったため、これが発生しおいた環境が倱われたした。 再珟次第、詳现をお知らせしたす

そうしおください。 私は過去にこれを再珟しようずしたしたが成功したせんでした。 私は倱敗の最初の䟋にもっず興味がありたす。 それはただ汚染に関連しおいる可胜性がありたす。

問題を再珟したした。 私はあなたが芁求したコマンドを実行したした、ここに情報がありたす

I0716 14:47:52.768362       1 factory.go:462] Unable to schedule default/test-deployment-558f47bbbb-4rt5t: no fit: 0/6 nodes are available: 5 node(s) didn't match node selector.; waiting
I0716 14:47:52.768683       1 scheduler.go:776] Updating pod condition for default/test-deployment-558f47bbbb-4rt5t to (PodScheduled==False, Reason=Unschedulable)
I0716 14:47:53.018781       1 httplog.go:90] verb="GET" URI="/healthz" latency=299.172µs resp=200 UserAgent="kube-probe/1.18" srcIP="127.0.0.1:57258": 
I0716 14:47:59.469828       1 comparer.go:42] cache comparer started
I0716 14:47:59.470936       1 comparer.go:67] cache comparer finished
I0716 14:47:59.471038       1 dumper.go:47] Dump of cached NodeInfo
I0716 14:47:59.471484       1 dumper.go:49] 
Node name: master-0-bug
Requested Resources: {MilliCPU:1100 Memory:52428800 EphemeralStorage:0 AllowedPodNumber:0 ScalarResources:map[]}
Allocatable Resources:{MilliCPU:2000 Memory:3033427968 EphemeralStorage:19290208634 AllowedPodNumber:110 ScalarResources:map[hugepages-1Gi:0 hugepages-2Mi:0]}
Scheduled Pods(number: 9):
...
I0716 14:47:59.472623       1 dumper.go:60] Dump of scheduling queue:
name: coredns-cd64c8d7c-29zjq, namespace: kube-system, uid: 938e8827-5d17-4db9-ac04-d229baf4534a, phase: Pending, nominated node: 
name: test-deployment-558f47bbbb-4rt5t, namespace: default, uid: fa19fda9-c8d6-4ffe-b248-8ddd24ed5310, phase: Pending, nominated node: 

残念ながら、それは圹に立たないようです

キャッシュのダンプはデバッグ甚であり、䜕も倉曎されたせん。 ダンプを含めおいただけたせんか

たた、これが最初の゚ラヌであるず仮定しお、ポッドyamlずノヌドを含めるこずができたすか

ダンプされたものはほずんどすべおです。他のノヌドを削陀しただけです。 これは最初の゚ラヌではありたせんでしたが、ダンプにcorednsポッドが衚瀺されおいたす。これが最初の゚ラヌです。 ダンプで他に䜕を求めおいるのかわかりたせん。
yamlをフェッチしたす

おかげで、あなたが関連するノヌドずポッドをトリミングしたこずに気づきたせんでした。

ただし、そのノヌドのスケゞュヌルされたポッドを含めるこずはできたすか リ゜ヌス䜿甚量の蚈算にバグがある堎合に備えお。

Requested Resources: {MilliCPU:1100 Memory:52428800 EphemeralStorage:0 AllowedPodNumber:0 ScalarResources:map[]}

そのAllowedPodNumber: 0は奇劙に思えたす。

そのノヌド䞊の他のポッドは次のずおりです。
` name: kube-controller-manager-master-0-bug, namespace: kube-system, uid: 095eebb0-4752-419b-aac7-245e5bc436b8, phase: Running, nominated node: name: kube-proxy-xwf6h, namespace: kube-system, uid: 16552eaf-9eb8-4584-ba3c-7dff6ce92592, phase: Running, nominated node: name: kube-apiserver-master-0-bug, namespace: kube-system, uid: 1d338e26-b0bc-4cef-9bad-86b7dd2b2385, phase: Running, nominated node: name: kube-multus-ds-amd64-tpkm8, namespace: kube-system, uid: d50c0c7f-599c-41d5-a029-b43352a4f5b8, phase: Running, nominated node: name: openstack-cloud-controller-manager-wrb8n, namespace: kube-system, uid: 17aeb589-84a1-4416-a701-db6d8ef60591, phase: Running, nominated node: name: kube-scheduler-master-0-bug, namespace: kube-system, uid: 52469084-3122-4e99-92f6-453e512b640f, phase: Running, nominated node: name: subport-controller-28j9v, namespace: kube-system, uid: a5a07ac8-763a-4ff2-bdae-91c6e9e95698, phase: Running, nominated node: name: csi-cinder-controllerplugin-0, namespace: kube-system, uid: 8b16d6c8-a871-454e-98a3-0aa545f9c9d0, phase: Running, nominated node: name: calico-node-d899t, namespace: kube-system, uid: e3672030-53b1-4356-a5df-0f4afd6b9237, phase: Running, nominated node:

すべおのノヌドで、ダンプ内の芁求されたリ゜ヌスでallowedPodNumberが0に蚭定されおいたすが、他のノヌドはスケゞュヌル可胜です

ノヌドyaml

apiVersion: v1
kind: Node
metadata:
  annotations:
    kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
    node.alpha.kubernetes.io/ttl: "0"
    volumes.kubernetes.io/controller-managed-attach-detach: "true"
  creationTimestamp: "2020-07-16T09:59:48Z"
  labels:
    beta.kubernetes.io/arch: amd64
    beta.kubernetes.io/instance-type: 54019dbc-10d7-409c-8338-5556f61a9371
    beta.kubernetes.io/os: linux
    failure-domain.beta.kubernetes.io/region: regionOne
    failure-domain.beta.kubernetes.io/zone: nova
    kubernetes.io/arch: amd64
    kubernetes.io/hostname: master-0-bug
    kubernetes.io/os: linux
    node-role.kubernetes.io/master: ""
    node.kubernetes.io/instance-type: 54019dbc-10d7-409c-8338-5556f61a9371
    node.uuid: 00324054-405e-4fae-a3bf-d8509d511ded
    node.uuid_source: cloud-init
    topology.kubernetes.io/region: regionOne
    topology.kubernetes.io/zone: nova
  name: master-0-bug
  resourceVersion: "85697"
  selfLink: /api/v1/nodes/master-0-bug
  uid: 629b6ef3-3c76-455b-8b6b-196c4754fb0e
spec:
  podCIDR: 192.168.0.0/24
  podCIDRs:
  - 192.168.0.0/24
  providerID: openstack:///00324054-405e-4fae-a3bf-d8509d511ded
  taints:
  - effect: NoSchedule
    key: node-role.kubernetes.io/master
status:
  addresses:
  - address: 10.0.10.14
    type: InternalIP
  - address: master-0-bug
    type: Hostname
  allocatable:
    cpu: "2"
    ephemeral-storage: "19290208634"
    hugepages-1Gi: "0"
    hugepages-2Mi: "0"
    memory: 2962332Ki
    pods: "110"
  capacity:
    cpu: "2"
    ephemeral-storage: 20931216Ki
    hugepages-1Gi: "0"
    hugepages-2Mi: "0"
    memory: 3064732Ki
    pods: "110"
  conditions:
  - lastHeartbeatTime: "2020-07-16T10:02:20Z"
    lastTransitionTime: "2020-07-16T10:02:20Z"
    message: Calico is running on this node
    reason: CalicoIsUp
    status: "False"
    type: NetworkUnavailable
  - lastHeartbeatTime: "2020-07-16T15:46:11Z"
    lastTransitionTime: "2020-07-16T09:59:43Z"
    message: kubelet has sufficient memory available
    reason: KubeletHasSufficientMemory
    status: "False"
    type: MemoryPressure
  - lastHeartbeatTime: "2020-07-16T15:46:11Z"
    lastTransitionTime: "2020-07-16T09:59:43Z"
    message: kubelet has no disk pressure
    reason: KubeletHasNoDiskPressure
    status: "False"
    type: DiskPressure
  - lastHeartbeatTime: "2020-07-16T15:46:11Z"
    lastTransitionTime: "2020-07-16T09:59:43Z"
    message: kubelet has sufficient PID available
    reason: KubeletHasSufficientPID
    status: "False"
    type: PIDPressure
  - lastHeartbeatTime: "2020-07-16T15:46:11Z"
    lastTransitionTime: "2020-07-16T10:19:44Z"
    message: kubelet is posting ready status. AppArmor enabled
    reason: KubeletReady
    status: "True"
    type: Ready
  daemonEndpoints:
    kubeletEndpoint:
      Port: 10250
  nodeInfo:
    architecture: amd64
    bootID: fe410ed3-2825-4f94-a9f9-08dc5e6a955e
    containerRuntimeVersion: docker://19.3.11
    kernelVersion: 4.12.14-197.45-default
    kubeProxyVersion: v1.18.5
    kubeletVersion: v1.18.5
    machineID: 00324054405e4faea3bfd8509d511ded
    operatingSystem: linux
    systemUUID: 00324054-405e-4fae-a3bf-d8509d511ded

ずポッド

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2020-07-16T10:13:35Z"
  generateName: pm-node-exporter-
  labels:
    controller-revision-hash: 6466d9c7b
    pod-template-generation: "1"
  name: pm-node-exporter-mn9vj
  namespace: monitoring
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: DaemonSet
    name: pm-node-exporter
    uid: 5855a26f-a57e-4b0e-93f2-461c19c477e1
  resourceVersion: "5239"
  selfLink: /api/v1/namespaces/monitoring/pods/pm-node-exporter-mn9vj
  uid: 0db09c9c-1618-4454-94fa-138e55e5ebd7
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchFields:
          - key: metadata.name
            operator: In
            values:
            - master-0-bug
  containers:
  - args:
    - --path.procfs=/host/proc
    - --path.sysfs=/host/sys
    image: ***
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 3
      httpGet:
        path: /
        port: 9100
        scheme: HTTP
      initialDelaySeconds: 5
      periodSeconds: 5
      successThreshold: 1
      timeoutSeconds: 1
    name: pm-node-exporter
    ports:
    - containerPort: 9100
      hostPort: 9100
      name: metrics
      protocol: TCP
    resources:
      limits:
        cpu: 200m
        memory: 150Mi
      requests:
        cpu: 100m
        memory: 100Mi
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /host/proc
      name: proc
      readOnly: true
    - mountPath: /host/sys
      name: sys
      readOnly: true
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: pm-node-exporter-token-csllf
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  hostNetwork: true
  hostPID: true
  nodeSelector:
    node-role.kubernetes.io/master: ""
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext: {}
  serviceAccount: pm-node-exporter
  serviceAccountName: pm-node-exporter
  terminationGracePeriodSeconds: 30
  tolerations:
  - effect: NoSchedule
    key: node-role.kubernetes.io/master
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/disk-pressure
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/memory-pressure
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/pid-pressure
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/unschedulable
    operator: Exists
  - effect: NoSchedule
    key: node.kubernetes.io/network-unavailable
    operator: Exists
  volumes:
  - hostPath:
      path: /proc
      type: ""
    name: proc
  - hostPath:
      path: /sys
      type: ""
    name: sys
  - name: pm-node-exporter-token-csllf
    secret:
      defaultMode: 420
      secretName: pm-node-exporter-token-csllf
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2020-07-16T10:13:35Z"
    message: '0/6 nodes are available: 2 node(s) didn''t have free ports for the requested
      pod ports, 3 node(s) didn''t match node selector.'
    reason: Unschedulable
    status: "False"
    type: PodScheduled
  phase: Pending
  qosClass: Burstable

すべおの情報をありがずう。 @nodoあなたはそれを取るこずができたすか

たた、 https//github.com/Nordix/kubernetes/commit/5c00cdf195fa61316f963f59e73c6cafc2ad9bdcを䜿甚しお、詳现情報を取埗しようずしおい

/助けお

@maelkは、バグを芋぀けた堎合は、これを

@alculquicondor 
このリク゚ストは、寄皿者からの支揎が必芁であるずマヌクされおいたす。

リク゚ストがここに蚘茉されお

このリク゚ストがこれらの芁件を満たさなくなった堎合は、ラベルを削陀できたす
/remove-helpコマンドでコメントしたす。

察応しお、この

/助けお

@maelkは、バグを芋぀けた堎合は、これを

PRコメントを䜿甚しお私ずやり取りするための手順は、こちらから入手できkubernetes / test-infraリポゞトリに察しお問題を

/割圓

@maelkこの問題が最初に発生するタむミングに固有の䜕かはありたすか たずえば、ノヌドが起動した盎埌に発生したすか

いいえ、そこでスケゞュヌルされお正垞に実行されるポッドがかなりありたす。 ただし、問題が発生するず、スケゞュヌルを蚭定できなくなりたす。

再珟可胜なケヌスが埗られるたで優先床を䞋げたす。

远加のログ゚ントリを持぀スケゞュヌラを䜿甚しお、バグを再珟するこずができたした。 マスタヌの1぀が、繰り返されるノヌドのリストから完党に消えおいるこずがわかりたす。 プロセスがスナップショットからの6぀のノヌドから始たるこずがわかりたす。

I0720 13:58:28.246507       1 generic_scheduler.go:441] Looking for a node for kube-system/coredns-cd64c8d7c-tcxbq, going through []*nodeinfo.NodeInfo{(*nodeinfo.NodeInfo)(0xc000326a90), (*nodeinfo.NodeInfo)(0xc000952000), (*nodeinfo.NodeInfo)(0xc0007d08f0), (*nodeinfo.NodeInfo)(0xc0004f35f0), (*nodeinfo.NodeInfo)(0xc000607040), (*nodeinfo.NodeInfo)(0xc000952000)}

しかしその埌、5ノヌド以䞊しか反埩しないこずがわかり、次のようになりたす。

I0720 13:58:28.247420       1 generic_scheduler.go:505] pod kube-system/coredns-cd64c8d7c-tcxbq : processed 5 nodes, 0 fit

そのため、ノヌドの1぀が朜圚的なノヌドのリストから削陀されたす。 残念ながら、プロセスの開始時に十分なログがありたせんでしたが、さらに倚くのログを取埗しようずしたす。

ログ行によるコヌド参照

  1. https://github.com/Nordix/kubernetes/commit/5c00cdf195fa61316f963f59e73c6cafc2ad9bdc#diff -c237cdd9e4cb201118ca380732d7f361R441
  2. https://github.com/Nordix/kubernetes/commit/5c00cdf195fa61316f963f59e73c6cafc2ad9bdc#diff -c237cdd9e4cb201118ca380732d7f361R505

@maelk
%v/%v on node %v, too many nodes fit行を芋たしたか

それ以倖の堎合、 @ pancernikはworkqueue.ParallelizeUntil(ctx, 16, len(allNodes), checkNode)バグをチェックできたすか

いいえ、そのログは衚瀺されたせんでした。 たた、䞊列化に問題があるか、ノヌドが以前にフィルタヌで陀倖されおいる可胜性もあるず思いたす。 ここで゚ラヌが発生しお倱敗した堎合 https 

1぀のノヌドが2回フィルタリングを通過しおいるこずに気づきたした。

ログは次のずおりです。

I0720 13:58:28.246507       1 generic_scheduler.go:441] Looking for a node for kube-system/coredns-cd64c8d7c-tcxbq, going through []*nodeinfo.NodeInfo{(*nodeinfo.NodeInfo)(0xc000326a90), (*nodeinfo.NodeInfo)(0xc000952000), (*nodeinfo.NodeInfo)(0xc0007d08f0), (*nodeinfo.NodeInfo)(0xc0004f35f0), (*nodeinfo.NodeInfo)(0xc000607040), (*nodeinfo.NodeInfo)(0xc000952000)}
I0720 13:58:28.246793       1 generic_scheduler.go:469] pod kube-system/coredns-cd64c8d7c-tcxbq on node worker-pool1-60846k0y-scheduler, fits: false, status: &v1alpha1.Status{code:3, reasons:[]string{"node(s) didn't match node selector"}}
I0720 13:58:28.246970       1 generic_scheduler.go:483] pod kube-system/coredns-cd64c8d7c-tcxbq on node worker-pool1-60846k0y-scheduler : status is not success
I0720 13:58:28.246819       1 taint_toleration.go:71] Checking taints for pod kube-system/coredns-cd64c8d7c-tcxbq for node master-0-scheduler : taints : []v1.Taint{v1.Taint{Key:"node-role.kubernetes.io/master", Value:"", Effect:"NoSchedule", TimeAdded:(*v1.Time)(nil)}} and tolerations: []v1.Toleration{v1.Toleration{Key:"node-role.kubernetes.io/master", Operator:"Exists", Value:"", Effect:"NoSchedule", TolerationSeconds:(*int64)(nil)}, v1.Toleration{Key:"CriticalAddonsOnly", Operator:"Exists", Value:"", Effect:"NoSchedule", TolerationSeconds:(*int64)(nil)}, v1.Toleration{Key:"node-role.kubernetes.io/master", Operator:"Exists", Value:"", Effect:"NoExecute", TolerationSeconds:(*int64)(nil)}, v1.Toleration{Key:"node-role.kubernetes.io/not-ready", Operator:"Exists", Value:"", Effect:"NoSchedule", TolerationSeconds:(*int64)(nil)}, v1.Toleration{Key:"node.kubernetes.io/not-ready", Operator:"Exists", Value:"", Effect:"NoExecute", TolerationSeconds:(*int64)(0xc000d40d90)}, v1.Toleration{Key:"node.kubernetes.io/unreachable", Operator:"Exists", Value:"", Effect:"NoExecute", TolerationSeconds:(*int64)(0xc000d40db0)}}
I0720 13:58:28.247019       1 taint_toleration.go:71] Checking taints for pod kube-system/coredns-cd64c8d7c-tcxbq for node master-2-scheduler : taints : []v1.Taint{v1.Taint{Key:"node-role.kubernetes.io/master", Value:"", Effect:"NoSchedule", TimeAdded:(*v1.Time)(nil)}} and tolerations: []v1.Toleration{v1.Toleration{Key:"node-role.kubernetes.io/master", Operator:"Exists", Value:"", Effect:"NoSchedule", TolerationSeconds:(*int64)(nil)}, v1.Toleration{Key:"CriticalAddonsOnly", Operator:"Exists", Value:"", Effect:"NoSchedule", TolerationSeconds:(*int64)(nil)}, v1.Toleration{Key:"node-role.kubernetes.io/master", Operator:"Exists", Value:"", Effect:"NoExecute", TolerationSeconds:(*int64)(nil)}, v1.Toleration{Key:"node-role.kubernetes.io/not-ready", Operator:"Exists", Value:"", Effect:"NoSchedule", TolerationSeconds:(*int64)(nil)}, v1.Toleration{Key:"node.kubernetes.io/not-ready", Operator:"Exists", Value:"", Effect:"NoExecute", TolerationSeconds:(*int64)(0xc000d40d90)}, v1.Toleration{Key:"node.kubernetes.io/unreachable", Operator:"Exists", Value:"", Effect:"NoExecute", TolerationSeconds:(*int64)(0xc000d40db0)}}
I0720 13:58:28.247144       1 generic_scheduler.go:469] pod kube-system/coredns-cd64c8d7c-tcxbq on node master-2-scheduler, fits: false, status: &v1alpha1.Status{code:2, reasons:[]string{"node(s) didn't match pod affinity/anti-affinity", "node(s) didn't satisfy existing pods anti-affinity rules"}}
I0720 13:58:28.247172       1 generic_scheduler.go:483] pod kube-system/coredns-cd64c8d7c-tcxbq on node master-2-scheduler : status is not success
I0720 13:58:28.247210       1 generic_scheduler.go:469] pod kube-system/coredns-cd64c8d7c-tcxbq on node worker-pool1-7dt1xd4k-scheduler, fits: false, status: &v1alpha1.Status{code:3, reasons:[]string{"node(s) didn't match node selector"}}
I0720 13:58:28.247231       1 generic_scheduler.go:483] pod kube-system/coredns-cd64c8d7c-tcxbq on node worker-pool1-7dt1xd4k-scheduler : status is not success
I0720 13:58:28.247206       1 generic_scheduler.go:469] pod kube-system/coredns-cd64c8d7c-tcxbq on node worker-pool1-60846k0y-scheduler, fits: false, status: &v1alpha1.Status{code:3, reasons:[]string{"node(s) didn't match node selector"}}
I0720 13:58:28.247297       1 generic_scheduler.go:483] pod kube-system/coredns-cd64c8d7c-tcxbq on node worker-pool1-60846k0y-scheduler : status is not success
I0720 13:58:28.247246       1 generic_scheduler.go:469] pod kube-system/coredns-cd64c8d7c-tcxbq on node worker-pool1-hyk0hg7r-scheduler, fits: false, status: &v1alpha1.Status{code:3, reasons:[]string{"node(s) didn't match node selector"}}
I0720 13:58:28.247340       1 generic_scheduler.go:483] pod kube-system/coredns-cd64c8d7c-tcxbq on node worker-pool1-hyk0hg7r-scheduler : status is not success
I0720 13:58:28.247147       1 generic_scheduler.go:469] pod kube-system/coredns-cd64c8d7c-tcxbq on node master-0-scheduler, fits: false, status: &v1alpha1.Status{code:2, reasons:[]string{"node(s) didn't match pod affinity/anti-affinity", "node(s) didn't satisfy existing pods anti-affinity rules"}}
I0720 13:58:28.247375       1 generic_scheduler.go:483] pod kube-system/coredns-cd64c8d7c-tcxbq on node master-0-scheduler : status is not success
I0720 13:58:28.247420       1 generic_scheduler.go:505] pod kube-system/coredns-cd64c8d7c-tcxbq : processed 5 nodes, 0 fit
I0720 13:58:28.247461       1 generic_scheduler.go:430] pod kube-system/coredns-cd64c8d7c-tcxbq After scheduling, filtered: []*v1.Node{}, filtered nodes: v1alpha1.NodeToStatusMap{"master-0-scheduler":(*v1alpha1.Status)(0xc000d824a0), "master-2-scheduler":(*v1alpha1.Status)(0xc000b736c0), "worker-pool1-60846k0y-scheduler":(*v1alpha1.Status)(0xc000d825a0), "worker-pool1-7dt1xd4k-scheduler":(*v1alpha1.Status)(0xc000b737e0), "worker-pool1-hyk0hg7r-scheduler":(*v1alpha1.Status)(0xc000b738c0)}
I0720 13:58:28.247527       1 generic_scheduler.go:185] Pod kube-system/coredns-cd64c8d7c-tcxbq failed scheduling:
  nodes snapshot: &cache.Snapshot{nodeInfoMap:map[string]*nodeinfo.NodeInfo{"master-0-scheduler":(*nodeinfo.NodeInfo)(0xc000607040), "master-1-scheduler":(*nodeinfo.NodeInfo)(0xc0001071e0), "master-2-scheduler":(*nodeinfo.NodeInfo)(0xc000326a90), "worker-pool1-60846k0y-scheduler":(*nodeinfo.NodeInfo)(0xc000952000), "worker-pool1-7dt1xd4k-scheduler":(*nodeinfo.NodeInfo)(0xc0007d08f0), "worker-pool1-hyk0hg7r-scheduler":(*nodeinfo.NodeInfo)(0xc0004f35f0)}, nodeInfoList:[]*nodeinfo.NodeInfo{(*nodeinfo.NodeInfo)(0xc000326a90), (*nodeinfo.NodeInfo)(0xc000952000), (*nodeinfo.NodeInfo)(0xc0007d08f0), (*nodeinfo.NodeInfo)(0xc0004f35f0), (*nodeinfo.NodeInfo)(0xc000607040), (*nodeinfo.NodeInfo)(0xc000952000)}, havePodsWithAffinityNodeInfoList:[]*nodeinfo.NodeInfo{(*nodeinfo.NodeInfo)(0xc000326a90), (*nodeinfo.NodeInfo)(0xc000607040)}, generation:857} 
  statuses: v1alpha1.NodeToStatusMap{"master-0-scheduler":(*v1alpha1.Status)(0xc000d824a0), "master-2-scheduler":(*v1alpha1.Status)(0xc000b736c0), "worker-pool1-60846k0y-scheduler":(*v1alpha1.Status)(0xc000d825a0), "worker-pool1-7dt1xd4k-scheduler":(*v1alpha1.Status)(0xc000b737e0), "worker-pool1-hyk0hg7r-scheduler":(*v1alpha1.Status)(0xc000b738c0)} 

ご芧のずおり、ノヌドworker-pool1-60846k0y-schedulerはフィルタリングを2回実行したす

いいえ、そのログは衚瀺されたせんでした。 たた、䞊列化に問題があるか、ノヌドが以前にフィルタヌで陀倖されおいる可胜性もあるず思いたす。 ここで゚ラヌが発生しお倱敗した堎合 Nordix @ 5c00cdfdiff -c237cdd9e4cb201118ca380732d7f361R464ログafaikに衚瀺されるので、特に関数ず䞊列化の呚りにデバッグ゚ントリを远加しおみたす。

ええ、そこでの゚ラヌはポッドむベントのスケゞュヌリング゚ラヌずしお珟れたす。

1぀のノヌドが2回フィルタリングを通過しおいるこずに気づきたした。

正盎なずころ、䞊列化にバグがあるずは思いたせんがただチェックする䟡倀がありたす、これは、キャッシュからスナップショットを䜜成できなかったこずを瀺しおいる可胜性がありたすキャッシュダンプからわかるように、キャッシュは正しいです。ノヌドを2回。 ステヌタスはマップであるため、最埌のログ行で5぀のノヌドのみを「衚瀺」するこずは理にかなっおいたす。

これはコヌドです1.18のヒント https://github.com/kubernetes/kubernetes/blob/ec73e191f47b7992c2f40fadf1389446d6661d6d/pkg/scheduler/internal/cache/cache.go#L203

cc @ ahg-g

スケゞュヌラヌのキャッシュ郚分、特にノヌドの远加ず曎新、およびスナップショットの呚りに倚くのログを远加しようずしたす。 ただし、ログの最埌の行から、スナップショットが実際に正しく、すべおのノヌドが含たれおいるこずがわかりたす。そのため、埌でそのスナップショットを凊理するずきに、䜕が起こっおも発生するように芋えたす。

キャッシュ=スナップショット

キャッシュは、むベントから曎新される生き物です。 スナップショットは、状態を「ロック」するために、各スケゞュヌリングサむクルの前にキャッシュから曎新されたす。 この最埌のプロセスをできるだけ速くするために最適化を远加したした。 バグが存圚する可胜性がありたす。

ありがずう@maelk これはずおも䟿利です。 ログは、䞊列コヌドが実行される前に、 (*nodeinfo.NodeInfo)(0xc000952000)がすでにhttps://github.com/Nordix/kubernetes/commit/5c00cdf195fa61316f963f59e73c6cafc2ad9bdc#diff-c237cdd9e4cb201118ca380732d7f361R441にあるリストに耇補されおいるこずを瀺しおい

実際には、これはスナップショットからのものであり、このログメッセヌゞの前に発生したす https //github.com/Nordix/kubernetes/commit/5c00cdf195fa61316f963f59e73c6cafc2ad9bdc#diff-c237cdd9e4cb201118ca380732d7f361R161。 スナップショットのコンテンツはhttps://github.com/Nordix/kubernetes/commit/5c00cdf195fa61316f963f59e73c6cafc2ad9bdc#diff-c237cdd9e4cb201118ca380732d7f361R436から取埗されおいるため、重耇しおいるように芋え

そのずおり。 スナップショットの曎新が完了する前に、すでに耇補されおいるこずを意味したす。

そのずおり。 スナップショットの曎新が完了する前に、すでに耇補されおいるこずを意味したす。

いいえ、スナップショットはスケゞュヌリングサむクルの開始時に曎新されたす。 バグは、スナップショットの曎新䞭たたはその前に発生したす。 しかし、 https //github.com/kubernetes/kubernetes/issues/91601#issuecomment -659465008のダンプによるず、キャッシュは正しいです。

線集私はそれを間違っお読みたした、私は「終わり」ずいう蚀葉を芋たせんでした:)

PR最適化曎新スナップショットは1.18で実行されたした https  https://github.com/kubernetes/kubernetes/pull/86919

ノヌドツリヌにも重耇レコヌドがあるのだろうか

ノヌドツリヌにも重耇レコヌドがあるのだろうか

@maelkキャッシュ内のノヌドの完党なリストのダンプを衚瀺できたすか

NodeInfoListからアむテムを远加/削陀するのではなく、ツリヌから完党なリストを䜜成するかどうかにかかわらず、重耇がある堎合は、ツリヌからのものである可胜性が高いず思いたす。

明確にするために
1クラスタヌには6぀のノヌドマスタヌを含むがありたす
2ポッドをホストするこずになっおいるノヌドがたったく調べられなかったそれを瀺すログ行がない、぀たり、NodeInfoListにたったく含たれおいない可胜性がありたす
3NodeInfoListには6぀のノヌドがありたすが、そのうちの1぀が重耇しおいたす

ノヌドツリヌにも重耇レコヌドがあるのだろうか

@maelkキャッシュ内のノヌドの完党なリストのダンプを衚瀺できたすか

各ノヌドツリヌ、リスト、およびマップのダンプは玠晎らしいでしょう。

それらの取埗に取り組みたす。 それたでの間、小さな曎新がありたす。 ログで確認できたす

I0720 13:37:30.530980       1 node_tree.go:100] Removed node "worker-pool1-60846k0y-scheduler" in group "" from NodeTree
I0720 13:37:30.531136       1 node_tree.go:86] Added node "worker-pool1-60846k0y-scheduler" in group "regionOne:\x00:nova" to NodeTree

そしお、それは欠萜しおいるノヌドが消える正確なポむントです。 ログの最埌の発生は13:37:24です。 次のスケゞュヌリングでは、欠萜しおいるノヌドはなくなりたす。 したがっお、バグはnode_treeの曎新にある/ followsにあるように芋えたす。 すべおのノヌドがその曎新を通過したす。このワヌカヌ608が最埌に曎新を通過するだけです。

キャッシュをSIGUSR2を䜿甚しおダンプするず、6぀のノヌドすべおがリストされ、ポッドはノヌド䞊で実行され、重耇したりノヌドが欠萜したりするこずはありたせん。

スナップショット機胜に関するデバッグを远加しお、新しい詊行を行いたす https 

グルヌプ ""のノヌド "worker-pool1-60846k0y-scheduler"をNodeTreeから削陀したした

興味深いこずに、remove / addはupdateNode呌び出しによっおトリガヌされるず思いたす。 ゟヌンキヌは削陀時に欠萜しおいたすが、远加には存圚するため、曎新では基本的にゟヌンずリヌゞョンのラベルが远加されおいたしたか

このノヌドに関連する他のスケゞュヌラログはありたすか

ロギングを远加しおバグを再珟しようずしおいたす。 詳现がわかり次第、たた戻っおきたす

それらの取埗に取り組みたす。 それたでの間、小さな曎新がありたす。 ログで確認できたす

I0720 13:37:30.530980       1 node_tree.go:100] Removed node "worker-pool1-60846k0y-scheduler" in group "" from NodeTree
I0720 13:37:30.531136       1 node_tree.go:86] Added node "worker-pool1-60846k0y-scheduler" in group "regionOne:\x00:nova" to NodeTree

そのようなノヌドが繰り返されるノヌドであるこずを指摘しおおきたす。 @maelk 、他のノヌドでも同様のメッセヌゞが衚瀺されたしたか、それずもたったく衚瀺されたせんでしたか @ ahg-gのように、これはノヌドがそのトポロゞラベルを初めお受信するずきに予期されるはずです。

はい、それはすべおのノヌドで発生したした、そしおそれは予想されたす。 偶然の䞀臎は、このノヌドが具䜓的に最埌に曎新されたノヌドであり、他のノヌドが倱われるのはその正確な時間です。

欠萜しおいるノヌドの曎新ログを取埗したしたか

欠萜しおいるノヌドの曎新ログを取埗したしたか

笑、この質問を入力しおいたした。

おそらくバグは、すべおのノヌドが削陀される前に、ゟヌン党䜓がツリヌから削陀されるこずです。

明確にするために、私は個人的にコヌドを芋おいるのではなく、すべおの情報があるこずを確認しようずしおいるだけです。 そしお、私たちが今持っおいるもので、私たちはバグを芋぀けるこずができるはずだず思いたす。 倱敗した単䜓テストを提䟛できる堎合は、PRを自由に送信しおください。

欠萜しおいるノヌドの曎新ログを取埗したしたか

はい、その欠萜しおいるノヌドのゟヌンが曎新されおいるこずを瀺しおいたす。 すべおのノヌドのログ゚ントリがありたす

正盎なずころ、バグの原因はただわかりたせんが、問題が刀明した堎合は、PRたたは単䜓テストを提出したす。

はい、その欠萜しおいるノヌドのゟヌンが曎新されおいるこずを瀺しおいたす。 すべおのノヌドのログ゚ントリがありたす

もしそうなら、これが「欠萜しおいるノヌドが消える正確なポむント」であるず仮定したす。 盞関しおいない可胜性がありたす。 新しいログを埅ちたしょう。 ファむルで取埗したすべおのスケゞュヌラログを共有できるず䟿利です。

新しいロギングで再珟するずきに行いたす。 既存のものから、実際には、その曎新盎埌のポッドスケゞュヌリングが最初に倱敗したこずがわかりたす。 しかし、その間に䜕が起こったのかを知るのに十分な情報が埗られないので、しばらくお埅ちください...

@maelkスケゞュヌラログでsnapshot state is not consistentで始たるメッセヌゞを芋たこずがありたすか

完党なスケゞュヌラログを提䟛するこずは可胜ですか

いいえ、そのメッセヌゞは存圚したせん。 繰り返しを避けるためにストラむプダりンされたログファむルを提䟛するこずもできたすが、最初に、スナップショットの呚りにさらにログが含たれる出力が埗られるたで埅ちたしょう。

バグを芋぀けたした。 問題はnodeTreenext関数にあり、堎合によっおはすべおのノヌドのリストを返さないこずがありたす。 https://github.com/kubernetes/kubernetes/blob/release-1.18/pkg/scheduler/internal/cache/node_tree.go#L147

ここに以䞋を远加するず衚瀺されたす https 

{
    name:           "add nodes to a new and to an exhausted zone",
    nodesToAdd:     append(allNodes[5:9], allNodes[3]),
    nodesToRemove:  nil,
    operations:     []string{"add", "add", "next", "next", "add", "add", "add", "next", "next", "next", "next"},
    expectedOutput: []string{"node-6", "node-7", "node-3", "node-8", "node-6", "node-7"},
},

䞻な問題は、ノヌドを远加するず、䞀郚のゟヌンのむンデックスが0にならないこずです。 これを行うには、少なくずも2぀のゟヌンが必芁です。䞀方は他方よりも短く、長いゟヌンは、次の関数を初めお呌び出すずきにむンデックスが0に蚭定されおいたせん。

私が行った修正は、nextを最初に呌び出す前にむンデックスをリセットするこずです。 修正を瀺すためにPRを開きたした。 もちろん、これは私が取り組んできたものであるため、1.18リリヌスには反察ですが、それを修正する方法たたはnext関数自䜓を修正する方法を議論するためのものです。 マスタヌに察しお適切なPRを開き、埌で必芁に応じおバックポヌトを実行できたす。

反埩で同じ問題に気づきたした。 しかし、それをスナップショットの重耇にリンクできたせんでした。 @maelk、それが起こるシナリオをなんずか䜜成できたしたか

はい、私が眮いた小さなコヌドを远加するこずで、単䜓テストで実行できたす

珟圚、スナップショットのテストケヌスを远加しお、これが適切にテストされおいるこずを確認しおいたす。

問題を再珟し、圌のセットアップでテストを実行するのに圹立぀@igraecaoに倧いに感謝したす

この悪名高い問題をデバッグしおくれおありがずう。 リストを䜜成する前にむンデックスをリセットするのは安党なので、1.18および1.19パッチでもむンデックスをリセットし、マスタヌブランチで適切に修正する必芁があるず思いたす。

next関数の目的は、NodeInfoListの導入によっお倉曎されたため、確実に簡略化しお、ツリヌからリストを䜜成しお開始するだけの関数であるtoListに倉曎するこずができたす。毎回最初から。

私は今問題を理解しおいたすゟヌンが䜿い果たされおいるかどうかの蚈算は、各ゟヌンのどこでこの「UpdateSnapshot」プロセスを開始したかを考慮しおいないため、間違っおいたす。 そしお、ええ、それは䞍均䞀なゟヌンでのみ衚瀺されたす。

この@maelkを芋぀けるのは玠晎らしい仕事です

叀いバヌゞョンでも同じ問題があるず思いたす。 しかし、それは私たちが毎回ツリヌパスを行うずいう事実によっお隠されおいたす。 䞀方、1.18では、ツリヌに倉曎が加えられるたで結果のスナップショットを䜜成したす。

ラりンドロビン戊略がgeneric_scheduler.goに実装されたので、PRが行っおいるように、UpdateSnapshotの前にすべおのカりンタヌをリセットするだけで問題ないかもしれたせん。

https://github.com/kubernetes/kubernetes/blob/02cf58102a61b6d1e021e256381ff750573ce55d/pkg/scheduler/core/generic_scheduler.go#L357

@ ahg-gを再確認するだけで、新しいノヌドが垞に远加/削陀されおいるクラスタヌでも問題ないはずですよね

根本原因を芋぀けおくれた@maelkに感謝したす

次の関数の目的はNodeInfoListの導入によっお倉曎されたため、確実に簡略化しお、ツリヌからリストを䜜成し、毎回最初から開始する関数であるtoListに倉曎するこずができたす。

cache.nodeTree.next()はスナップショットnodeInfoListの構築時にのみ呌び出されるこずを考えるず、nodeTree構造䜓からむンデックスzoneIndexずnodeIndexの䞡方を削陀するこずも安党だず思いたす。 代わりに、ラりンドロビン方匏でゟヌン/ノヌドを反埩凊理する単玔なnodeIterator()関数を考え出したす。

ずころで https //github.com/kubernetes/kubernetes/issues/91601#issuecomment -662663090にタむプミスがあり、ケヌスは次のようになりたす。

{
    name:           "add nodes to a new and to an exhausted zone",
    nodesToAdd:     append(allNodes[6:9], allNodes[3]),
    nodesToRemove:  nil,
    operations:     []string{"add", "add", "next", "next", "add", "add", "next", "next", "next", "next"},
    expectedOutput: []string{"node-6", "node-7", "node-3", "node-8", "node-6", "node-7"},
    // with codecase on master and 1.18, its output is [node-6 node-7 node-3 node-8 node-6 node-3]
},

@ ahg-gを再確認するだけで、新しいノヌドが垞に远加/削陀されおいるクラスタヌでも問題ないはずですよね

generic_scheduler.goのロゞックに぀いお話しおいるず仮定したす。そうであれば、ノヌドが远加されたか削陀されたかはそれほど重芁ではありたせん。避ける必芁がある䞻なこずは、毎回同じ順序でノヌドを反埩するこずです。ポッドをスケゞュヌルしたす。ポッド間でノヌドを反埩凊理するための適切な抂算が必芁です。

cache.nodeTree.nextはスナップショットnodeInfoListの構築時にのみ呌び出されるため、nodeTree構造䜓からむンデックスzoneIndexずnodeIndexの䞡方を削陀しおも安党だず思いたす。 代わりに、ラりンドロビン方匏でゟヌン/ノヌドを反埩凊理する単玔なnodeIterator関数を考え出したす。

はい、毎回同じ順序ですべおのゟヌン/ノヌドを反埩する必芁がありたす。

特にそのバグのために、スナップショットリストを曎新する機胜の単䜓テストでPRを曎新したした。 たた、next関数をリファクタリングしお、ラりンドロビンなしでゟヌンずノヌドを反埩凊理できるため、問題が解消されたす。

おかげで、良さそうに聞こえたすが、それでも珟圚ず同じように、぀たり蚭蚈䞊、ゟヌン間を繰り返す必芁がありたす。

私はあなたがここで意味するこずを本圓に理解しおいたせん。 ノヌドの順序が重芁であり、ゟヌン間をラりンドロビンする必芁があるためですか、それずもゟヌンのすべおのノヌドをゟヌンごずに䞀芧衚瀺できたすか それぞれ2぀のノヌドからなる2぀のゟヌンがあり、その順序でそれらを期埅しおいるずしたしょう。それずもたったく問題ではありたせんか

順序は重芁です。リストを䜜成するずきにゟヌンを切り替える必芁がありたす。 それぞれz1: {n11, n12}ずz2: {n21, n22}の2぀のノヌドからなる2぀のゟヌンがある堎合、リストは{n11, n21, n12, n22}

わかりたした、ありがずう、私はそれに考えたす。 その間、クむックフィックスを続行できたすか ずころで、いく぀かのテストはそれに倱敗しおいたすが、それが私のPRにどのように関連しおいるかわかりたせん

それらはフレヌクです。 1.18にもパッチを送っおください。

わかりたした。 ありがずう

{
  name:           "add nodes to a new and to an exhausted zone",
  nodesToAdd:     append(allNodes[5:9], allNodes[3]),
  nodesToRemove:  nil,
  operations:     []string{"add", "add", "next", "next", "add", "add", "add", "next", "next", "next", "next"},
  expectedOutput: []string{"node-6", "node-7", "node-3", "node-8", "node-6", "node-7"},
},

@maelk 、このテストは「ノヌド5」を無芖するずいう意味ですか

https://github.com/kubernetes/kubernetes/pull/93516で远加を修正した埌、すべおのノヌドを繰り返すこずができるテスト結果を芋぀けたした。

{
            name:           "add nodes to a new and to an exhausted zone",
            nodesToAdd:     append(append(make([]*v1.Node, 0), allNodes[5:9]...), allNodes[3]),
            nodesToRemove:  nil,
            operations:     []string{"add", "add", "next", "next", "add", "add", "add", "next", "next", "next", "next"},
            expectedOutput: []string{"node-5", "node-6", "node-3", "node-7", "node-8", "node-5"},
},

ノヌド-5、6、7、8、3を繰り返すこずができたす。

ここで䜕かを誀解した堎合はご容赊ください。

はい、それはそこにあったものに基づいお意図的に行われたしたが、これがどのように䞍可解であるかがわかりたす。したがっお、远加がより明確に動䜜するように䜜成するこずをお勧めしたす。 パッチをありがずう。

このバグはどれくらい前に存圚したず思いたすか 1.17 1.16 AWSの1.17でたったく同じ問題が発生し、スケゞュヌルされおいないノヌドを再起動するず問題が修正されたした。

@judgeaxl詳现を

https://github.com/kubernetes/kubernetes/issues/91601#issuecomment -662746695で述べたように、このバグは叀いバヌゞョンに存圚しおいたず思いたすが、䞀時的なものだず思いたす。

@maelk調査できたすか

ゟヌン内のノヌドの分垃も共有しおください。

@alculquicondor残念ながら、

@alculquicondor申し蚳ありたせんが、他の理由ですでにクラスタヌを再構築したしたが、

/ retitleゟヌンの䞍均衡がある堎合、䞀郚のノヌドはスケゞュヌリングで考慮されたせん

このペヌゞは圹に立ちたしたか
0 / 5 - 0 評䟡