๋ฌด์จ ์ผ์ด ์์๋์ง : ์ฐ๋ฆฌ๋ 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 / schedulers / 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
์ฐ๋ฆฌ๋ ๋ชจ๋ ํด๋ฌ์คํฐ์์ ์ด๊ฒ์ ๋ฌด์์๋ก๋ณด๊ณ ์์ต๋๋ค.
์์ ํ ์ผ : ๋ฐ๋ชฌ ์ ์ด ๋ชจ๋ ๋ ธ๋์ ํ๋ก๋น์ ๋ ๋ ๊ฒ์ผ๋ก ์์ํฉ๋๋ค.
๊ทธ๊ฒ์ ์ฌํํ๋ ๋ฐฉ๋ฒ (๊ฐ๋ฅํ ํ ์ต์ํ์ผ๋ก ์ ํํ๊ฒ) : ์ ๋ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. 1.18.x kubernetes๋ฅผ ์ค์นํ๊ณ 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
๋ณด์๋ค์ํผ ๋๋ถ๋ถ์ ๋ฐ๋ชฌ ์ ์๋ ํ๋์ ํฌ๋๊ฐ ์์ต๋๋ค.
ํ๊ฒฝ :
kubectl version
) : 1.18.3cat /etc/os-release
) : ๋ฐ๋น์ ๋ฒ์คํฐuname -a
) : Linux nodes-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 / ๋ฆฌ๋
์ค/ ์๊ทธ ์ค์ผ์ค๋ง
์๋ฒ์์ ๊ฒ์๋ ๋ ธ๋, ๋ฐ๋ชฌ ์ , ์์ ํฌ๋ ๋ฐ ํฌํจํ๋ ๋ค์ ์คํ์ด์ค์ ์ ์ฒด 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
๋จ์ผ ๋ ธ๋์ ๋ง ์ผ์นํ๋ nodeAffinity ์ ํ๊ธฐ๋ก DaemonSet pod ์ผ์ ์ ์์ฝํ๋ฏ๋ก "13 ๊ฐ ์ค 12 ๊ฐ๊ฐ ์ผ์นํ์ง ์์"๋ฉ์์ง๊ฐ ์์๋ฉ๋๋ค.
์ค์ผ์ค๋ฌ๊ฐ ํฌ๋ / ๋ ธ๋ ์ฝค๋ณด์ ๋ง์กฑํ์ง ์๋ ์ด์ ๋ฅผ ์ ์ ์์ต๋๋ค. ํฌ๋ ์คํ์์ ์ถฉ๋ ํ ์์๋ ํฌํธ๊ฐ์๊ณ ๋ ธ๋๊ฐ ์์ฝ ๋ถ๊ฐ๋ฅํ๊ฑฐ๋ ์ค์ผ๋์ง ์์์ผ๋ฉฐ ์ถฉ๋ถํ ๋ฆฌ์์ค๊ฐ ์์ต๋๋ค.
์ข์ต๋๋ค. 3 ๊ฐ์ ์ค์ผ์ค๋ฌ๋ฅผ ๋ชจ๋ ๋ค์ ์์ํ์ต๋๋ค (ํฅ๋ฏธ๋ก์ด ๊ฒ์ ๋ณผ ์ ์์ผ๋ฉด loglevel์ 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์์๋ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค. ํ๋์ ๋
ธ๋๋ฅผ ๋ฐ๋ชฌ ์
ํฌ๋๋ก ์์ฝ ํ ์ ์์ต๋๋ค.
๋ค์ ์์ ์ค์ผ์ค๋ฌ๊ฐ ๋์์ด๋ฉ๋๋ค.
[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
๊ฐ์ ๋ฐฉ๋ฒ์ ๋ชจ๋ฅด๋ฉด ๋๋ฒ๊น ํ๊ธฐ๊ฐ ์ด๋ ต์ต๋๋ค. ํ (Pod)์ ์์ฝํ์ง ๋ชปํ ๊ฒ์ ๋ํ ์ค์ผ์ค๋ฌ ๋ก๊ทธ๊ฐ ์์ต๋๊น?
์๊ฒ ์ต๋๋ค. ์ค์ผ์ค๋ฌ 3 ๊ฐ๋ฅผ ๋ชจ๋ ๋ค์ ์์ํ์ต๋๋ค.
๊ทธ์ค ํ๋๋ง default-scheduler
๋ผ๊ณ ๊ฐ์ ํฉ๋๋ค. ๋ง์ต๋๊น?
ํฅ๋ฏธ๋ก์ด ๊ฒ์ ๋ณผ ์ ์๋ค๋ฉด loglevel์ 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://github.com/kubernetes/kubernetes/issues/91633
/์์์ธ
๋๋ ์ด๊ฒ์ ์กฐ์ฌํ๊ณ ์๋ค. ์ผ์ด์ค ๋ฒ์๋ฅผ ์ขํ๋ ๋ฐ ๋์์ด๋๋ ๋ช ๊ฐ์ง ์ง๋ฌธ์ ๋๋ค. ๋๋ ์์ง ์ฌ์์ฐํ์ง ๋ชปํ์ต๋๋ค.
๋ฐ๋ชฌ ์
์ด์ ์ ๋
ธ๋๊ฐ ์์ฑ๋์์ต๋๋ค.
๊ธฐ๋ณธ ํ๋กํ์ ์ฌ์ฉํ๋ค๊ณ ๊ฐ์ ํด ๋ณด๊ฒ ์ต๋๋ค. ์ด๋ค ํ๋กํ์ ์๋ฏธํ๋ฉฐ ํ์ธํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์
๋๊น?
์ต์คํ
๋๊ฐ ์์ต๋๋ค.
command:
- /usr/local/bin/kube-scheduler
- --address=127.0.0.1
- --kubeconfig=/etc/kubernetes/kube-scheduler.kubeconfig
- --profiling=false
- --v=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.
"nodeName"์ ์ ํ๊ธฐ๊ฐ ์๋๋๋ค. nodeName์ ์ฌ์ฉํ๋ฉด ์ค์ผ์ค๋ง์ ์ฐํํฉ๋๋ค.
๋ค ๋ฒ์งธ๋ ๋ ธ๋๊ฐ ๋ณต๊ตฌ๋์์ ๋ ๋ฐ์ํ์ต๋๋ค. ๋ฌธ์ ๊ฐ์๋ ๋ ธ๋๊ฐ ๋ง์คํฐ์ด๋ฏ๋ก ๋ ธ๋๊ฐ ๊ฑฐ๊ธฐ์ ๊ฐ์ง ์์์ต๋๋ค (ํ์ง๋ง ๋ ธ๋๊ฐ ์ด์ ์ด๋ฒคํธ 3 ๊ฐ์์ ๋ฐ๊ฒฌ๋์ง ์์ ์์ ๋ณด์ฌ์ค๋๋ค). ๋ค ๋ฒ์งธ ์ด๋ฒคํธ์์ ํฅ๋ฏธ๋ก์ด ์ ์ ํ๋์ ๋ ธ๋์์ ์ฌ์ ํ ์ ๋ณด๊ฐ ๋๋ฝ๋์ด ์๋ค๋ ๊ฒ์ ๋๋ค. ์ด๋ฒคํธ๋ 0/9 ๊ฐ์ ๋ ธ๋๋ฅผ ์ฌ์ฉํ ์ ์์ง๋ง ์ค๋ช ์ 8 ๊ฐ์์๋ง ์ ๊ณต๋ฉ๋๋ค.
๋๋ฝ ๋ ๋ ธ๋์์ ํฌ๋๊ฐ ์์ฝ๋์ง ์์์ผํ๋ ์ด์ ๋ ๋ง์คํฐ ์๊ธฐ ๋๋ฌธ์ด๋ผ๋ ๊ฒ์ ๋๋ค.
8 node(s) didn't match node selector
๊ฐ 7๋ก ์ด๋ํ๋ ๊ฒ์๋ณด๊ณ ์์ต๋๋ค.์ด ์์ ์์ ๋
ธ๋๊ฐ ์ ๊ฑฐ๋์ง ์์๋ค๊ณ ๊ฐ์ ํฉ๋๋ค. ๋ง์ต๋๊น?
"nodeName"์ ์ ํ๊ธฐ๊ฐ ์๋๋๋ค. nodeName์ ์ฌ์ฉํ๋ฉด ์ค์ผ์ค๋ง์ ์ฐํํฉ๋๋ค.
"NodeName"์ ํด๋น ๋ ธ๋๋ฅผ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ ์ํ ๊ฒฝ์ฐ ํฌ๋๊ฐ ๊ฑฐ๊ธฐ์ ๋์ฐฉํฉ๋๋ค. ๋ฐ๋ผ์ ๋ ธ๋๊ฐ ํฌ๋๋ฅผ ์์ํ ์์๋ ๊ฒ์ ์๋๋๋ค.
๋ค ๋ฒ์งธ๋ ๋ ธ๋๊ฐ ๋ณต๊ตฌ๋์์ ๋ ๋ฐ์ํ์ต๋๋ค. ๋ฌธ์ ๊ฐ์๋ ๋ ธ๋๊ฐ ๋ง์คํฐ์ด๋ฏ๋ก ๋ ธ๋๊ฐ ๊ฑฐ๊ธฐ์ ๊ฐ์ง ์์์ต๋๋ค (ํ์ง๋ง ๋ ธ๋๊ฐ ์ด์ ์ด๋ฒคํธ 3 ๊ฐ์์ ๋ฐ๊ฒฌ๋์ง ์์ ์์ ๋ณด์ฌ์ค๋๋ค). ๋ค ๋ฒ์งธ ์ด๋ฒคํธ์์ ํฅ๋ฏธ๋ก์ด ์ ์ ํ๋์ ๋ ธ๋์์ ์ฌ์ ํ ์ ๋ณด๊ฐ ๋๋ฝ๋์ด ์๋ค๋ ๊ฒ์ ๋๋ค. ์ด๋ฒคํธ๋ 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 ๋ฒ์งธ (์ด์ ์ด๋ฒคํธ์์ ํ์ธ ๋จ)์ ๋ํด์๋ ์๋ฌด ๊ฒ๋ ๋งํ์ง ์์ต๋๋ค.
๋ฐ๋ผ์ ์ด๋ฒคํธ ์ํ :
๋ง์ง๋ง์ ํ ์คํธ ํฌ๋๋ ์ค์ผ์ผ๋ก ์ธํด ์ผ์นํ๋ ๋ ธ๋์์ ์์๋์ง ์์์ง๋ง ๋ค๋ฅธ ์ด์ผ๊ธฐ์ ๋๋ค.
"NodeName"์ ํด๋น ๋ ธ๋๋ฅผ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ ์ํ ๊ฒฝ์ฐ ํฌ๋๊ฐ ๊ฑฐ๊ธฐ์ ๋์ฐฉํฉ๋๋ค. ๋ฐ๋ผ์ ๋ ธ๋๊ฐ ํฌ๋๋ฅผ ์์ํ ์์๋ ๊ฒ์ ์๋๋๋ค.
๋ ธ๋ ์ค๋ฒ ์ปค๋ฐ์ ๋ฐฉ์งํ๋ ๊ฒ์ ์์ง๋ง ์ค์ผ์ค๋ฌ๋ ์์ต๋๋ค. ๋ฐ๋ผ์ ์ด๊ฒ์ ์ค์ ๋ก ๋ง์ด ํ์๋์ง ์์ต๋๋ค.
๋ง์ง๋ง์ ํ ์คํธ ํฌ๋๋ ์ค์ผ์ผ๋ก ์ธํด ์ผ์นํ๋ ๋ ธ๋์์ ์์๋์ง ์์์ง๋ง ๋ค๋ฅธ ์ด์ผ๊ธฐ์ ๋๋ค.
๋ด ์ง๋ฌธ์ : 9 ๋ฒ์งธ ๋ ธ๋๊ฐ ์ฒ์๋ถํฐ ์ค์ผ ๋์์ต๋๊น? ๋๋ (1) ์ํ์ ๋๋ฌํ๊ธฐ ์ํด ์ฌํ ๊ฐ๋ฅํ ๋จ๊ณ ๋๋ (2) ๋ฒ๊ทธ๊ฐ์์ ์์๋ ์์น๋ฅผ ์ฐพ์ผ๋ ค๊ณ ํฉ๋๋ค.
๋ด ์ง๋ฌธ์ : 9 ๋ฒ์งธ ๋ ธ๋๊ฐ ์ฒ์๋ถํฐ ์ค์ผ ๋์์ต๋๊น? ๋๋ (1) ์ํ์ ๋๋ฌํ๊ธฐ ์ํด ์ฌํ ๊ฐ๋ฅํ ๋จ๊ณ ๋๋ (2) ๋ฒ๊ทธ๊ฐ์์ ์์๋ ์์น๋ฅผ ์ฐพ์ผ๋ ค๊ณ ํฉ๋๋ค.
์, ์์ ํ์ง ์๋ ๋ ธ๋๊ฐ ๋ง์คํฐ์ด๊ธฐ ๋๋ฌธ์์ด ๊ฒฝ์ฐ์๋ ํญ์ ์ค์ผ์ด์์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ฐ๋ฆฌ๋ ์ฃผ์ธ๊ณผ ๋ ธ๋์ ๋ชจ๋์๊ฒ ๋์ผํ ๋ฌธ์ ๋ฅผ ๋ณด์์ต๋๋ค.
์ฌ์ ํ ๋ฌธ์ ๊ฐ ์ด๋์์ ์๋์ง ์ ์ ์์ผ๋ฉฐ, ์ ์ด๋ ๋ ธ๋๋ฅผ ๋ค์ ๋ง๋ค๊ณ ๋ ธ๋๋ฅผ ๋ค์ ์์ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋๋ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฌ๋ ์ด๊ฒ๋ค์ ๋ฌธ์ ๋ฅผ ๊ณ ์น๋ ์ฝ๊ฐ "์ด๋ ค์ด"๋ฐฉ๋ฒ์ ๋๋ค.
๋กฑ์ท,ํ์ง๋ง ๋ค์ ๋ง๋๋ฉด ... ํ์๋์ง ์๋ ๋ ธ๋์ ์ง์ ๋ ํฌ๋๊ฐ ์๋์ง ํ์ธํ ์ ์์ต๋๊น?
๊ฐ๋ฅํ ์๋๋ฆฌ์ค๋ฅผ ์๊ฐํ๋ฉด์ ์ง๋ฌธ์ ๊ฒ์ํ๊ณ ์์ต๋๋ค.
* Do you have other master nodes in your cluster?
๋ชจ๋ cluser์๋ 3 ๊ฐ์ ๋ง์คํฐ๊ฐ ์์ต๋๋ค (๋ฐ๋ผ์ ๋ค์ ์์ํ๋ ๊ฒ์ด ์ฝ์ต๋๋ค).
* Do you have extenders?
์๋.
์ค๋ ์ฃผ๋ชฉ ํ ํ ๊ฐ์ง ํฅ๋ฏธ๋ก์ด ์ ์ ํ๋์ ๋ง์คํฐ๊ฐ DaemonSet์์ ํฌ๋๋ฅผ๋ฐ์ง ๋ชปํ๋ ํด๋ฌ์คํฐ๊ฐ ์๋ค๋ ๊ฒ์ ๋๋ค. ์์ ์ ๋ ธ๋ ์ค ํ๋๋ฅผ ์ข ๋ฃ ํ ChaosMonkey๊ฐ ์ฌ์ฉ ์ค์ ๋๋ค. ํฅ๋ฏธ ๋กญ์ต๋๋ค. ์ด๊ฒ์ ํฌ๋๋ฅผ ์ด์ ์๋ฐ์ง ์์ ๋ง์คํฐ์๊ฒ๋ก ์ด๋ํ๋๋ก ๋ง๋ค์์ต๋๋ค. ๊ทธ๋์ ์ด๋ป๊ฒ ๋ ๋ฌธ์ ๊ฐ์๋ ๋ ธ๋๊ฐ ์๋ ๋ค๋ฅธ ๋ ธ๋๋ฅผ ์ ๊ฑฐํ๋ฉด ๊ทธ ์์ ์์ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋๋ ๊ฒ์ฒ๋ผ ๋ณด์์ต๋๋ค.
๊ทธ "์์ "๋๋ฌธ์ ๋๋ ์ง๋ช ๋ ํฌ๋์ ๋ํด ๋๋ต ํ ์ ์๋๋ก ๋ฌธ์ ๊ฐ ๋ค์ ๋ฐ์ํ ๋๊น์ง ๊ธฐ๋ค๋ ค์ผํฉ๋๋ค.
์ง๊ธ ํผ๋ ์ค๋ฌ์์ ... ๋ฐ๋ชฌ ์ ์ด ๋ง์คํฐ ๋ ธ๋์ ๋ํ ์ค์ผ์ ํ์ฉํฉ๋๊น? ๋ค์ ๋งํด์ ... ๋น์ ์ ๋ฒ๊ทธ๋ ๋จ์ง ์ค์ผ์ค๋ง ์ด๋ฒคํธ์ ๋๊น, ์๋๋ฉด ํฌ๋๊ฐ ์ค์ผ์ค๋ง๋์ด์ผํ๋ค๋ ์ฌ์ค์ ๋๊น?
๋ฌธ์ ๋ ์ ์ด๋ ํ๋์ ์ผ์น ์ ํธ๋ (๋๋ ๋ฐ ์นํ๋) ์ค์ ์ด ์์ด๋ ์ค์ผ์ค๋ฌ์์ ํด๋น ๋ ธ๋๋ฅผ ์ฐพ์ ์ ์๋ค๋ ๊ฒ์ ๋๋ค.
๊ทธ๋ ๊ธฐ ๋๋ฌธ์ taint ์ค๋ฅ๊ฐ ์์๋๋ฉฐ ์ฒซ ๋ฒ์งธ ์ด๋ฒคํธ์ ์ด๋ฏธ ์์ด์ผํ๋ค๊ณ ๋งํ์ต๋๋ค (taint๋ ์ ํธ๋ ๊ธฐ์ค์ ์ผ๋ถ๊ฐ ์๋๋ฏ๋ก).
์๊ฒ ์ต๋๋ค. ๋ด๊ฐ ๋๋ฝ ๋ ๊ฒ์ด ์๋์ง ํ์ธํ๊ธฐ ์ํด ์ค์ ์ ํ์ธํ๋ ค๊ณ ํ์ต๋๋ค.
์ค์ผ์ค๋ฌ์ ์ํด ๋
ธ๋๊ฐ "๋ณด์ด์ง ์๋๋ค"๊ณ ์๊ฐํ์ง ์์ต๋๋ค. 0/9 nodes are available
์ด ํ์๋๋ฉด ๋
ธ๋๊ฐ ์ค์ ๋ก ์บ์์ ์๋ค๋ ๊ฒฐ๋ก ์ ๋ด๋ฆด ์ ์์ต๋๋ค. ์์์น ๋ชปํ ์ด์ ๊ฐ ์ด๋๊ฐ์์ ์์ด๋ฒ๋ฆฐ ๊ฒ๊ณผ ๋น์ทํ๋ฏ๋ก ์ด๋ฒคํธ์ ํฌํจํ์ง ์์ต๋๋ค.
์ฌ์ค, ์ด ๊ฐ์๋ ํญ์ ์ค์ ๋ ธ๋ ๊ฐ์์ ์ผ์นํฉ๋๋ค. ๋ ์ค๋ช ์ ์ธ ์ด๋ฒคํธ ํ ์คํธ๊ฐ ๋ชจ๋ ๋ ธ๋์ ์ ๊ณต๋๋ ๊ฒ์ ์๋์ง๋ง ์ธ๊ธํ๋ฏ์ด ๋ณ๋์ ๋ฌธ์ ๊ฐ ๋ ์ ์์ต๋๋ค.
kube-scheduler ๋ก๊ทธ๋ฅผ ๋ณผ ์ ์์ต๋๊น? ๊ด๋ จ์ด์๋ ๊ฒ ๊ฐ์๋ฐ?
@zetaab์ด ์ฑ๊ณตํ์ง ์๊ณ ๊ทธ๊ฒ์
๊ฐ๋ฅํ๋ฉด 1.18.5๋ ์คํํ์ฌ ์ค์๋ก ๋ฌธ์ ๋ฅผ ํด๊ฒฐ ํ ๊ฒฝ์ฐ๋ฅผ ๋๋นํ์ญ์์ค.
๋ ์ด์ ๋ก๊ทธ๊ฐ ํ์ํ ๊ฒฝ์ฐ ํ ์คํธ ํด๋ฌ์คํฐ์์ ์์ ์ ์ผ๋ก ์ฌํ ํ ์ ์์ต๋๋ค.
@dilyevsky ์ฌํ ๋จ๊ณ๋ฅผ ๊ณต์ ํ์ญ์์ค. ์คํจํ ํํฐ๊ฐ ๋ฌด์์ธ์ง ์ด๋ป๊ฒ ๋ ์๋ณ ํ ์ ์์ต๋๊น?
ds ํฌ๋์ ๋ํ ๋ ธ๋์ metadata.name ์ธ ๊ฒ ๊ฐ์ต๋๋ค. ์ด์ํฉ๋๋ค. pod 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 ์ฌ์ฉ)๋ก ์ ํด๋ฌ์คํฐ๋ฅผ ํ์ ์ํค๊ณ Cilium 1.7.6์ ์ ์ฉํ๋ ๊ฒ์ ๋๋ค.
Cilium 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, [email protected]
์ผ๋ค :
ds ํฌ๋์ ๋ํ ๋ ธ๋์ metadata.name ์ผ ๋ฟ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
๊ธฐ๋ฌํ. pod yaml์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.apiVersion : v1kind : Podmetadata :
์ฃผ์ :
scheduler.alpha.kubernetes.io/critical-pod : ""
creationTimestamp : "2020-07-09T23 : 17 : 53Z"
generateName : ์ฌ๋ชจ-
๋ผ๋ฒจ :
์ปจํธ๋กค๋ฌ ์์ ํด์ : 6c94db8bb8
k8s-app : ์ฌ๋ชจ
pod-template-generation : "1"
managedFields :
# ๊ด๋ฆฌ ํ๋ ์ฐ๋ ๊ธฐ
์ด๋ฆ : cilium-d5n4f
๋ค์ ์คํ์ด์ค : kube-system
ownerReferences :
- apiVersion : apps / v1
blockOwnerDeletion : true
์ปจํธ๋กค๋ฌ : ์ฐธ
์ข ๋ฅ : DaemonSet
์ด๋ฆ : cilium
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
์ฐ์ฐ์ : In
๊ฐ :
-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
์ด๋ฆ : cilium-agent
readinessProbe :
exec :
๋ช ๋ น:- ์ฌ๋ชจ
- ์ํ
- --๊ฐ๊ฒฐํ
failureThreshold : 3
initialDelaySeconds : 5
periodSeconds : 30
successThreshold : 1
timeoutSeconds : 5
๋ฆฌ์์ค : {}
securityContext :
๊ธฐ๋ฅ :
๋ํ๋ค:- NET_ADMIN
- SYS_MODULE
ํน๊ถ : ์ฐธ
TerminationMessagePath : / dev / termination-log
shutdownMessagePolicy : ํ์ผ
volumeMounts :- mountPath : / var / run / cilium
์ด๋ฆ : 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
์ด๋ฆ : cilium-token-j74lr
readOnly : true
dnsPolicy : ClusterFirst
enableServiceLinks : true
hostNetwork : true
initContainers :- ๋ช ๋ น:
- /init-container.sh
env :- ์ด๋ฆ : CILIUM_ALL_STATE
valueFrom :
configMapKeyRef :
ํค : ๊นจ๋ํ ์ค๋ฅจ ์ํ
์ด๋ฆ : 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
ํน๊ถ : ์ฐธ
TerminationMessagePath : / dev / termination-log
shutdownMessagePolicy : ํ์ผ
volumeMounts :- mountPath : / var / run / cilium
์ด๋ฆ : cilium-run- mountPath : /var/run/secrets/kubernetes.io/serviceaccount
์ด๋ฆ : cilium-token-j74lr
readOnly : true
์ฐ์ ์์ : 2000001000
priorityClassName : ์์คํ ๋ ธ๋ ์ค์
restartPolicy : ํญ์
schedulerName : ๊ธฐ๋ณธ ์ค์ผ์ค๋ฌ
securityContext : {}
serviceAccount : cilium
serviceAccountName : cilium
terminateGracePeriodSeconds : 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-unavailable
์ฐ์ฐ์ : ์กด์ฌ
๋ณผ๋ฅจ :- hostPath :
๊ฒฝ๋ก : / var / run / cilium
์ ํ : DirectoryOrCreate
์ด๋ฆ : cilium-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- ์ด๋ฆ : cilium-token-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.yamlapi ๋ฒ์ : v1kind : ServiceAccountmetadata :
์ด๋ฆ : cilium
๋ค์ ์คํ์ด์ค : kube-system
--- # ์ถ์ฒ : cilium / charts / operator / templates / serviceaccount.yamlapi ๋ฒ์ : v1kind : ServiceAccountmetadata :
์ด๋ฆ : cilium-operator
๋ค์ ์คํ์ด์ค : kube-system
--- # ์์ค : cilium / charts / config / templates / configmap.yamlapi ๋ฒ์ : v1kind : ConfigMapmetadata :
์ด๋ฆ : cilium-config
๋ค์ ์คํ์ด์ค : kube-systemdata :# ์ ์ ํ ๋น ๋ชจ๋๋ ์ฌ๋ชจ๊ฐ์ ์ ์์ ๊ณต์ ํ๋ ๋ฐฉ๋ฒ์ ์ ํํฉ๋๋ค
์ ์ฅ ๋ฐฉ๋ฒ์ ์ค์ ํ์ฌ ๋ ธ๋ # ๊ฐ. ์ต์ ์ "crd"๋๋ "kvstore"์ ๋๋ค.
#- "crd"๋ kubernetes์ ID๋ฅผ CRD (์ปค์คํ ๋ฆฌ์์ค ์ ์)๋ก ์ ์ฅํฉ๋๋ค.
# ๋ค์๊ณผ ๊ฐ์ด ์ฟผ๋ฆฌ ํ ์ โโ์์ต๋๋ค.
# kubectl get ciliumid
#- "kvstore"๋ kvstore, etcd ๋๋ consul์ ID๋ฅผ ์ ์ฅํฉ๋๋ค.
# ์๋์ ๊ตฌ์ฑ๋์์ต๋๋ค. 1.6 ์ด์ ์ Cilium ๋ฒ์ ์ kvstore ๋ง ์ง์
# ๋ฐฑ์๋. ์ด๋ฌํ ์ค๋๋ cilium ๋ฒ์ ์ ์ ๊ทธ๋ ์ด๋๋ ๊ณ์ํด์
# ์๋์ identity-allocation-mode๋ฅผ ์ฃผ์ ์ฒ๋ฆฌํ์ฌ kvstore ๋๋
# "kvstore"๋ก ์ค์ ํฉ๋๋ค.
์ ์ ํ ๋น ๋ชจ๋ : crd# ๋๋ฒ๊ทธ ๋ชจ๋์์ cilium์ ์คํํ๋ ค๋ฉด์ด ๊ฐ์ true๋ก ๋ณ๊ฒฝํ์ญ์์ค.
๋๋ฒ๊ทธ : "false"# IPv4 ์ฃผ์ ์ง์ ์ ํ์ฑํํฉ๋๋ค. ํ์ฑํ๋๋ฉด ๋ชจ๋ ์๋ ํฌ์ธํธ์ IPv4๊ฐ ํ ๋น๋ฉ๋๋ค.
# ์ฃผ์.
enable-ipv4 : "true"# IPv6 ์ฃผ์ ์ง์ ์ ํ์ฑํํฉ๋๋ค. ํ์ฑํ๋๋ฉด ๋ชจ๋ ์๋ ํฌ์ธํธ์ IPv6๊ฐ ํ ๋น๋ฉ๋๋ค.
# ์ฃผ์.
enable-ipv6 : "๊ฑฐ์ง"# cilium ๋ชจ๋ํฐ๊ฐ ํจํท ์ถ์ ์ ์ง๊ณํ๋๋กํ๋ ค๋ฉด์ด ์์ค์ ์ค์ ํ์ญ์์ค.
#- "๋ฎ์", "์ค๊ฐ"๋๋ "์ต๋". ๋ ๋ฒจ์ด ๋์์๋ก ์ ์ ํจํท
# ๋ชจ๋ํฐ ์ถ๋ ฅ์ ํ์๋ฉ๋๋ค.
๋ชจ๋ํฐ ์ง๊ณ : ์ค๊ฐ# ๋ชจ๋ํฐ ์ง๊ณ ๊ฐ๊ฒฉ์ ๋ชจ๋ํฐ ๊ฐ์ ์ผ๋ฐ์ ์ธ ์๊ฐ์ ์ ์ดํฉ๋๋ค.
ํ์ฉ ๋ ๊ฐ ์ฐ๊ฒฐ์ ๋ํ ์๋ฆผ ์ด๋ฒคํธ # ๊ฐ.
#
# ๋ชจ๋ํฐ ์ง๊ณ๊ฐ "์ค๊ฐ"์ด์์ผ๋ก ์ค์ ๋ ๊ฒฝ์ฐ์๋ง ์ ํจํฉ๋๋ค.
๋ชจ๋ํฐ ์ง๊ณ ๊ฐ๊ฒฉ : 5 ์ด# ๋ชจ๋ํฐ ์ง๊ณ ํ๋๊ทธ๋ ์ด๋ค TCP ํ๋๊ทธ๋ฅผ
# ์ฒซ ๋ฒ์งธ ๊ด์ฐฐ, ๋ชจ๋ํฐ ์๋ฆผ์ด ์์ฑ๋๋๋กํฉ๋๋ค.
#
# ๋ชจ๋ํฐ ์ง๊ณ๊ฐ "์ค๊ฐ"์ด์์ผ๋ก ์ค์ ๋ ๊ฒฝ์ฐ์๋ง ์ ํจํฉ๋๋ค.
๋ชจ๋ํฐ ์ง๊ณ ํ๋๊ทธ : ๋ชจ๋# 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"๋ก ์ค์ ํ๋ ๊ฒ์ ๊ณ ๋ คํ ์ ์์ต๋๋ค.
#
#์ด ์ต์ ์ Cilium 1.4์์ ๋์ ๋์์ต๋๋ค. Cilium 1.3 ๋ฐ ์ด์ ๋ฒ์ ๋ฌด์
#์ด ์ต์ ์ "true"๋ก ์ค์ ๋ ๊ฒ์ฒ๋ผ ์๋ํฉ๋๋ค.
#
#์ด ๊ฐ์ด ์์ ๋๋ฉด ๋ค์ Cilium ์์ ๋์ ๋ณต์
๊ธฐ์กด ์๋ ํฌ์ธํธ ์์ ์งํ์ค์ธ ์ฐ๊ฒฐ ์ถ์ ์ด ์ค๋จ ๋ ์ ์์ต๋๋ค.
# ์ด๋ก ์ธํด ์ ์ฑ ์ด ์ญ์ ๋๊ฑฐ๋๋ก๋ ๋ฐธ๋ฐ์ฑ ๊ฒฐ์ ์ด ๋ณ๊ฒฝ ๋ ์ ์์ต๋๋ค.
# ํ๋์ ์ฐ๊ฒฐ๋์์ต๋๋ค. ๋ณต์ํ๋ ค๋ฉด ๋์ ์ ๋ค์ ๋ง๋ค์ด์ผ ํ ์ ์์ต๋๋ค.
# ์ฐ๊ฒฐ.
#
# 1.3 ์ด์ ๋ฒ์ ์์ ๋ค์์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ๋ ๋์์ด ์ต์ ์ด "false"๋ก ์ค์ ๋ ๊ฒฝ์ฐ
# 1.4 ์ด์์ธ ๊ฒฝ์ฐ ์ ๊ทธ๋ ์ด๋ ์ค์ ์ผํ์ฑ ์ค๋จ์ด ๋ฐ์ํ ์ ์์ต๋๋ค.
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์ ์ฌ์์ ํธ๋ฆฌ๊ฑฐํฉ๋๋ค
# ๊ฐ ์๋ ํฌ์ธํธ์ ๋ํ ์ ์ฑ ๋ฐ 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๋ init ์ปจํ ์ด๋๊ฐ bpf ํ์ผ ์์คํ ์ด ๋ง์ดํธ ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฌ๊ฒํฉ๋๋ค.
wait-bpf-mount : "๊ฑฐ์ง"๊ฐ์ฅ ๋ฌด๋ํ : "true"
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.yamlapi ๋ฒ์ : 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
- ciliumnetwork ์ ์ฑ / ์ํ
- ์ฌ๋ชจ ํด๋ฌ์คํฐ ์ ์ฒด ๋คํธ์ํฌ ์ ์ฑ
- cilium ํด๋ฌ์คํฐ ์ ์ฒด ๋คํธ์ํฌ ์ ์ฑ / ์ํ
- ์ฌ๋ชจ ์ข ์
- ciliumendpoints / status
- ์ฌ๋ชจ ๋ ธ๋
- ์ฌ๋ชจ ์ / ์ํ
- ์ฌ๋ชจ ์ ์ฒด์ฑ
- ciliumidentities / status
๋์ฌ :- '*'
--- # ์ถ์ฒ : cilium / charts / operator / templates / clusterrole.yamlapi ๋ฒ์ : rbac.authorization.k8s.io/v1kind : ClusterRolemetadata :
์ด๋ฆ : cilium-operatorrules :- apiGroups :
- ""
์์:
# [core | kube] dns ํฌ๋๋ฅผ ์๋์ผ๋ก ์ญ์ ํ์ฌ
# Cilium์์ ๊ด๋ฆฌ- ํฌ๋
๋์ฌ :- ๊ฐ์ ธ ์ค๊ธฐ
- ๋ช ๋ถ
- ์๋ชฉ ์๊ณ
- ์ง์ฐ๋ค
- apiGroups :
- discovery.k8s.io
์์:- ๋์
๋์ฌ :- ๊ฐ์ ธ ์ค๊ธฐ
- ๋ช ๋ถ
- ์๋ชฉ ์๊ณ
- apiGroups :
- ""
์์:
# k8s์์ ์๋์ผ๋ก ์ฝ๊ณ ๋ ธ๋์ pod CIDR์ cilium์
# etcd ๊ทธ๋์ ๋ชจ๋ ๋ ธ๋๋ ๋ค๋ฅธ ๊ณณ์์ ์คํ๋๋ ๋ค๋ฅธ ํฌ๋์ ๋๋ฌํ๋ ๋ฐฉ๋ฒ์ ์๊ณ
# ๋ ธ๋.- ๋ ธ๋
#ToGroup
๊ฐ ํฌํจ ๋ CNP๋ฅผ ๋์ ์ผ๋ก ๋ณํํฉ๋๋ค.- ์๋น์ค
- ๋์
# apiserver ์ฐ๊ฒฐ ํ์ธ- ๋ค์ ์คํ์ด์ค
๋์ฌ :- ๊ฐ์ ธ ์ค๊ธฐ
- ๋ช ๋ถ
- ์๋ชฉ ์๊ณ
- apiGroups :
- cilium.io
์์:- ciliumnetworkpolicies
- ciliumnetwork ์ ์ฑ / ์ํ
- ์ฌ๋ชจ ํด๋ฌ์คํฐ ์ ์ฒด ๋คํธ์ํฌ ์ ์ฑ
- cilium ํด๋ฌ์คํฐ ์ ์ฒด ๋คํธ์ํฌ ์ ์ฑ / ์ํ
- ์ฌ๋ชจ ์ข ์
- ciliumendpoints / status
- ์ฌ๋ชจ ๋ ธ๋
- ์ฌ๋ชจ ์ / ์ํ
- ์ฌ๋ชจ ์ ์ฒด์ฑ
- ciliumidentities / status
๋์ฌ :- '*'
--- # ์ถ์ฒ : cilium / charts / agent / templates / clusterrolebinding.yamlapi ๋ฒ์ : rbac.authorization.k8s.io/v1kind : ClusterRoleBindingmetadata :
์ด๋ฆ : ciliumroleRef :
apiGroup : rbac.authorization.k8s.io
์ข ๋ฅ : ClusterRole
์ด๋ฆ : ciliumsubjects :- ์ข ๋ฅ : ServiceAccount
์ด๋ฆ : cilium
๋ค์ ์คํ์ด์ค : kube-system
--- # ์ถ์ฒ : cilium / charts / operator / templates / clusterrolebinding.yamlapi ๋ฒ์ : rbac.authorization.k8s.io/v1kind : ClusterRoleBindingmetadata :
์ด๋ฆ : cilium-operatorroleRef :
apiGroup : rbac.authorization.k8s.io
์ข ๋ฅ : ClusterRole
์ด๋ฆ : cilium-operatorsubjects :- ์ข ๋ฅ : ServiceAccount
์ด๋ฆ : cilium-operator
๋ค์ ์คํ์ด์ค : kube-system
--- # ์ถ์ฒ : cilium / charts / agent / templates / daemonset.yamlapi ๋ฒ์ : apps / v1kind : DaemonSetmetadata :
๋ผ๋ฒจ :
k8s-app : ์ฌ๋ชจ
์ด๋ฆ : cilium
๋ค์ ์คํ์ด์ค : 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
์ด๋ฆ : cilium-agent
securityContext :
๊ธฐ๋ฅ :
๋ํ๋ค:
- NET_ADMIN
- SYS_MODULE
ํน๊ถ : ์ฐธ
volumeMounts :- mountPath : / var / run / cilium
์ด๋ฆ : 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 :
ํค : ๊นจ๋ํ ์ค๋ฅจ ์ํ
์ด๋ฆ : 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
ํน๊ถ : ์ฐธ
volumeMounts :- mountPath : / var / run / cilium
์ด๋ฆ : cilium-run
restartPolicy : ํญ์
priorityClassName : ์์คํ ๋ ธ๋ ์ค์
serviceAccount : cilium
serviceAccountName : cilium
terminateGracePeriodSeconds : 1
๊ด์ฉ :- ์ฐ์ฐ์ : ์กด์ฌ
๋ณผ๋ฅจ :
# ์ฌ์์ / ์ ๊ทธ๋ ์ด๋ ์ฌ์ด์ ์ํ ์ ์ง- hostPath :
๊ฒฝ๋ก : / var / run / cilium
์ ํ : DirectoryOrCreate
์ด๋ฆ : cilium-run
# ํธ์คํธ์ cilium cni ํ๋ฌ๊ทธ์ธ์ ์ค์นํ๋ ค๋ฉด- hostPath :
๊ฒฝ๋ก : / opt / cni / bin
์ ํ : DirectoryOrCreate
์ด๋ฆ : cni-path
# ํธ์คํธ์ cilium cni ๊ตฌ์ฑ์ ์ค์นํ๋ ค๋ฉด- hostPath :
๊ฒฝ๋ก : /etc/cni/net.d
์ ํ : DirectoryOrCreate
์ด๋ฆ : etc-cni-netd
# ์ปค๋ ๋ชจ๋์๋ก๋ํ๋ ค๋ฉด- hostPath :
๊ฒฝ๋ก : / lib / modules
์ด๋ฆ : lib-modules
# ๋ค๋ฅธ ํ๋ก์ธ์ค (์ : kube-proxy)์ ๋์์ iptable์ ์ก์ธ์คํ๋ ค๋ฉด- 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.yamlapi ๋ฒ์ : apps / v1kind : Deploymentmetadata :
๋ผ๋ฒจ :
io.cilium / app : ์ฐ์ฐ์
์ด๋ฆ : cilium-operator
์ด๋ฆ : cilium-operator
๋ค์ ์คํ์ด์ค : kube-systemspec :
๋ณต์ ๋ณธ : 1
์ ํ์:
matchLabels :
io.cilium / app : ์ฐ์ฐ์
์ด๋ฆ : cilium-operator
์ ๋ต:
rollingUpdate :
maxSurge : 1
maxUnavailable : 1
์ ํ : RollingUpdate
์ฃผํ:
๋ฉํ ๋ฐ์ดํฐ :
์ฃผ์ :
๋ผ๋ฒจ :
io.cilium / app : ์ฐ์ฐ์
์ด๋ฆ : cilium-operator
ํฌ๊ธฐ:
์ฉ๊ธฐ :- ์ธ์ :
- --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 :
ํค : ํด๋ฌ์คํฐ 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
์ด๋ฆ : cilium-aws
์ ํ ์ฌํญ : true- ์ด๋ฆ : AWS_SECRET_ACCESS_KEY
valueFrom :
secretKeyRef :
ํค : AWS_SECRET_ACCESS_KEY
์ด๋ฆ : cilium-aws
์ ํ ์ฌํญ : true- ์ด๋ฆ : AWS_DEFAULT_REGION
valueFrom :
secretKeyRef :
ํค : AWS_DEFAULT_REGION
์ด๋ฆ : cilium-aws
์ ํ ์ฌํญ : true- ์ด๋ฆ : CILIUM_IDENTITY_ALLOCATION_MODE
valueFrom :
configMapKeyRef :
ํค : ID ํ ๋น ๋ชจ๋
์ด๋ฆ : cilium-config
์ ํ ์ฌํญ : true
์ด๋ฏธ์ง : "docker.io/cilium/operator:v1.7.6"
imagePullPolicy : IfNotPresent
์ด๋ฆ : cilium-operator
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, [email protected]
์ผ๋ค :
๋ค์์ ์ค์ผ์ค๋ฌ ๋ก๊ทธ์ ๋๋ค.
I0709 23 : 08 : 22.056081 1 registry.go : 150] EvenPodsSpread ์ ์ด ๋ฐ ์ฐ์ ์์ ํจ์ ๋ฑ๋ก
I0709 23 : 08 : 23.137451 1 serving.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 1 registry.go : 150] EvenPodsSpread ์ ์ด ๋ฐ ์ฐ์ ์์ ํจ์ ๋ฑ๋ก
I0709 23 : 08 : 33.911989 1 registry.go : 150] EvenPodsSpread ์ ์ด ๋ฐ ์ฐ์ ์์ ํจ์ ๋ฑ๋ก
W0709 23 : 08 : 33.917999 1 authorization.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 1 leaderelection.go : 242] ๋ฆฌ๋ ์๋ kube-system / kube-scheduler๋ฅผ ์ทจ๋ํ๋ ค๊ณ ํฉ๋๋ค ...
I0709 23 : 08 : 50.597201 1 leaderelection.go : 252] kube-system / kube-scheduler ์๋๋ฅผ ์ฑ๊ณต์ ์ผ๋ก ํ๋ํ์ต๋๋ค.
E0709 23 : 08 : 50.658551 1 factory.go : 503] pod : kube-system / coredns-66bff467f8-9rjvd๊ฐ ์ด๋ฏธ ํ์ฑ ๋๊ธฐ์ด์ ์์ต๋๋ค.
E0709 23 : 12 : 27.673854 1 factory.go : 503] pod kube-system / cilium-vv466์ด ์ด๋ฏธ ๋ฐฑ ์คํ ๋๊ธฐ์ด์ ์์ต๋๋ค.
E0709 23 : 12 : 58.099432 1 leaderelection.go : 320] ๋ฆฌ์์ค ์ ๊ธ ๊ฒ์ ์ค๋ฅ kube-system / kube-scheduler : etcdserver : leader changed์ค์ผ์ค๋ฌ ํฌ๋๋ฅผ ๋ค์ ์์ํ๋ฉด ๋ณด๋ฅ์ค์ธ ํฌ๋๊ฐ ์ฆ์ ์์ฝ๋ฉ๋๋ค.
โ
๋น์ ์ด ํ ๋น ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ณ GitHub์์ ํ์ธํ์ธ์.
https://github.com/kubernetes/kubernetes/issues/91601#issuecomment-656406215 ,
๋๋ ๊ตฌ๋ ์ทจ์
https://github.com/notifications/unsubscribe-auth/AAJ5E6E4QPGNNBFUYSZEJC3R2ZKHDANCNFSM4NOTPEDA
.
๋ค์์ ์ด๋ฒคํธ์
๋๋ค.
```์ด๋ฒคํธ :
์ ํ ์ด์ ๋ฉ์์ง์ ๋์ด
---- ------ ---- ---- -------
๊ฒฝ๊ณ FailedScheduling
๊ฒฝ๊ณ FailedScheduling
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-un ์ฌ์ฉ ๊ฐ๋ฅ : 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์ ์ฝ๋๋ฅผ ๋ณผ ์ ์์ต๋๊น? ํ ์คํธํ๋ ๋์ ์ถ๊ฐ ๋ก๊ทธ ํ์ ์ถ๊ฐํด์ผ ํ ์ ์์ต๋๋ค. ์บ์๋ฅผ ์ธ์ ํ ์๋ ์์ต๋๋ค.
$ pidof kube-scheduler
$ sudo kill -SIGUSR2 <pid>
. ์ด๊ฒ์ ์ค์ผ์ค๋ฌ ํ๋ก์ธ์ค๋ฅผ ์ข
๋ฃํ์ง ์์ต๋๋ค./ priority critical-urgent
/ ํ ๋น ํด์
์ด ํ
์คํธ ๋ฐฐํฌ๋ฅผ ๋ฐฐํฌํ๊ธฐ ์ ์ ์ด๋ฏธ ์ผ๋ถ ๋ฐ๋ชฌ ์
๊ณผ ๋ฐฐํฌ๊ฐ "๋ณด๋ฅ ์ค"์ ๋ฉ์ถฐ์๋ ๊ฒ์ ๋ณด์์ผ๋ฏ๋ก ์ด๋ฏธ ์คํจํ์ต๋๋ค. ์ค์ผ ๋ฌผ์ง์ด ๋
ธ๋์์ ์ ๊ฑฐ๋์์ต๋๋ค.
์ง๊ธ ์ฐ๋ฆฌ๋ ๋ฌธ์ ๊ฐ ๋ ์ด์ ๋ณด์ด์ง ์๋๋ก ๋
ธ๋๋ฅผ ์ฌ๋ถํ
ํด์ผํ๊ธฐ ๋๋ฌธ์ ์ด๋ฐ ์ผ์ด ๋ฐ์ํ ํ๊ฒฝ์ ์์์ต๋๋ค. ์ฌ์์ฐํ์๋ง์ ๋ ๋ง์ ์ ๋ณด๋ฅผ ๊ฐ์ง๊ณ ๋์์ฌ ๊ฒ์
๋๋ค.
์ด๋ ๊ฒํ์ญ์์ค. ๋๋ ์ฑ๊ณตํ์ง ๋ชปํ ๊ณผ๊ฑฐ์ ์ด๊ฒ์ ์ฌํํ๋ ค๊ณ ๋ ธ๋ ฅํ์ต๋๋ค. ๋๋ ์ฒซ ๋ฒ์งธ ์คํจ ์ฌ๋ก์ ๋ ๊ด์ฌ์ด ์์ต๋๋ค. ์ฌ์ ํ ์ค์ผ๊ณผ ๊ด๋ จ์ด์์ ์ ์์ต๋๋ค.
๋ฌธ์ ๋ฅผ ์ฌํํ์ต๋๋ค. ์์ฒญํ ๋ช ๋ น์ ์คํํ์ต๋๋ค. ์ ๋ณด๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
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:
๋ถํํ๋ ๋์์ด๋์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
์บ์๋ฅผ ๋คํํ๋ ๊ฒ์ ๋๋ฒ๊น ์์ํ ๊ฒ์ด๋ฉฐ ์๋ฌด๊ฒ๋ ๋ณ๊ฒฝํ์ง ์์ต๋๋ค. ๋คํ๋ฅผ ํฌํจ ํด ์ฃผ์๊ฒ ์ต๋๊น?
๋ํ ์ด๊ฒ์ด ์ฒซ ๋ฒ์งธ ์ค๋ฅ๋ผ๊ณ ๊ฐ์ ํ๋ฉด pod yaml ๋ฐ ๋ ธ๋๋ฅผ ํฌํจ ํ ์ ์์ต๋๊น?
๊ทธ๊ฒ์ ๊ฑฐ์ ๋ฒ๋ ค์ง ๋ชจ๋ ๊ฒ์
๋๋ค. ์ ๋ ๋ค๋ฅธ ๋
ธ๋๋ฅผ ์ ๊ฑฐํ์ต๋๋ค. ์ด๊ฒ์ด ์ฒซ ๋ฒ์งธ ์ค๋ฅ๋ ์๋์ง๋ง ๋คํ์์ coredns ํฌ๋๋ฅผ ๋ณผ ์ ์์ต๋๋ค. ์ด๊ฒ์ด ์ฒซ ๋ฒ์งธ ์ค๋ฅ์์ต๋๋ค. ๋๋ ๋น์ ์ด ์ฐ๋ ๊ธฐ์ฅ์์ ๋ฌด์์ ์๊ตฌํ๊ณ ์๋์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
๋๋ yamls๋ฅผ ๊ฐ์ ธ์ฌ๊ฑฐ์ผ
๊ฐ์ฌํฉ๋๋ค. ๊ด๋ จ ๋ ธ๋์ ํฌ๋๋ฅผ ๋ค๋ฌ ์๋ค๋ ์ฌ์ค์ ๋ชฐ๋์ต๋๋ค.
๊ทธ๋๋ ํด๋น ๋ ธ๋์ ๋ํด ์์ฝ ๋ ํฌ๋๋ฅผ ํฌํจ ํ ์ ์์ต๋๊น? ๋ฆฌ์์ค ์ฌ์ฉ๋ ๊ณ์ฐ์ ๋ฒ๊ทธ๊ฐ์๋ ๊ฒฝ์ฐ๋ฅผ ๋๋นํ์ฌ.
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 ๋ ๋ฒ๊ทธ๋ฅผ ๋ฐ๊ฒฌํ๋ฉด ์์ ๋กญ๊ฒ ์ด๊ฒ์ ๊ฐ์ง๊ณ PR์ ์ ์ถํ์ญ์์ค. ์ถ๊ฐ ํ ๋ก๊ทธ ๋ผ์ธ์ด ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ๊ธฐ์ฌ์์๊ฒ ์ด๋ ค ์์ต๋๋ค.
@alculquicondor :
์ด ์์ฒญ์ ๊ธฐ์ฌ์์ ๋์์ด ํ์ํ ๊ฒ์ผ๋ก ํ์๋์์ต๋๋ค.
์์ฒญ์ด ์ฌ๊ธฐ์ ๋์ด๋ ์๊ตฌ ์ฌํญ์ ์ถฉ์กฑํ๋์ง ํ์ธ
์ด ์์ฒญ์ด ๋ ์ด์ ์ด๋ฌํ ์๊ตฌ ์ฌํญ์ ์ถฉ์กฑํ์ง ์์ผ๋ฉด ๋ผ๋ฒจ์ ์ญ์ ํ ์ ์์ต๋๋ค.
/remove-help
๋ช
๋ น์ผ๋ก ์ฃผ์ ์ฒ๋ฆฌํฉ๋๋ค.
์ ๋ํ ์๋ต ์ด :
/๋์
@maelk ๋ ๋ฒ๊ทธ๋ฅผ ๋ฐ๊ฒฌํ๋ฉด ์์ ๋กญ๊ฒ ์ด๊ฒ์ ๊ฐ์ง๊ณ PR์ ์ ์ถํ์ญ์์ค. ์ถ๊ฐ ํ ๋ก๊ทธ ๋ผ์ธ์ด ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ๊ธฐ์ฌ์์๊ฒ ์ด๋ ค ์์ต๋๋ค.
PR ๋๊ธ์ ์ฌ์ฉํ์ฌ ๋์ ์ํธ ์์ฉํ๋ ๋ฐฉ๋ฒ์ ์ฌ๊ธฐ์์ ํ์ธํ ์ kubernetes / test-infra ์ ์ฅ์์ ๋ฌธ์ ๋ฅผ ์ ์ถํ์ธ์.
/์์์ธ
@maelk ์ด ๋ฌธ์ ๊ฐ ์ฒ์ ๋ฐ์ํ๋ ํ์ด๋ฐ์ ํน์ ํ ๊ฒ์ด ์์ต๋๊น? ์๋ฅผ ๋ค์ด ๋ ธ๋๊ฐ ์์๋ ์งํ์ ๋ฐ์ํฉ๋๊น?
์๋์, ์ผ์ ์ด ์กํ๊ณ ์ ์คํ๋๋ ํฌ๋๊ฐ ๊ฝค ์์ต๋๋ค. ๊ทธ๋ฌ๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ฉด ๋ ์ด์ ์์ฝ ํ ์ ์์ต๋๋ค.
์ฌํ ๊ฐ๋ฅํ ์ผ์ด์ค๊ฐ ๋ ๋๊น์ง ์ฐ์ ์์๋ฅผ ๋ฎ ์ถฅ๋ ๋ค.
์ถ๊ฐ ๋ก๊ทธ ํญ๋ชฉ์ด์๋ ์ค์ผ์ค๋ฌ๋ก ๋ฒ๊ทธ๋ฅผ ์ฌํ ํ ์์์์ต๋๋ค. ์ฐ๋ฆฌ๊ฐ ๋ณด๋ ๊ฒ์ ๋ง์คํฐ ์ค ํ๋๊ฐ ๋ฐ๋ณต๋๋ ๋ ธ๋ ๋ชฉ๋ก์์ ์์ ํ ์ฌ๋ผ์ง๋ค๋ ๊ฒ์ ๋๋ค. ํ๋ก์ธ์ค๊ฐ 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
๋ฐ๋ผ์ ๋ ธ๋ ์ค ํ๋๊ฐ ์ ์ฌ์ ๋ ธ๋ ๋ชฉ๋ก์์ ์ ๊ฑฐ๋ฉ๋๋ค. ์ํ๊น๊ฒ๋ ํ๋ก์ธ์ค๋ฅผ ์์ํ ๋ ์ถฉ๋ถํ ๋ก๊น ์ด ์์์ง๋ง ๋ ๋ง์ ์ ๋ณด๋ฅผ ์ป์ผ๋ ค๊ณ ๋ ธ๋ ฅํ ๊ฒ์ ๋๋ค.
๋ก๊ทธ ๋ผ์ธ ๋ณ ์ฝ๋ ์ฐธ์กฐ :
@maelk
%v/%v on node %v, too many nodes fit
๋ํ ์ค์ด ์์ต๋๊น?
๊ทธ๋ ์ง ์์ผ๋ฉด @pancernik ์์ workqueue.ParallelizeUntil(ctx, 16, len(allNodes), checkNode)
์์ ๋ฒ๊ทธ๋ฅผ ํ์ธํ ์ ์์ต๋๊น?
์๋์, ํด๋น ๋ก๊ทธ๋ ๋ํ๋์ง ์์์ต๋๋ค. ๋ํ ๋ณ๋ ฌํ์ ๋ฌธ์ ๊ฐ ์๊ฑฐ๋ ํด๋น ๋ ธ๋๊ฐ ๋ ์ผ์ฐ ํํฐ๋ง ๋ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค. ์ฌ๊ธฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ฌ ์คํจํ ๊ฒฝ์ฐ : https://github.com/Nordix/kubernetes/commit/5c00cdf195fa61316f963f59e73c6cafc2ad9bdc#diff -c237cdd9e4cb201118ca380732d7f361R464 ๋ก๊ทธ afaik์ ํนํ ๋ ๋ง์ ๋๋ฒ๊ทธ ํญ๋ชฉ์ ์ถ๊ฐํ๋ ค๊ณ ํฉ๋๋ค. ํจ์์ ๋ณ๋ ฌํ.
ํ ๋ ธ๋๊ฐ ํํฐ๋ง์ ๋ ๋ฒ ๊ฑฐ์น๋ ๊ฒ์ ๋ฐฉ๊ธ ๊นจ๋ฌ์์ต๋๋ค!
๋ก๊ทธ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
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 ๋ ธ๋๋ ํํฐ๋ง์ ๋ ๋ฒ ์ํํฉ๋๋ค.
์๋์, ํด๋น ๋ก๊ทธ๋ ๋ํ๋์ง ์์์ต๋๋ค. ๋ํ ๋ณ๋ ฌํ์ ๋ฌธ์ ๊ฐ ์๊ฑฐ๋ ํด๋น ๋ ธ๋๊ฐ ๋ ์ผ์ฐ ํํฐ๋ง ๋ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค. ์ฌ๊ธฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ฌ ์คํจํ ๊ฒฝ์ฐ : Nordix @ 5c00cdf # diff -c237cdd9e4cb201118ca380732d7f361R464 ๋ก๊ทธ afaik์์ ๋ณผ ์ ์์ผ๋ฏ๋ก ํนํ ํจ์ ๋ฐ ๋ณ๋ ฌํ ์ฃผ์์ ๋๋ฒ๊ทธ ํญ๋ชฉ์ ๋ ์ถ๊ฐํ๋ ค๊ณ ํฉ๋๋ค.
์, ์ค๋ฅ๋ ํฌ๋ ์ด๋ฒคํธ์์ ์์ฝ ์ค๋ฅ๋ก ๋ํ๋ฉ๋๋ค.
ํ ๋ ธ๋๊ฐ ํํฐ๋ง์ ๋ ๋ฒ ๊ฑฐ์น๋ ๊ฒ์ ๋ฐฉ๊ธ ๊นจ๋ฌ์์ต๋๋ค!
์์งํ ๋ณ๋ ฌํ์ ๋ฒ๊ทธ๊ฐ ์๋ค๊ณ ์๊ฐํ์ง ์์ต๋๋ค (์ฌ์ ํ ํ์ธํ ๊ฐ์น๊ฐ ์์ต๋๋ค). ๋ ธ๋ ๋ ๋ฒ. ์ํ๋ ๋งต์ด๊ธฐ ๋๋ฌธ์ ๋ง์ง๋ง ๋ก๊ทธ ๋ผ์ธ์์ 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://github.com/kubernetes/kubernetes/pull/85738 ๋ฐ https://github.com/kubernetes/kubernetes/pull/86919
๋ ธ๋ ํธ๋ฆฌ์๋ ์ค๋ณต ๋ ์ฝ๋๊ฐ ์๋์ง ๊ถ๊ธํฉ๋๋ค.
๋ ธ๋ ํธ๋ฆฌ์๋ ์ค๋ณต ๋ ์ฝ๋๊ฐ ์๋์ง ๊ถ๊ธํฉ๋๋ค.
@maelk ์บ์์์๋ ์ ์ฒด ๋ ธ๋ ๋ชฉ๋ก์ ๋คํ๋ฅผ ๋ณด์ฌ์ค ์ ์์ต๋๊น?
NodeInfoList์์ ํญ๋ชฉ์ ์ถ๊ฐ / ์ ๊ฑฐํ์ง ์๊ณ ํธ๋ฆฌ์์ ์ ์ฒด ๋ชฉ๋ก์ ๋ง๋ค๊ฑฐ๋ ๋ง๋ค์ง ์์ต๋๋ค. ๋ฐ๋ผ์ ์ค๋ณต ํญ๋ชฉ์ด ์์ผ๋ฉด ํธ๋ฆฌ์์ ๋์ฌ ๊ฐ๋ฅ์ฑ์ด ๋์ต๋๋ค.
๋ค์ ํ๋ฒ ํ์ธํ๊ธฐ ์ํด:
1) ํด๋ฌ์คํฐ์๋ 6 ๊ฐ์ ๋
ธ๋ (๋ง์คํฐ ํฌํจ)๊ฐ ์์ต๋๋ค.
2) ํฌ๋๋ฅผ ํธ์คํ
ํด์ผํ๋ ๋
ธ๋๊ฐ ์ ํ ๊ฒ์ฌ๋์ง ์์์ต๋๋ค (๋ก๊ทธ ๋ผ์ธ์ด ์์). ์ด๋ NodeInfoList์ ์ ํ ํฌํจ๋์ง ์์ ์์ ์๋ฏธ ํ ์ ์์ต๋๋ค.
3) NodeInfoList์ 6 ๊ฐ์ ๋
ธ๋๊ฐ ์์ง๋ง ๊ทธ์ค ํ๋๊ฐ ์ค๋ณต๋ฉ๋๋ค.
๋ ธ๋ ํธ๋ฆฌ์๋ ์ค๋ณต ๋ ์ฝ๋๊ฐ ์๋์ง ๊ถ๊ธํฉ๋๋ค.
@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://github.com/Nordix/kubernetes/commit/53279fb06536558f9a91836c771b182791153791
NodeTree์์ ""๊ทธ๋ฃน์ "worker-pool1-60846k0y-scheduler"๋ ธ๋๋ฅผ ์ ๊ฑฐํ์ต๋๋ค.
ํฅ๋ฏธ๋กญ๊ฒ๋ ์ ๊ฑฐ / ์ถ๊ฐ๋ 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
๋ก ์์ํ๋ ๋ฉ์์ง๋ฅผ ๋ณด์
จ์ต๋๊น?
์ ์ฒด ์ค์ผ์ค๋ฌ ๋ก๊ทธ๋ฅผ ์ ๊ณต ํ ์ ์์ต๋๊น?
์๋์, ํด๋น ๋ฉ์์ง๊ฐ ์์ต๋๋ค. ๋ฐ๋ณต์ ํผํ๊ธฐ ์ํด ์คํธ๋ผ์ดํ ๋ค์ด ๋ก๊ทธ ํ์ผ์ ์ ๊ณต ํ ์ ์์ง๋ง ๋จผ์ ์ค๋ ์ท ์ฃผ๋ณ์ ๋ ๋ง์ ๋ก๊ทธ๊ฐ ํฌํจ ๋ ์ถ๋ ฅ์ด ๋์ฌ ๋๊น์ง ๊ธฐ๋ค๋ฆฌ๊ฒ ์ต๋๋ค.
๋ฒ๊ทธ๋ฅผ ์ฐพ์์ต๋๋ค. ๋ฌธ์ ๋ ๊ฒฝ์ฐ์ ๋ฐ๋ผ ๋ชจ๋ ๋ ธ๋ ๋ชฉ๋ก์ ๋ฐํํ์ง ์๋ nodeTree next () ํจ์์ ์์ต๋๋ค. https://github.com/kubernetes/kubernetes/blob/release-1.18/pkg/scheduler/internal/cache/node_tree.go#L147
์ฌ๊ธฐ์ ๋ค์์ ์ถ๊ฐํ๋ฉด ๋ณผ ์ ์์ต๋๋ค. https://github.com/kubernetes/kubernetes/blob/release-1.18/pkg/scheduler/internal/cache/node_tree_test.go#L443
{
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์ด ์๋๋ผ๋ ๊ฒ์ ๋๋ค. ์ด๋ฅผ ์ํด์๋ ์ต์ํ ๋ ๊ฐ์ ์์ญ์ด ์์ด์ผํฉ๋๋ค. ํ๋๋ ๋ค๋ฅธ ์์ญ๋ณด๋ค ์งง๊ณ ํ๋๋ ๋ค์ ํจ์๋ฅผ ์ฒ์ ํธ์ถ ํ ๋ ์ธ๋ฑ์ค๊ฐ 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 ์ ์ ๋ชจ๋ ์นด์ดํฐ๋ฅผ ์ฌ์ค์ ํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
@ ahg-g๋ฅผ ๋ค์ ํ์ธํ๊ธฐ ์ํด ์ ๋ ธ๋๊ฐ ํญ์ ์ถ๊ฐ / ์ ๊ฑฐ ๋ ํด๋ฌ์คํฐ์์๋ ๊ด์ฐฎ์ ๊ฒ์ ๋๋ค.
๊ทผ๋ณธ ์์ธ์ ์ฐพ์ ์ฃผ์ @maelk ์๊ฒ ๊ฐ์ฌ๋๋ฆฝ๋๋ค!
๋ค์ ํจ์์ ๋ชฉ์ ์ NodeInfoList์ ๋์ ์ผ๋ก ๋ณ๊ฒฝ๋์์ผ๋ฏ๋ก ํ์คํ ๋จ์ํํ๊ณ ํธ๋ฆฌ์์ ๋ชฉ๋ก์ ์์ฑํ๊ณ ๋งค๋ฒ ์ฒ์๋ถํฐ ์์ํ๋ ํจ์ ์ธ toList๋ก ๋ณ๊ฒฝํ ์ ์์ต๋๋ค.
cache.nodeTree.next()
๊ฐ ์ค๋
์ท nodeInfoList๋ฅผ ๋น๋ ํ ๋๋ง ํธ์ถ๋๋ค๋ ์ ์ ๊ฐ์ํ ๋ nodeTree ๊ตฌ์กฐ์ฒด์์ ์ธ๋ฑ์ค (zoneIndex ๋ฐ nodeIndex ๋ชจ๋)๋ฅผ ์ ๊ฑฐํ๋ ๊ฒ๋ ์์ ํ๋ค๊ณ ์๊ฐํฉ๋๋ค. ๋์ , ๋ผ์ด๋ ๋ก๋น ๋ฐฉ์์ผ๋ก ์์ญ / ๋
ธ๋๋ฅผ ๋ฐ๋ณตํ๋ ๊ฐ๋จํ nodeIterator()
ํจ์๋ฅผ ์๊ฐํด๋ณด์ญ์์ค.
BTW : 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 () ํจ์๋ฅผ ์๊ฐํด๋ณด์ญ์์ค.
์, ๋งค๋ฒ ๋์ผํ ์์๋ก ๋ชจ๋ ์์ญ / ๋ ธ๋๋ฅผ ๋ฐ๋ณตํ๋ฉด๋ฉ๋๋ค.
ํนํ ํด๋น ๋ฒ๊ทธ์ ๋ํด snapshotlist๋ฅผ ์ ๋ฐ์ดํธํ๋ ๊ธฐ๋ฅ์ ๋ํ ๋จ์ ํ ์คํธ๋ก PR์ ์ ๋ฐ์ดํธํ์ต๋๋ค. ๋ผ์ด๋ ๋ก๋น์์ด ์์ญ๊ณผ ๋ ธ๋๋ฅผ ๋ฐ๋ณตํ๋๋ก next () ํจ์๋ฅผ ๋ฆฌํฉํ ๋งํ์ฌ ๋ฌธ์ ๋ฅผ ์ ๊ฑฐ ํ ์๋ ์์ต๋๋ค.
๊ณ ๋ง์์. ์ข๊ฒ ๋ค๋ฆฌ์ง๋ง, ์ง๊ธ๊ณผ ๊ฐ์ ๋ฐฉ์์ผ๋ก ์์ญ ์ฌ์ด๋ฅผ ๋ฐ๋ณตํด์ผํฉ๋๋ค.
๋๋ ๋น์ ์ด ์ฌ๊ธฐ์ ์๋ฏธํ๋ ๋ฐ๋ฅผ ์ ๋ง๋ก ์ดํดํ์ง ๋ชปํฉ๋๋ค. ๋ ธ๋์ ์์๊ฐ ์ค์ํ๊ณ ์ฌ์ ํ ์์ญ๊ฐ์ ๋ผ์ด๋ ๋ก๋น์ ์งํํด์ผํฉ๋๊น? ์๋๋ฉด ์์ญ์ ๋ชจ๋ ๋ ธ๋๋ฅผ ํ ์์ญ ์ฉ ๋์ด ํ ์ ์์ต๋๊น? ๊ฐ๊ฐ ๋ ๊ฐ์ ๋ ธ๋๋ก ๊ตฌ์ฑ๋ ๋ ๊ฐ์ ์์ญ์ด ์๋ค๊ณ ๊ฐ์ ํด ๋ณด๊ฒ ์ต๋๋ค. ์ด๋ค ์์๋ก ์์ํฉ๋๊น, ์๋๋ฉด ์ ํ ์ค์ํ์ง ์์ต๋๊น?
์์๊ฐ ์ค์ํฉ๋๋ค. ๋ชฉ๋ก์ ๋ง๋๋ ๋์ ์์ญ์ ๋ฒ๊ฐ์ ๊ฐ๋ฉฐํด์ผํฉ๋๋ค. ๊ฐ๊ฐ z1: {n11, n12}
๋ฐ z2: {n21, n22}
๋ฐ {n11, n21, n12, n22}
์ด์ด์ผํฉ๋๋ค.
์์์ด, ๊ณ ๋ง์. ์๊ฐํด ๋ณผ๊ฒ. ๊ทธ๋์ ๋น ๋ฅธ ์์ ์ ์งํํ ์ ์์ต๋๊น? btw, ์ผ๋ถ ํ ์คํธ๊ฐ ์คํจํ์ง๋ง ๊ทธ๊ฒ์ด ๋ด 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 ,์ด ํ ์คํธ๊ฐ 'node-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"},
},
node-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 ์ฃ์กํฉ๋๋ค. ์ด๋ฏธ ๋ค๋ฅธ ์ด์ ๋ก ํด๋ฌ์คํฐ๋ฅผ ๋ค์ ๋น๋ํ์ง๋ง ๋ค์ค az ๋ฐฐํฌ์ ๊ด๋ จ๋ ๋คํธ์ํฌ ๊ตฌ์ฑ ๋ฌธ์ ์ผ ์ ์์ผ๋ฉฐ ๊ฒฐํจ์ด์๋ ๋ ธ๋๊ฐ ์์๋ ์๋ธ๋ท์์ ๋ฐ์ ํ์ผ๋ฏ๋ก ์ง๊ธ์ ๊ฑฑ์ ํ์ง ์์ต๋๋ค. ์ด ๋ฌธ์ ์ ๋งฅ๋ฝ. ๋ค์ ์์ ์ฐจ๋ฆฌ๋ฉด ๋ ์์ธํ ๋ด์ฉ์ ์๋ ค ๋๋ฆฌ๊ฒ ์ต๋๋ค. ๊ฐ์ฌ!
/ retitle ์์ญ ๋ถ๊ท ํ์ด์๋ ๊ฒฝ์ฐ ์ผ๋ถ ๋ ธ๋๋ ์์ฝ์์ ๊ณ ๋ ค๋์ง ์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
ํ์ฌ ์ ๋๋ก ํ ์คํธ๋์๋์ง ํ์ธํ๊ธฐ ์ํด ์ค๋ ์ท์ ๋ํ ํ ์คํธ ์ผ์ด์ค๋ฅผ ์ถ๊ฐํ๋ ์ค์ ๋๋ค.