<p>kubeadm init๊ฐ€ configmap์— ๋Œ€ํ•œ RBAC๋ฅผ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๊ตฌ์„ฑํ•˜์ง€ ์•Š์Œ</p>

์— ๋งŒ๋“  2018๋…„ 06์›” 09์ผ  ยท  17์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: kubernetes/kubeadm

๋ฒ„๊ทธ ๋ณด๊ณ ์„œ ๋˜๋Š” ๊ธฐ๋Šฅ ์š”์ฒญ์ž…๋‹ˆ๊นŒ?

๋ฒ„๊ทธ ๋ณด๊ณ ์„œ

๋ฒ„์ „

kubeadm ๋ฒ„์ „ ( kubeadm version ) : "v1.12.0-alpha.0.957 + 1235adac3802fd-dirty"

์–ด๋–ป๊ฒŒ ๋œ ๊ฑฐ์˜ˆ์š”?

kubeadm init ๋กœ ์ œ์–ด ํ”Œ๋ ˆ์ธ ๋…ธ๋“œ๋ฅผ ์ƒ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ณ„๋„์˜ ๋…ธ๋“œ์—์„œ kubeadm join ๋ฅผ ์‹คํ–‰ํ–ˆ๋Š”๋ฐ ๋‹ค์Œ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

[kubelet] Downloading configuration for the kubelet from the "kubelet-config-1.12" ConfigMap in the kube-system namespace                                                                        
configmaps "kubelet-config-1.12" is forbidden: User "system:bootstrap:4ipkdk" cannot get configmaps in the namespace "kube-system"                                                               

๋ฌด์Šจ ์ผ์ด ์ผ์–ด๋‚˜๊ธฐ๋ฅผ ๊ธฐ๋Œ€ ํ–ˆ์Šต๋‹ˆ๊นŒ?

kubeadm join ๊ฐ€) ์„ฑ๊ณต์ ์œผ๋กœ ์™„๋ฃŒ ๋  ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๊ฒƒ์„ ์žฌํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ• (๊ฐ€๋Šฅํ•œ ํ•œ ์ตœ์†Œํ•œ์œผ๋กœ ์ •ํ™•ํ•˜๊ฒŒ)?

๋‚ด๊ฐ€ ์•Œ ์ˆ˜์žˆ๋Š” ํ•œ, ๋‹ค๋ฅธ ๋…ธ๋“œ์—์„œ kubeadm init ๋ฐ kubeadm join ๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ๊ตฌ์„ฑ ๋งต์— ์˜ํ–ฅ์„์ฃผ์ง€ ์•Š์•„์•ผํ•˜๋Š” ์ถ”๊ฐ€ ์ฝ”๋“œ / yaml์ด ๋งŽ์ด ์žˆ์Šต๋‹ˆ๋‹ค (ํ–‰๋ณตํ•œ AWS ๋ฐฐํฌ์— ํ•„์š”). ๊ทธ๋Ÿฌ๋‚˜ ์ด๊ฒƒ์ด ์žฌํ˜„ ํ•  ์ˆ˜์—†๋Š” ๊ฒƒ์œผ๋กœ ํŒ๋ช…๋˜๋ฉด ๋” ์ž์„ธํ•œ ์ง€์นจ์„ ์ œ๊ณต ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์šฐ๋ฆฌ๊ฐ€ ์•Œ์•„์•ผ ํ•  ๋‹ค๋ฅธ ๊ฒƒ์ด ์žˆ์Šต๋‹ˆ๊นŒ?

kubeadm join ๋ฐ kubeadm init ๋„ ๊ตฌ์„ฑ ๋งต์˜ ์ด๋ฆ„์„ ์ผ๊ด€์„ฑ์—†์ด ์ง€์ •ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. init ๋ช…๋ น์€ ๊ตฌ์„ฑ ํŒŒ์ผ์— ์ง€์ •๋œ kubernetesVersion ํ•˜๊ณ  join ๋ช…๋ น์€ ๊ตฌ์„ฑ ๋งต์˜ ์ด๋ฆ„์œผ๋กœ kubelet ๋ฒ„์ „์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค (์˜ˆ : kubelet-config-1.1). ์ผ์น˜ํ•˜์ง€ ์•Š๋Š” ๋ฒ„์ „์ด ์—†์œผ๋ฉด ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค.

init ๋ช…๋ น์€ kube-public ๋„ค์ž„ ์ŠคํŽ˜์ด์Šค์˜ ๊ตฌ์„ฑ ๋งต์— ๋Œ€ํ•œ ์ต๋ช… ์•ก์„ธ์Šค์— ๋Œ€ํ•œ RBAC ๊ทœ์น™์„ ์ƒ์„ฑํ•˜์ง€๋งŒ kubelet ๊ตฌ์„ฑ์„ ๊ณต์šฉ ๋„ค์ž„ ์ŠคํŽ˜์ด์Šค์— ๋„ฃ์ง€ ์•Š๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์ด๋ฏ€๋กœ ๋…ธ๋“œ ๊ฐ€์ž…์€ ์•ก์„ธ์Šค ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๊ฒƒ.

kinbug prioritimportant-longterm

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

์ผ์น˜ํ•˜์ง€ ์•Š๋Š” ๋ฒ„์ „์ด ์—†์œผ๋ฉด ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค.

text

๋ชจ๋“  17 ๋Œ“๊ธ€

์ผ์น˜ํ•˜์ง€ ์•Š๋Š” ๋ฒ„์ „์ด ์—†์œผ๋ฉด ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค.

text

@chuckha ์ž˜ ๊ธฐ์–ตํ•œ๋‹ค๋ฉด kubelet-* ๊ตฌ์„ฑ ๋งต์€ kube-system ์ด์–ด์•ผํ•˜๋ฉฐ kubeadm์€ ๋ถ€ํŠธ ์ŠคํŠธ๋žฉ ํ† ํฐ ๋ฐ ๋…ธ๋“œ์— ๋Œ€ํ•œ ์•ก์„ธ์Šค๋ฅผ ํ—ˆ์šฉํ•˜๋Š” ๊ทœ์น™์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ๋งˆ์ง€๋ง‰ ๋ณ€๊ฒฝ ํ›„ ๋‹ค์‹œ ํ™•์ธํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

@chuckha ๋งˆ์Šคํ„ฐ + ๋ฆด๋ฆฌ์Šค ๋ฒˆํ˜ธ์—์„œ v1.11.0์œผ๋กœ ๊ฐ•์ œ ๋นŒ๋“œ ๋œ ๋ชจ๋“  ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํด๋Ÿฌ์Šคํ„ฐ์—์„œ ์„ฑ๊ณต์ ์œผ๋กœ ์กฐ์ธ์„ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค.

  • kubelet-config-1.11 ์ด (๊ฐ€) kube-system ์—์„œ ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
  • kubeadm:kubelet-config-1.11 ์—ญํ• ์ด ๊ตฌ์„ฑ ๋งต์— ๋Œ€ํ•œ ๊ถŒํ•œ ๊ฐ€์ ธ ์˜ค๊ธฐ๋กœ kube-system ์—์„œ ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
  • system:nodes ๋ฐ system:bootstrappers:kubeadm:default-node-token ๋Œ€ํ•œ ์—ญํ•  ๋ฐ”์ธ๋”ฉ kubeadm:kubelet-config-1.11 ์ด kube-system ์—์„œ ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋ž˜์„œ IMO :

  • RBAC ์ƒ์„ฑ
  • "๋ฒ„์ „ ์ผ๊ด€์„ฑ"์‹œ๋‚˜๋ฆฌ์˜ค์— ์žˆ๋‹ค๋ฉด ๋ชจ๋“  ๊ฒƒ์ด ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.

์•„์ง ์กฐ์‚ฌํ•ด์•ผ ํ•  ๋ถ€๋ถ„์€

init ๋ช…๋ น์€ ๊ตฌ์„ฑ ํŒŒ์ผ์— ์ง€์ •๋œ kubernetesVersion์„ ์‚ฌ์šฉํ•˜๊ณ  join ๋ช…๋ น์€ ๊ตฌ์„ฑ ๋งต์˜ ์ด๋ฆ„์œผ๋กœ kubelet ๋ฒ„์ „์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค (์˜ˆ : kubelet-config-1.1).

์˜ˆ, ๋ฒ„์ „ ๋ฌธ์ œ ์—ฌ์•ผํ•ฉ๋‹ˆ๋‹ค.

๋นŒ๋“œ ํ•  ๋•Œ ๋ฒ„์ „์„ ์„ค์ •ํ•˜์ง€ ์•Š์•˜์œผ๋ฏ€๋กœ ๋ฐ”์ด๋„ˆ๋ฆฌ๊ฐ€ ๋ชจ๋‘ 1.12.0 ์ด์ƒ์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜์ง€๋งŒ kubeadm์„ ์„ค์น˜ํ•˜๊ณ  ๊ฐ•์ œ๋กœ v1.11์„ ์‚ฌ์šฉํ•˜๋„๋กํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด๋กœ ์ธํ•ด

root@ip-10-0-0-7:~# k get cm -n kube-system
NAME                                 DATA      AGE
...
kubelet-config-1.11                  1         32m

๊ทธ๋ฆฌ๊ณ  ๊ฐ€์ž… ํ•  ๋•Œ :

[kubelet] Downloading configuration for the kubelet from the "kubelet-config-1.12" ConfigMap in the kube-system namespace                                                                        
configmaps "kubelet-config-1.12" is forbidden: User "system:bootstrap:u3ns6m" cannot get configmaps in the namespace "kube-system"                                                               

๋ฐ”์ด๋„ˆ๋ฆฌ๋ฅผ ๋‹ค์‹œ ๋นŒ๋“œํ•˜๊ณ  ์˜ฌ๋ฐ”๋ฅธ ๋ฒ„์ „์œผ๋กœ ๊ฐ•์ œ ์„ค์ •ํ•˜๊ณ  ๋‹ค์‹œ ์‹œ๋„ํ•ฉ๋‹ˆ๋‹ค.

kubelet ๋ฐ kubeadm ๋ฒ„์ „์ด ์ผ์น˜ํ•˜๋ฉด ๋ชจ๋“  ๊ฒƒ์ด ์ •์ƒ์ž…๋‹ˆ๋‹ค. ๊ตฌ์„ฑ ๋งต ์ž‘์„ฑ๊ณผ ๊ตฌ์„ฑ ๋งต ๊ฐ€์ ธ ์˜ค๊ธฐ ์‚ฌ์ด์˜ ๋ถˆ์ผ์น˜ (์˜๋„์  ์ผ ์ˆ˜ ์žˆ์Œ)์™€ ๊ด€๋ จํ•˜์—ฌ ๋œ ๊ธด๊ธ‰ํ•œ ์ˆ˜์ •์„ ์œ„ํ•ด ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค.

kubeadm init๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ๋‹จ๊ณ„๋ฅผ ๊ฐœ๋ณ„์ ์œผ๋กœ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค. kube-system์—๋Š” configmap์ด ์—†์œผ๋ฉฐ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์„ค์ •ํ•  ์ˆ˜์žˆ๋Š” ๊ถŒํ•œ๋„ ์—†์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์–ด๋–ค ๋‹จ๊ณ„์ž…๋‹ˆ๊นŒ?

@drewwells ๋‹น์‹ ๊ณผ ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹จ๊ณ„๋ฅผ ๊ฐœ๋ณ„์ ์œผ๋กœ ์‹คํ–‰ ์ค‘์ด๋ฉฐ ๊ตฌ์„ฑ mpas๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

sudo kubectl get cm -n kube-system --kubeconfig=/etc/kubernetes/admin.conf
NAME                                 DATA   AGE
calico-config                        2      11m
coredns                              1      15m
extension-apiserver-authentication   6      15m
kube-proxy                           2      15m

ํ•ด๊ฒฐ์ฑ…์„ ์ฐพ์•˜์Šต๋‹ˆ๊นŒ?

๋˜ํ•œ ๋ชจ๋“  ๊ตฌ์„ฑ ์š”์†Œ๋Š” 1.11.4์ž…๋‹ˆ๋‹ค.

์ด๊ฒƒ์€ ๋” ๋‚˜์•„๊ฐ‘๋‹ˆ๋‹ค. kubeadm init์„ ์‚ฌ์šฉํ•˜์—ฌ ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ๋ถ€ํŠธ ์ŠคํŠธ๋žฉํ•˜๊ณ  ์ด์ œ ์˜ฌ๋ฐ”๋ฅธ ๊ตฌ์„ฑ ๋งต์ด ์ œ์ž๋ฆฌ์— ์žˆ์Šต๋‹ˆ๋‹ค.

ubuntu@master-1-test2:~$ sudo kubectl get cm -n kube-system --kubeconfig=/etc/kubernetes/admin.conf
NAME                                 DATA      AGE
coredns                              1         41m
extension-apiserver-authentication   6         41m
kube-proxy                           2         41m
kubeadm-config                       1         41m
kubelet-config-1.11                  1         41m
ubuntu@master-1-test2:~$ kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.4", GitCommit:"bf9a868e8ea3d3a8fa53cbb22f566771b3f8068b", GitTreeState:"clean", BuildDate:"2018-10-25T19:13:39Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

๋…ธ๋“œ์—์„œ :

$ sudo kubeadm -v=10 join k8s.oz.noris.de:6443 --token 36etul.nv5lz6hjfifdd4c9 --discovery-token-unsafe-skip-ca-verification                                                                                             I1107 12:57:01.340638    3631 join.go:226] [join] found NodeName empty
I1107 12:57:01.340816    3631 join.go:227] [join] considered OS hostname as NodeName
[preflight] running pre-flight checks
I1107 12:57:01.341152    3631 join.go:238] [preflight] running various checks on all nodes
I1107 12:57:01.341265    3631 checks.go:253] validating the existence and emptiness of directory /etc/kubernetes/manifests
I1107 12:57:01.341677    3631 checks.go:291] validating the existence of file /etc/kubernetes/pki/ca.crt
I1107 12:57:01.341774    3631 checks.go:291] validating the existence of file /etc/kubernetes/kubelet.conf
I1107 12:57:01.341857    3631 checks.go:291] validating the existence of file /etc/kubernetes/bootstrap-kubelet.conf
I1107 12:57:01.341947    3631 kernelcheck_linux.go:45] validating the kernel module IPVS required exists in machine or not
        [WARNING RequiredIPVSKernelModulesAvailable]: the IPVS proxier will not be used, because the following required kernel modules are not loaded: [ip_vs_sh ip_vs ip_vs_rr ip_vs_wrr] or no builtin kernel ipvs support: map[ip_vs:{} ip_
vs_rr:{} ip_vs_wrr:{} ip_vs_sh:{} nf_conntrack_ipv4:{}]
you can solve this problem with following methods:
 1. Run 'modprobe -- ' to load missing kernel modules;
2. Provide the missing builtin kernel ipvs support

I1107 12:57:01.349448    3631 checks.go:138] validating if the service is enabled and active
I1107 12:57:01.361957    3631 checks.go:340] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I1107 12:57:01.362034    3631 checks.go:340] validating the contents of file /proc/sys/net/ipv4/ip_forward
I1107 12:57:01.362076    3631 checks.go:653] validating whether swap is enabled or not
I1107 12:57:01.362134    3631 checks.go:381] validating the presence of executable crictl
I1107 12:57:01.362204    3631 checks.go:381] validating the presence of executable ip
I1107 12:57:01.362244    3631 checks.go:381] validating the presence of executable iptables
I1107 12:57:01.362281    3631 checks.go:381] validating the presence of executable mount
I1107 12:57:01.362320    3631 checks.go:381] validating the presence of executable nsenter
...
[discovery] Trying to connect to API Server "mycluster.example.com:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://mycluster.example.com:6443"
I1107 12:57:01.487256    3631 round_trippers.go:386] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubeadm/v1.11.4 (linux/amd64) kubernetes/bf9a868" 'https://mycluster.example.com:6443/api/v1/namespaces/kube-public/config
maps/cluster-info'
I1107 12:57:01.504539    3631 round_trippers.go:405] GET https://mycluster.example.com:6443/api/v1/namespaces/kube-public/configmaps/cluster-info 200 OK in 17 milliseconds
I1107 12:57:01.504720    3631 round_trippers.go:411] Response Headers:
I1107 12:57:01.504818    3631 round_trippers.go:414]     Content-Type: application/json
I1107 12:57:01.504914    3631 round_trippers.go:414]     Content-Length: 2217
I1107 12:57:01.505003    3631 round_trippers.go:414]     Date: Wed, 07 Nov 2018 12:57:01 GMT
I1107 12:57:01.505174    3631 request.go:942] Response Body: {"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"cluster-info","namespace":"kube-public","selfLink":"/api/v1/namespaces/kube-public/configmaps/cluster-info","uid":"97e9
a3d1-e286-11e8-9272-fa163ef9e3af","resourceVersion":"425","creationTimestamp":"2018-11-07T12:13:53Z"},"data":{"jws-kubeconfig-36etul":"eyJhbGciOiJIUzI1NiIsImtpZCI6IjM2ZXR1bCJ9..zRgexonkjOpLJS0q3IignURwTcpBuQy7gv35Qhhsl_k","jws-kubeconfig-
eth6o8":"eyJhbGciOiJIUzI1NiIsImtpZCI6ImV0aDZvOCJ9..kWj4cI2j1WgKfNG07IGiIij4CSb9kWUbaM2mixlYThY","jws-kubeconfig-rbxd02":"eyJhbGciOiJIUzI1NiIsImtpZCI6InJieGQwMiJ9..HwIWDwfIbAjNM1EGbWdXYOhC8z1MxgwuzhjlJRaZ_pc","kubeconfig":"apiVersion: v1\n
clusters:\n- cluster:\n    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFNE1URXdNekEwTlRrME4xb1hEVEk0TVRBek1UQTB
OVGswTjFvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTU9BCkNHQU5jUjVRQWV3MlljY2V0eWVyYktiODd4RWRPVlp2aUdneElrbkpKTTZwZFVBbzMwSWVxckRqSnlFaTFVeDcKU0c5NS9sRlBqU1htdHhhNHMvc1g1KzNTVW4zZ
EtFRWw5TFhXa0lzeTRJYzRFUTMwWE9WcnNuYTYwN1UzNmQyaAp3NHdTK1dveE5QR3dqZDM2bXQzMFR4bUluYk54ZVl5d2NnVU1tMlZFZXM4dGhVaVhZMXB1N1Y2SUNCY243cE9NCkdoT2xlRXg4SmlEVnhuSGlpSm9oYytCbGNIdHdLU1pzK2cvZUhwdGdlSDdaQlZNRC8zZVFvZXVsUGVvTEkwamEKc09jTENMTkpEVVB
LUWJqRnRNbkFZSXVvOENHSXpFTzBDaDZNeW5vb1pTL0E0bEs1MXJmTVdkTkZ4N0dVdnQxYQo5KzZzMHo2NEpHeVFBdmtBcWhVQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFEbWs1NEYzZ1BqOS91NzlRbTg2V1Mzc
k5YaFoKZG16Wmt3TXRDajRuTXdsSndGQy9iZUU4ZUdsWnFxWDcrdEpYUDVaY0xLNE1pSnM1U2JTMjd5NDF3WTRRTFFWaQpVWmRocEFHUTBOSlpHSGhWMTVDczlVQTA1ZTFNajNCaHZ6SG5VV2t1ZUhYbW84VmI4SkI5RGloeGdiUW5GY2FQCjRWcVhWY0pBemxVQ0V5aXhreVRGendZTklJbzJHdGtCdlI1YkxCM0doT2R
sQURmQzEwdzgvTmQveFFmRnRWdmYKL3lHaktpbW8rT2xERkV5YittcHVKMVdiN3Y3bnJJSzlSSy9WbVhUWENiOWZLQ3BmQ0hMU0hpa0lEWklZK0wxTQpwbWpXYXZFcjFLSlE5UEJIYmdZSHkxK1F0bkpXRDNjNnJrOUtoNU1zMFhTVmpBc2Z1RWdXaG9CYnlVdz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=\n   
 server: https://k8s.oz.noris.de:6443\n  name: \"\"\ncontexts: []\ncurrent-context: \"\"\nkind: Config\npreferences: {}\nusers: []\n"}}
[discovery] Cluster info signature and contents are valid and no TLS pinning was specified, will use API Server "k8s.oz.noris.de:6443"
[discovery] Successfully established connection with API Server "mycluster.example.com:6443"
I1107 12:57:01.509945    3631 join.go:260] [join] writing bootstrap kubelet config file at /etc/kubernetes/bootstrap-kubelet.conf
I1107 12:57:01.617006    3631 loader.go:359] Config loaded from file /etc/kubernetes/bootstrap-kubelet.conf
I1107 12:57:01.617871    3631 join.go:283] Stopping the kubelet
[kubelet] Downloading configuration for the kubelet from the "kubelet-config-1.12" ConfigMap in the kube-system namespace
I1107 12:57:01.627838    3631 round_trippers.go:386] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubeadm/v1.11.4 (linux/amd64) kubernetes/bf9a868" -H "Authorization: Bearer 36etul.nv5lz6hjfifdd4c9" 'https://mycluster.example.com:6443/api/v1/namespaces/kube-system/configmaps/kubelet-config-1.12'
I1107 12:57:01.639396    3631 round_trippers.go:405] GET https://mycluster.example.com:6443/api/v1/namespaces/kube-system/configmaps/kubelet-config-1.12 403 Forbidden in 11 milliseconds
I1107 12:57:01.639427    3631 round_trippers.go:411] Response Headers:
I1107 12:57:01.639443    3631 round_trippers.go:414]     Content-Length: 311
I1107 12:57:01.639464    3631 round_trippers.go:414]     Date: Wed, 07 Nov 2018 12:57:01 GMT
I1107 12:57:01.639477    3631 round_trippers.go:414]     Content-Type: application/json
I1107 12:57:01.639492    3631 round_trippers.go:414]     X-Content-Type-Options: nosniff
I1107 12:57:01.639525    3631 request.go:942] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps \"kubelet-config-1.12\" is forbidden: User \"system:bootstrap:36etul\" cannot get confi
gmaps in the namespace \"kube-system\"","reason":"Forbidden","details":{"name":"kubelet-config-1.12","kind":"configmaps"},"code":403}
configmaps "kubelet-config-1.12" is forbidden: User "system:bootstrap:36etul" cannot get configmaps in the namespace "kube-system"

์ด์ƒํ•œ ๋ฌผ๊ฑด์„ ๋ณด์…จ๋‚˜์š”?

๋ถ„๋ช…ํžˆ kubelet์˜ ๋ฒ„์ „์„ ํ™•์ธํ•˜๋ฉด ๋ชจ๋“  ๊ฒƒ์ด ๋งŒ๋“ค์–ด์ง‘๋‹ˆ๋‹ค! kubelet ๋ฒ„์ „ 1.12.2๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
์ฝ”๋“œ์—์„œ ํžŒํŠธ๋ฅผ ์–ป์—ˆ์Šต๋‹ˆ๋‹ค.

ํ•˜๋‚˜์˜ ์ตœ์‹  ๋ฒ„์ „์„ ์ œ์™ธํ•˜๊ณ  ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

๋งˆ์Šคํ„ฐ์—์„œ :

$ lsb_release -d
Description:    Ubuntu 16.04.5 LTS
$ dpkg -l | grep kub
ii  kubeadm                          1.12.1-00                                  amd64        Kubernetes Cluster Bootstrapping Tool
ii  kubectl                          1.12.1-00                                  amd64        Kubernetes Command Line Tool
ii  kubelet                          1.12.1-00                                  amd64        Kubernetes Node Agent
ii  kubernetes-cni                   0.6.0-00                                   amd64        Kubernetes CNI
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:46:06Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T20:56:12Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}

๊ทธ ์„œ๋ฒ„ ๋ฒ„์ „ 1.13.0์€ ์–ด๋””์—์„œ ์™”์Šต๋‹ˆ๊นŒ? ๋‚˜๋Š” ๊ทธ๊ฒƒ์„ ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๋‹ค.

์–ด์จŒ๋“ ์ด VM์—์„œ kubeadm init๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์ „์— ๋ณต์ œ ํ–ˆ์œผ๋ฏ€๋กœ ํด๋Ÿฌ์Šคํ„ฐ์˜ ๋‹ค๋ฅธ ๋…ธ๋“œ๊ฐ€ ๋  ์ค€๋น„๊ฐ€ ๋œ ๋‹ค๋ฅธ VM์ด ์žˆ์Šต๋‹ˆ๋‹ค. ํด๋ก ์ด๊ธฐ ๋•Œ๋ฌธ์— 1.12.1๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ€์ž…ํ•˜๋ ค๊ณ  ํ•  ๋•Œ :

$ kubeadm join --token blahblah 10.138.0.3:6443 --discovery-token-ca-cert-hash sha256:deadbeefdeadbeefetc 
[preflight] running pre-flight checks
        [WARNING RequiredIPVSKernelModulesAvailable]: the IPVS proxier will not be used, because the following required kernel modules are not loaded: [ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh] or no builtin kernel ipvs support: map[ip_vs_sh:{} nf_conntrack_ipv4:{} ip_vs:{} ip_vs_rr:{} ip_vs_wrr:{}]
you can solve this problem with following methods:
 1. Run 'modprobe -- ' to load missing kernel modules;
2. Provide the missing builtin kernel ipvs support
[discovery] Trying to connect to API Server "10.138.0.3:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://10.138.0.3:6443"
[discovery] Requesting info from "https://10.138.0.3:6443" again to validate TLS against the pinned public key
[discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will 
use API Server "10.138.0.3:6443"
[discovery] Successfully established connection with API Server "10.138.0.3:6443"
[kubelet] Downloading configuration for the kubelet from the "kubelet-config-1.12" ConfigMap in the kube-system namespace configmaps "kubelet-config-1.12" is forbidden: User "system:bootstrap:3ai26q" cannot get resource "configmaps" in API group "" in the namespace "kube-system"

๊ทธ๋ฆฌ๊ณ  ์™œ kubelet-config-1.12 configmap์„ ์–ป์„ ์ˆ˜ ์—†์Šต๋‹ˆ๊นŒ? ํ•˜๋‚˜๋„ ์—†์œผ๋‹ˆ๊นŒ. ๋งˆ์Šคํ„ฐ๋กœ ๋Œ์•„ ๊ฐ€๊ธฐ :

$ sudo kubectl get cm -n kube-system --kubeconfig=/etc/kubernetes/admin.conf
NAME                                 DATA   AGE
calico-config                        4      26m
coredns                              1      29m
extension-apiserver-authentication   6      29m
kube-proxy                           2      29m
kubeadm-config                       2      29m
kubelet-config-1.13                  1      29m

@brianriceca : ๋‹น์‹ ๊ณผ ๋˜‘๊ฐ™์€ ๋ฌธ์ œ์— ์ง๋ฉด ... ์ด์— ๋Œ€ํ•œ ๋ชจ๋“  ํ•ด๊ฒฐ์ฑ… ..

Master : ram @ k8master1 : ~ $ kubeadm ๋ฒ„์ „
kubeadm ๋ฒ„์ „ : & version.Info {Major : "1", Minor : "12", GitVersion : "v1.12.1", GitCommit : "4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState : "clean", BuildDate : "2018-10-05T16 : 43 : 08Z ", GoVersion :"go1.10.4 ", ์ปดํŒŒ์ผ๋Ÿฌ :"gc ", ํ”Œ๋žซํผ :"linux / amd64 "}
ram @ k8master1 : ~ $ dpkg -l | grep kub
ii kubeadm 1.12.1-00 amd64 Kubernetes ํด๋Ÿฌ์Šคํ„ฐ ๋ถ€ํŠธ ์ŠคํŠธ๋žฉ ๋„๊ตฌ
ii kubectl 1.12.1-00 amd64 Kubernetes ๋ช…๋ น ์ค„ ๋„๊ตฌ
ii kubelet 1.12.1-00 amd64 Kubernetes ๋…ธ๋“œ ์—์ด์ „ํŠธ
ii kubernetes-cni 0.6.0-00 amd64 Kubernetes CNI
ram @ k8master1 : ~ $ kubectl ๋ฒ„์ „
ํด๋ผ์ด์–ธํŠธ ๋ฒ„์ „ : version.Info {Major : "1", Minor : "12", GitVersion : "v1.12.1", GitCommit : "4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState : "clean", BuildDate : "2018-10-05T16 : 46 : 06Z ", GoVersion :"go1.10.4 ", ์ปดํŒŒ์ผ๋Ÿฌ :"gc ", ํ”Œ๋žซํผ :"linux / amd64 "}
์„œ๋ฒ„ ๋ฒ„์ „ : version.Info {Major : "1", Minor : "13", GitVersion : "v1.13.0", GitCommit : "ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState : "clean", BuildDate : "2018-12-03T20 : 56 : 12Z ", GoVersion :"go1.11.2 ", ์ปดํŒŒ์ผ๋Ÿฌ :"gc ", ํ”Œ๋žซํผ :"linux / amd64 "}

ram @ k8master1 : ~ $ kubectl ๋…ธ๋“œ ๊ฐ€์ ธ ์˜ค๊ธฐ
์ด๋ฆ„ ์ƒํƒœ ์—ญํ•  ์—ฐ๋ น ๋ฒ„์ „
k8master1.example.com ์ค€๋น„ ๋งˆ์Šคํ„ฐ 101m v1.12.1
ram @ k8master1 : ~ $ kubectl get pods --all-namespaces
๋„ค์ž„ ์ŠคํŽ˜์ด์Šค ์ด๋ฆ„ ์ค€๋น„ ์ƒํƒœ ๋‹ค์‹œ ์‹œ์ž‘ ๋‚˜์ด
kube-system calico-node-r248v 2/2 Running 0 99m
kube-system coredns-869f847d58-72lqd 1/1 Running 0 101m
kube-system coredns-869f847d58-p2zzs 1/1 Running 0 101m
kube-system etcd-k8master1.example.com 1/1 ๋‹ฌ๋ฆฌ๊ธฐ 0 100m
kube-system kube-apiserver-k8master1.example.com 1/1 ๋‹ฌ๋ฆฌ๊ธฐ 0 100m
kube-system kube-controller-manager-k8master1.example.com 1/1 ๋‹ฌ๋ฆฌ๊ธฐ 0 100m
kube-system kube-proxy-77qbx 1/1 Running 0 101m
kube-system kube-scheduler-k8master1.example.com 1/1 ๋‹ฌ๋ฆฌ๊ธฐ 0 100m

์ž‘์—…์ž ๋…ธ๋“œ :
root @ k8worker1 : ~ # dpkg -l | grep -i kub
ii kubeadm 1.12.1-00 amd64 Kubernetes ํด๋Ÿฌ์Šคํ„ฐ ๋ถ€ํŠธ ์ŠคํŠธ๋žฉ ๋„๊ตฌ
ii kubectl 1.12.1-00 amd64 Kubernetes ๋ช…๋ น ์ค„ ๋„๊ตฌ
ii kubelet 1.12.1-00 amd64 Kubernetes ๋…ธ๋“œ ์—์ด์ „ํŠธ
ii kubernetes-cni 0.6.0-00 amd64 Kubernetes CNI
root @ k8worker1 : ~ # kubectl ๋ฒ„์ „
ํด๋ผ์ด์–ธํŠธ ๋ฒ„์ „ : version.Info {Major : "1", Minor : "12", GitVersion : "v1.12.1", GitCommit : "4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState : "clean", BuildDate : "2018-10-05T16 : 46 : 06Z ", GoVersion :"go1.10.4 ", ์ปดํŒŒ์ผ๋Ÿฌ :"gc ", ํ”Œ๋žซํผ :"linux / amd64 "}
์„œ๋ฒ„ localhost : 8080 ์— ๋Œ€ํ•œ ์—ฐ๊ฒฐ์ด ๊ฑฐ๋ถ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์˜ฌ๋ฐ”๋ฅธ ํ˜ธ์ŠคํŠธ ๋˜๋Š” ํฌํŠธ๋ฅผ ์ง€์ • ํ–ˆ์Šต๋‹ˆ๊นŒ?

root @ k8worker1 : ~ # kubeadm join 10.0.0.61:6443 --token xjxgqa.h2vnld3x9ztgf3pr --discovery-token-ca-cert-hash sha256 : 7c18b654b623ee84164bb0dfa79409c821398f1a968843446af525ec72e0fdad
[ํ”„๋ฆฌ ํ”Œ๋ผ์ดํŠธ] ํ”„๋ฆฌ ํ”Œ๋ผ์ดํŠธ ๊ฒ€์‚ฌ ์‹คํ–‰
[๊ฒฝ๊ณ  ํ•„์ˆ˜ IPVSKernelModulesAvailable] : ๋‹ค์Œ ํ•„์ˆ˜ ์ปค๋„ ๋ชจ๋“ˆ์ด๋กœ๋“œ๋˜์ง€ ์•Š์•˜์œผ๋ฏ€๋กœ IPVS ํ”„๋ก์‹œ๊ฐ€ ์‚ฌ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. [ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh] ๋˜๋Š” ๋‚ด์žฅ ์ปค๋„ ipvs ์ง€์› ์—†์Œ : map [nf_conntrack_iprrv4 : {} ip_vs : {} ip_vs : {} ip_vs_wrr : {} ip_vs_sh : {}]
๋‹ค์Œ ๋ฐฉ๋ฒ•์œผ๋กœ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  1. ๋ˆ„๋ฝ ๋œ ์ปค๋„ ๋ชจ๋“ˆ์„๋กœ๋“œํ•˜๋ ค๋ฉด 'modprobe-'๋ฅผ ์‹คํ–‰ํ•˜์‹ญ์‹œ์˜ค.

    1. ๋ˆ„๋ฝ ๋œ ๋‚ด์žฅ ์ปค๋„ ipvs ์ง€์› ์ œ๊ณต

[๋ฐœ๊ฒฌ] API ์„œ๋ฒ„ "10.0.0.61:6443"์— ์ ‘์† ์‹œ๋„ ์ค‘
[๊ฒ€์ƒ‰] ํด๋Ÿฌ์Šคํ„ฐ ์ •๋ณด ๊ฒ€์ƒ‰ ํด๋ผ์ด์–ธํŠธ ์ƒ์„ฑ, " https://10.0.0.61 : 6443"์—์„œ ์ •๋ณด ์š”์ฒญ
[๋ฐœ๊ฒฌ] ๊ณ ์ • ๋œ ๊ณต๊ฐœ ํ‚ค์— ๋Œ€ํ•ด TLS์˜ ์œ ํšจ์„ฑ์„ ๊ฒ€์‚ฌํ•˜๊ธฐ ์œ„ํ•ด " https://10.0.0.61 : 6443"์—์„œ ๋‹ค์‹œ ์ •๋ณด ์š”์ฒญ
[๋ฐœ๊ฒฌ] ํด๋Ÿฌ์Šคํ„ฐ ์ •๋ณด ์„œ๋ช… ๋ฐ ์ฝ˜ํ…์ธ ๊ฐ€ ์œ ํšจํ•˜๋ฉฐ TLS ์ธ์ฆ์„œ๊ฐ€ ๊ณ ์ • ๋œ ๋ฃจํŠธ์— ๋Œ€ํ•ด ์œ ํšจ์„ฑ์„ ๊ฒ€์‚ฌํ•˜๊ณ  API ์„œ๋ฒ„ "10.0.0.61:6443"์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
[๋ฐœ๊ฒฌ] API ์„œ๋ฒ„ "10.0.0.61:6443"๊ณผ ์„ฑ๊ณต์ ์œผ๋กœ ์—ฐ๊ฒฐ
[kubelet] kube-system ๋„ค์ž„ ์ŠคํŽ˜์ด์Šค์˜ "kubelet-config-1.12"ConfigMap์—์„œ kubelet ๊ตฌ์„ฑ ๋‹ค์šด๋กœ๋“œ
configmaps "kubelet-config-1.12"๋Š” ๊ธˆ์ง€๋จ : ์‚ฌ์šฉ์ž " system : bootstrap : xjxgqa"๋Š” ๋„ค์ž„ ์ŠคํŽ˜์ด์Šค "kube-system"์˜ API ๊ทธ๋ฃน ""์—์„œ "configmaps"๋ฆฌ์†Œ์Šค๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
root @ k8worker1 : ~ # kubeadm join 10.0.0.61:6443 --token xjxgqa.h2vnld3x9ztgf3pr --discovery-token-ca-cert-hash sha256 : 7c18b654b623ee84164bb0dfa79409c821398f1a968843446af525ec72e0fdad
[ํ”„๋ฆฌ ํ”Œ๋ผ์ดํŠธ] ํ”„๋ฆฌ ํ”Œ๋ผ์ดํŠธ ๊ฒ€์‚ฌ ์‹คํ–‰
[๊ฒฝ๊ณ  ํ•„์ˆ˜ IPVSKernelModulesAvailable] : ๋‹ค์Œ ํ•„์ˆ˜ ์ปค๋„ ๋ชจ๋“ˆ์ด๋กœ๋“œ๋˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์— IPVS ํ”„๋ก์‹œ๊ฐ€ ์‚ฌ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. [ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh] ๋˜๋Š” ๋‚ด์žฅ ์ปค๋„ ipvs ์ง€์› ์—†์Œ : map [ip_vs_rr : {} ip_vs_rr : {} ip_vs_rr : {} ip_vs_rr : {} nf_conntrack_ipv4 : {} ip_vs : {}]
๋‹ค์Œ ๋ฐฉ๋ฒ•์œผ๋กœ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  1. ๋ˆ„๋ฝ ๋œ ์ปค๋„ ๋ชจ๋“ˆ์„๋กœ๋“œํ•˜๋ ค๋ฉด 'modprobe-'๋ฅผ ์‹คํ–‰ํ•˜์‹ญ์‹œ์˜ค.

    1. ๋ˆ„๋ฝ ๋œ ๋‚ด์žฅ ์ปค๋„ ipvs ์ง€์› ์ œ๊ณต

[ํ”„๋ฆฌ ํ”Œ๋ผ์ดํŠธ] ๋ช‡ ๊ฐ€์ง€ ์น˜๋ช…์ ์ธ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.
[์˜ค๋ฅ˜ FileAvailable--etc-kubernetes-bootstrap-kubelet.conf] : /etc/kubernetes/bootstrap-kubelet.conf๊ฐ€ ์ด๋ฏธ ์žˆ์Šต๋‹ˆ๋‹ค.
[์˜ค๋ฅ˜ FileAvailable--etc-kubernetes-pki-ca.crt] : /etc/kubernetes/pki/ca.crt๊ฐ€ ์ด๋ฏธ ์žˆ์Šต๋‹ˆ๋‹ค.
[ํ”„๋ฆฌ ํ”Œ๋ผ์ดํŠธ] ์ˆ˜ํ–‰์ค‘์ธ ์ž‘์—…์„ ์•Œ๊ณ  ์žˆ๋‹ค๋ฉด --ignore-preflight-errors=... ํ•˜์—ฌ ์น˜๋ช…์ ์ด์ง€ ์•Š์€ ์ˆ˜ํ‘œ๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

@brianriceca ๋ฐ kubelet-config-1.13 ๋งต์ด ์žˆ์œผ๋ฉฐ configmaps "kubelet-config-1.12" is forbidden ๋ฉ๋‹ˆ๋‹ค.

์˜ค! ๋‚ด๊ฐ€ ์•„์ง ๋ชฐ๋ž๋˜ ๊ฒƒ์€ kubeadm์ด ๋‹ฌ๋ฆฌ ์ง€์ •ํ•˜์ง€ ์•Š๋Š” ํ•œ ํ•ญ์ƒ gcr.io์—์„œ Kubernetes ์ œ์–ด ํ”Œ๋ ˆ์ธ์˜ ์ตœ์‹  ๋ฒ„์ „์„ ๋‹ค์šด๋กœ๋“œํ•œ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ 1.13์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ๋„ 1.12.1์„ ์„ค์น˜ํ•˜๋ ค๋ฉด ๋‹ค์Œ์„ ์ˆ˜ํ–‰ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.
kubeadm init --kubernetes-version 1.12.1 --pod-network-cidr _ ๋ฌด์—‡์ด๋“  / ๋ฌด์—‡์ด๋“  _

๋‘ ๋…ธ๋“œ๋ฅผ ๋ชจ๋‘ ์‚ญ์ œํ•˜๊ณ  ๋ชจ๋“  ๋ฒ„์ „ 1.12.2 ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋‹ค์‹œ ์‹œ๋„ํ–ˆ์ง€๋งŒ ์ด๋ฒˆ์—๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ์ตœ์‹  ๋ฒ„์ „์ด ์žˆ๋‹ค๋Š” ์ถœ๋ ฅ์ด ์žˆ์—ˆ์ง€๋งŒ 1.12๋กœ ๋˜๋Œ๋ฆด ๊ฒƒ์ž…๋‹ˆ๋‹ค (์ง€๊ธˆ ์žƒ์–ด ๋ฒ„๋ ธ์Šต๋‹ˆ๋‹ค)

๋‚˜๋Š” (๋ถ„๋ช…ํžˆ) ์‹œ๋”์—์„œ ๋…ธ๋“œ์™€ ๋™์ผํ•œ ๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜๋Š” ๋™์•ˆ ๋™์ผํ•œ ๋ฒ„๊ทธ๋ฅผ ๊ฒช๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์‹œ๋”์—์„œ (์ดˆ๊ธฐํ™” ํ›„) :

$ kubeadm version -o json
{
  "clientVersion": {
    "major": "1",
    "minor": "13",
    "gitVersion": "v1.13.0",
    "gitCommit": "ddf47ac13c1a9483ea035a79cd7c10005ff21a6d",
    "gitTreeState": "clean",
    "buildDate": "2018-12-11T17:03:40Z",
    "goVersion": "go1.11.2",
    "compiler": "gc",
    "platform": "linux/amd64"
  }
}
$
$ kubectl get cm --all-namespaces
NAMESPACE     NAME                                 DATA   AGE
kube-public   cluster-info                         2      174m
kube-system   coredns                              1      174m
kube-system   extension-apiserver-authentication   6      174m
kube-system   flannel-plugin-config-map            2      174m
kube-system   kube-proxy                           2      174m
kube-system   kubeadm-config                       2      174m
kube-system   kubelet-config-1.13                  1      174m
kube-system   kubic-init-config-seeder             1      174m
$
$
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"archive", BuildDate:"2018-12-07T12:00:00Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T20:56:12Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}

๋…ธ๋“œ์—์„œ :

$ cat config.txt 
apiVersion: kubeadm.k8s.io/v1beta1
caCertPath: /etc/kubernetes/pki/ca.crt
discovery:
  bootstrapToken:
    apiServerEndpoint: 192.168.100.1:6443
    token: 94dcda.c271f4ff502789ca
    unsafeSkipCAVerification: true
  timeout: 5m0s
  tlsBootstrapToken: 94dcda.c271f4ff502789ca
kind: JoinConfiguration
nodeRegistration:
  criSocket: /var/run/crio/crio.sock
  kubeletExtraArgs:
    cni-bin-dir: /var/lib/kubelet/cni/bin
    cni-conf-dir: /etc/cni/net.d
    container-runtime-endpoint: unix:///var/run/crio/crio.sock
    network-plugin: cni

$
$ kubeadm join --v=8 --config=config.txt 
I1220 11:55:56.879023       7 join.go:299] [join] found NodeName empty; using OS hostname as NodeName
I1220 11:55:56.880357       7 joinconfiguration.go:72] loading configuration from the given file
[preflight] Running pre-flight checks
I1220 11:55:56.890498       7 join.go:328] [preflight] Running general checks
I1220 11:55:56.891937       7 checks.go:245] validating the existence and emptiness of directory /etc/kubernetes/manifests
I1220 11:55:56.893051       7 checks.go:283] validating the existence of file /etc/kubernetes/kubelet.conf
I1220 11:55:56.894239       7 checks.go:283] validating the existence of file /etc/kubernetes/bootstrap-kubelet.conf
I1220 11:55:56.895384       7 checks.go:104] validating the container runtime
I1220 11:55:57.072517       7 checks.go:373] validating the presence of executable crictl
I1220 11:55:57.073553       7 checks.go:332] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I1220 11:55:57.074479       7 checks.go:332] validating the contents of file /proc/sys/net/ipv4/ip_forward
I1220 11:55:57.075518       7 checks.go:644] validating whether swap is enabled or not
I1220 11:55:57.076499       7 checks.go:373] validating the presence of executable ip
I1220 11:55:57.077424       7 checks.go:373] validating the presence of executable iptables
I1220 11:55:57.078594       7 checks.go:373] validating the presence of executable mount
I1220 11:55:57.079564       7 checks.go:373] validating the presence of executable nsenter
I1220 11:55:57.080425       7 checks.go:373] validating the presence of executable ebtables
I1220 11:55:57.081391       7 checks.go:373] validating the presence of executable ethtool
I1220 11:55:57.082170       7 checks.go:373] validating the presence of executable socat
I1220 11:55:57.084207       7 checks.go:373] validating the presence of executable tc
I1220 11:55:57.085250       7 checks.go:373] validating the presence of executable touch
I1220 11:55:57.086132       7 checks.go:515] running all checks
I1220 11:55:57.137681       7 checks.go:403] checking whether the given node name is reachable using net.LookupHost
I1220 11:55:57.150619       7 checks.go:613] validating kubelet version
I1220 11:55:57.450319       7 checks.go:130] validating if the service is enabled and active
I1220 11:55:57.554984       7 checks.go:208] validating availability of port 10250
I1220 11:55:57.556700       7 checks.go:283] validating the existence of file /etc/kubernetes/pki/ca.crt
I1220 11:55:57.557579       7 checks.go:430] validating if the connectivity type is via proxy or direct
[preflight] Some fatal errors occurred:
    [ERROR FileAvailable--etc-kubernetes-bootstrap-kubelet.conf]: /etc/kubernetes/bootstrap-kubelet.conf already exists
    [ERROR FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
sh-4.4# rm -f /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/pki/ca.crt
sh-4.4# kubeadm join --v=8 --config=config.txt 
I1220 11:56:10.073469      30 join.go:299] [join] found NodeName empty; using OS hostname as NodeName
I1220 11:56:10.074575      30 joinconfiguration.go:72] loading configuration from the given file
[preflight] Running pre-flight checks
I1220 11:56:10.085937      30 join.go:328] [preflight] Running general checks
I1220 11:56:10.086871      30 checks.go:245] validating the existence and emptiness of directory /etc/kubernetes/manifests
I1220 11:56:10.087809      30 checks.go:283] validating the existence of file /etc/kubernetes/kubelet.conf
I1220 11:56:10.088573      30 checks.go:283] validating the existence of file /etc/kubernetes/bootstrap-kubelet.conf
I1220 11:56:10.089370      30 checks.go:104] validating the container runtime
I1220 11:56:10.126939      30 checks.go:373] validating the presence of executable crictl
I1220 11:56:10.128075      30 checks.go:332] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I1220 11:56:10.129096      30 checks.go:332] validating the contents of file /proc/sys/net/ipv4/ip_forward
I1220 11:56:10.129993      30 checks.go:644] validating whether swap is enabled or not
I1220 11:56:10.131006      30 checks.go:373] validating the presence of executable ip
I1220 11:56:10.132983      30 checks.go:373] validating the presence of executable iptables
I1220 11:56:10.139740      30 checks.go:373] validating the presence of executable mount
I1220 11:56:10.140267      30 checks.go:373] validating the presence of executable nsenter
I1220 11:56:10.140738      30 checks.go:373] validating the presence of executable ebtables
I1220 11:56:10.141092      30 checks.go:373] validating the presence of executable ethtool
I1220 11:56:10.141459      30 checks.go:373] validating the presence of executable socat
I1220 11:56:10.142799      30 checks.go:373] validating the presence of executable tc
I1220 11:56:10.145062      30 checks.go:373] validating the presence of executable touch
I1220 11:56:10.145954      30 checks.go:515] running all checks
I1220 11:56:10.189173      30 checks.go:403] checking whether the given node name is reachable using net.LookupHost
I1220 11:56:10.204103      30 checks.go:613] validating kubelet version
I1220 11:56:10.529594      30 checks.go:130] validating if the service is enabled and active
I1220 11:56:10.556043      30 checks.go:208] validating availability of port 10250
I1220 11:56:10.557915      30 checks.go:283] validating the existence of file /etc/kubernetes/pki/ca.crt
I1220 11:56:10.559380      30 checks.go:430] validating if the connectivity type is via proxy or direct
I1220 11:56:10.560242      30 join.go:334] [preflight] Fetching init configuration
I1220 11:56:10.561013      30 join.go:601] [join] Discovering cluster-info
[discovery] Trying to connect to API Server "192.168.100.1:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://192.168.100.1:6443"
I1220 11:56:10.567171      30 round_trippers.go:383] GET https://192.168.100.1:6443/api/v1/namespaces/kube-public/configmaps/cluster-info
I1220 11:56:10.568131      30 round_trippers.go:390] Request Headers:
I1220 11:56:10.568891      30 round_trippers.go:393]     Accept: application/json, */*
I1220 11:56:10.569609      30 round_trippers.go:393]     User-Agent: kubeadm/v1.13.0 (linux/amd64) kubernetes/ddf47ac
I1220 11:56:10.586461      30 round_trippers.go:408] Response Status: 200 OK in 16 milliseconds
I1220 11:56:10.587241      30 round_trippers.go:411] Response Headers:
I1220 11:56:10.588006      30 round_trippers.go:414]     Content-Type: application/json
I1220 11:56:10.588757      30 round_trippers.go:414]     Content-Length: 1991
I1220 11:56:10.589497      30 round_trippers.go:414]     Date: Thu, 20 Dec 2018 11:56:11 GMT
I1220 11:56:10.590141      30 request.go:942] Response Body: {"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"cluster-info","namespace":"kube-public","selfLink":"/api/v1/namespaces/kube-public/configmaps/cluster-info","uid":"c8b93b6b-0436-11e9-b4e4-4845202d6379","resourceVersion":"368","creationTimestamp":"2018-12-20T09:08:15Z"},"data":{"jws-kubeconfig-94dcda":"eyJhbGciOiJIUzI1NiIsImtpZCI6Ijk0ZGNkYSJ9..qJePAaUQp5APwTC-dSSzvL3MEVE8PQxgbvipbsC1faA","kubeconfig":"apiVersion: v1\nclusters:\n- cluster:\n    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFNE1USXlNREE1TURjMU0xb1hEVEk0TVRJeE56QTVNRGMxTTFvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTkF3CmRET2tVSXI4M3BDMkY2bFE2UFZMYzlMbGhtenNnc3NPMWRQZWhVWTZ0azJwNUZIdmRlNEwwdkVNWHpaZU5oSGUKNFNnd1A1cTMxd1F0Wkx3aEFKWDRDR1dzNGVFZG9LNnZqMDVJYzQ1SDZhMDNvN3RqSWhNcUsvTHVrdDAzR2Q1Lwp0OENXUllHYjV5TWtBNldIMkxDZkwvSXlYQWU1NTV0STR1RTRuTTFSUXNSMFNMdy8rR2FK [truncated 967 chars]
[discovery] Cluster info signature and contents are valid and no TLS pinning was specified, will use API Server "192.168.100.1:6443"
[discovery] Successfully established connection with API Server "192.168.100.1:6443"
I1220 11:56:10.596836      30 join.go:608] [join] Retrieving KubeConfig objects
[join] Reading configuration from the cluster...
[join] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
I1220 11:56:10.600835      30 round_trippers.go:383] GET https://192.168.100.1:6443/api/v1/namespaces/kube-system/configmaps/kubeadm-config
I1220 11:56:10.601554      30 round_trippers.go:390] Request Headers:
I1220 11:56:10.602287      30 round_trippers.go:393]     User-Agent: kubeadm/v1.13.0 (linux/amd64) kubernetes/ddf47ac
I1220 11:56:10.603124      30 round_trippers.go:393]     Accept: application/json, */*
I1220 11:56:10.603831      30 round_trippers.go:393]     Authorization: Bearer 94dcda.c271f4ff502789ca
I1220 11:56:10.633321      30 round_trippers.go:408] Response Status: 200 OK in 28 milliseconds
I1220 11:56:10.634283      30 round_trippers.go:411] Response Headers:
I1220 11:56:10.635127      30 round_trippers.go:414]     Date: Thu, 20 Dec 2018 11:56:11 GMT
I1220 11:56:10.635912      30 round_trippers.go:414]     Content-Type: application/json
I1220 11:56:10.636635      30 round_trippers.go:414]     Content-Length: 1316
I1220 11:56:10.637413      30 request.go:942] Response Body: {"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"kubeadm-config","namespace":"kube-system","selfLink":"/api/v1/namespaces/kube-system/configmaps/kubeadm-config","uid":"c8069fb3-0436-11e9-b4e4-4845202d6379","resourceVersion":"173","creationTimestamp":"2018-12-20T09:08:14Z"},"data":{"ClusterConfiguration":"apiServer:\n  certSANs:\n  - 192.168.100.1\n  extraArgs:\n    authorization-mode: Node,RBAC\n    oidc-ca-file: /etc/kubernetes/pki/ca.crt\n    oidc-client-id: kubernetes\n    oidc-groups-claim: group\n    oidc-issuer-url: https://192.168.0.154:32000\n    oidc-username-claim: email\n  timeoutForControlPlane: 4m0s\napiVersion: kubeadm.k8s.io/v1beta1\ncertificatesDir: /etc/kubernetes/pki\nclusterName: kubernetes\ncontrolPlaneEndpoint: \"\"\ncontrollerManager: {}\ndns:\n  type: CoreDNS\netcd:\n  local:\n    dataDir: /var/lib/etcd\n    imageRepository: registry.opensuse.org/devel/kubic/containers/container/kubic\n    imageTag: \"3.3\"\nimageRepository: k8s.gcr.io\nkind: ClusterConfiguration\nkubernetesVer [truncated 292 chars]
I1220 11:56:10.643565      30 round_trippers.go:383] GET https://192.168.100.1:6443/api/v1/namespaces/kube-system/configmaps/kube-proxy
I1220 11:56:10.644430      30 round_trippers.go:390] Request Headers:
I1220 11:56:10.645126      30 round_trippers.go:393]     Accept: application/json, */*
I1220 11:56:10.645791      30 round_trippers.go:393]     User-Agent: kubeadm/v1.13.0 (linux/amd64) kubernetes/ddf47ac
I1220 11:56:10.646455      30 round_trippers.go:393]     Authorization: Bearer 94dcda.c271f4ff502789ca
I1220 11:56:10.654053      30 round_trippers.go:408] Response Status: 200 OK in 6 milliseconds
I1220 11:56:10.655099      30 round_trippers.go:411] Response Headers:
I1220 11:56:10.655921      30 round_trippers.go:414]     Content-Type: application/json
I1220 11:56:10.656796      30 round_trippers.go:414]     Content-Length: 1655
I1220 11:56:10.657597      30 round_trippers.go:414]     Date: Thu, 20 Dec 2018 11:56:11 GMT
I1220 11:56:10.658883      30 request.go:942] Response Body: {"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"kube-proxy","namespace":"kube-system","selfLink":"/api/v1/namespaces/kube-system/configmaps/kube-proxy","uid":"c8de0370-0436-11e9-b4e4-4845202d6379","resourceVersion":"229","creationTimestamp":"2018-12-20T09:08:15Z","labels":{"app":"kube-proxy"}},"data":{"config.conf":"apiVersion: kubeproxy.config.k8s.io/v1alpha1\nbindAddress: 0.0.0.0\nclientConnection:\n  acceptContentTypes: \"\"\n  burst: 10\n  contentType: application/vnd.kubernetes.protobuf\n  kubeconfig: /var/lib/kube-proxy/kubeconfig.conf\n  qps: 5\nclusterCIDR: 172.16.0.0/13\nconfigSyncPeriod: 15m0s\nconntrack:\n  max: null\n  maxPerCore: 32768\n  min: 131072\n  tcpCloseWaitTimeout: 1h0m0s\n  tcpEstablishedTimeout: 24h0m0s\nenableProfiling: false\nhealthzBindAddress: 0.0.0.0:10256\nhostnameOverride: \"\"\niptables:\n  masqueradeAll: false\n  masqueradeBit: 14\n  minSyncPeriod: 0s\n  syncPeriod: 30s\nipvs:\n  excludeCIDRs: null\n  minSyncPeriod: 0s\n  scheduler: \"\"\n  syncPeriod: 30s\nkind: Kub [truncated 631 chars]
I1220 11:56:10.664746      30 round_trippers.go:383] GET https://192.168.100.1:6443/api/v1/namespaces/kube-system/configmaps/kubelet-config-1.13
I1220 11:56:10.665883      30 round_trippers.go:390] Request Headers:
I1220 11:56:10.666731      30 round_trippers.go:393]     User-Agent: kubeadm/v1.13.0 (linux/amd64) kubernetes/ddf47ac
I1220 11:56:10.667616      30 round_trippers.go:393]     Authorization: Bearer 94dcda.c271f4ff502789ca
I1220 11:56:10.668451      30 round_trippers.go:393]     Accept: application/json, */*
I1220 11:56:10.676896      30 round_trippers.go:408] Response Status: 200 OK in 7 milliseconds
I1220 11:56:10.677820      30 round_trippers.go:411] Response Headers:
I1220 11:56:10.680010      30 round_trippers.go:414]     Content-Type: application/json
I1220 11:56:10.681115      30 round_trippers.go:414]     Content-Length: 2134
I1220 11:56:10.682015      30 round_trippers.go:414]     Date: Thu, 20 Dec 2018 11:56:11 GMT
I1220 11:56:10.683204      30 request.go:942] Response Body: {"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"kubelet-config-1.13","namespace":"kube-system","selfLink":"/api/v1/namespaces/kube-system/configmaps/kubelet-config-1.13","uid":"c80c1601-0436-11e9-b4e4-4845202d6379","resourceVersion":"176","creationTimestamp":"2018-12-20T09:08:14Z"},"data":{"kubelet":"address: 0.0.0.0\napiVersion: kubelet.config.k8s.io/v1beta1\nauthentication:\n  anonymous:\n    enabled: false\n  webhook:\n    cacheTTL: 2m0s\n    enabled: true\n  x509:\n    clientCAFile: /etc/kubernetes/pki/ca.crt\nauthorization:\n  mode: Webhook\n  webhook:\n    cacheAuthorizedTTL: 5m0s\n    cacheUnauthorizedTTL: 30s\ncgroupDriver: cgroupfs\ncgroupsPerQOS: true\nclusterDNS:\n- 172.24.0.10\nclusterDomain: cluster.local\nconfigMapAndSecretChangeDetectionStrategy: Watch\ncontainerLogMaxFiles: 5\ncontainerLogMaxSize: 10Mi\ncontentType: application/vnd.kubernetes.protobuf\ncpuCFSQuota: true\ncpuCFSQuotaPeriod: 100ms\ncpuManagerPolicy: none\ncpuManagerReconcilePeriod: 10s\nenableControllerAttachDetach: tr [truncated 1110 chars]
I1220 11:56:10.688139      30 interface.go:384] Looking for default routes with IPv4 addresses
I1220 11:56:10.688797      30 interface.go:389] Default route transits interface "eth0"
I1220 11:56:10.689612      30 interface.go:196] Interface eth0 is up
I1220 11:56:10.690375      30 interface.go:244] Interface "eth0" has 2 addresses :[192.168.100.220/24 fe80::d0a8:62ff:fe54:b6e9/64].
I1220 11:56:10.690995      30 interface.go:211] Checking addr  192.168.100.220/24.
I1220 11:56:10.691796      30 interface.go:218] IP found 192.168.100.220
I1220 11:56:10.692489      30 interface.go:250] Found valid IPv4 address 192.168.100.220 for interface "eth0".
I1220 11:56:10.693168      30 interface.go:395] Found active IP 192.168.100.220 
I1220 11:56:10.694393      30 join.go:341] [preflight] Running configuration dependant checks
I1220 11:56:10.695211      30 join.go:478] [join] writing bootstrap kubelet config file at /etc/kubernetes/bootstrap-kubelet.conf
I1220 11:56:10.942159      30 loader.go:359] Config loaded from file /etc/kubernetes/bootstrap-kubelet.conf
I1220 11:56:10.943961      30 join.go:503] Stopping the kubelet
[kubelet] Downloading configuration for the kubelet from the "kubelet-config-1.12" ConfigMap in the kube-system namespace
I1220 11:56:10.977300      30 round_trippers.go:383] GET https://192.168.100.1:6443/api/v1/namespaces/kube-system/configmaps/kubelet-config-1.12
I1220 11:56:10.978035      30 round_trippers.go:390] Request Headers:
I1220 11:56:10.978844      30 round_trippers.go:393]     User-Agent: kubeadm/v1.13.0 (linux/amd64) kubernetes/ddf47ac
I1220 11:56:10.979502      30 round_trippers.go:393]     Accept: application/json, */*
I1220 11:56:10.980081      30 round_trippers.go:393]     Authorization: Bearer 94dcda.c271f4ff502789ca
I1220 11:56:10.983223      30 round_trippers.go:408] Response Status: 403 Forbidden in 2 milliseconds
I1220 11:56:10.984240      30 round_trippers.go:411] Response Headers:
I1220 11:56:10.985065      30 round_trippers.go:414]     Content-Type: application/json
I1220 11:56:10.985883      30 round_trippers.go:414]     X-Content-Type-Options: nosniff
I1220 11:56:10.987515      30 round_trippers.go:414]     Content-Length: 342
I1220 11:56:10.989207      30 round_trippers.go:414]     Date: Thu, 20 Dec 2018 11:56:11 GMT
I1220 11:56:10.990506      30 request.go:942] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps \"kubelet-config-1.12\" is forbidden: User \"system:bootstrap:94dcda\" cannot get resource \"configmaps\" in API group \"\" in the namespace \"kube-system\"","reason":"Forbidden","details":{"name":"kubelet-config-1.12","kind":"configmaps"},"code":403}
configmaps "kubelet-config-1.12" is forbidden: User "system:bootstrap:94dcda" cannot get resource "configmaps" in API group "" in the namespace "kube-system"
$
$
$ kubeadm version -o json
{
  "clientVersion": {
    "major": "1",
    "minor": "13",
    "gitVersion": "v1.13.0",
    "gitCommit": "ddf47ac13c1a9483ea035a79cd7c10005ff21a6d",
    "gitTreeState": "archive",
    "buildDate": "2018-12-07T12:00:00Z",
    "goVersion": "go1.11.2",
    "compiler": "gc",
    "platform": "linux/amd64"
  }
}

์–ด๋–ค ์ด์œ ๋กœ kubelet-config-1.12 ๋ฅผ ์ฐพ๊ณ ์žˆ๋Š” ๋ฐ˜๋ฉด ์˜ค๋ฅธ์ชฝ ConfigMap์€ kubelet-config-1.13 ์ด์–ด์•ผํ•ฉ๋‹ˆ๋‹ค.

kubelet --version ํ™•์ธ ํ›„ ๋‹ค์Œ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

$ kubelet --version
Kubernetes v1.12.0

configmap ์ด๋ฆ„์ด ์ด๊ฒƒ์—์„œ ํŒŒ์ƒ ๋˜์—ˆ์Šต๋‹ˆ๊นŒ?

@inercia configmap ์ด๋ฆ„์€ kubelet ๋ฒ„์ „์—์„œ ํŒŒ์ƒ๋ฉ๋‹ˆ๋‹ค. ์œ„์˜ ๋‚ด ๋งํฌ๋ฅผ ์ฐธ์กฐํ•˜์‹ญ์‹œ์˜ค.

@ oz123์„ ์„ค๋ช…ํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

์—…๋ฐ์ดํŠธ์— ์–ด๋–ค ์ผ์ด ์ผ์–ด๋‚  ์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด

1) my-distribution-1.13 ๊ฐ€ ํฌํ•จ ๋œ kubeadm-1.13 my-distribution-1.13 ์™€ ํ•จ๊ป˜ ์‹œ๋”๊ฐ€ ์„ค์น˜๋ฉ๋‹ˆ๋‹ค.
2) ์‹œ๋”๊ฐ€ init ialized
3) ๊ทธ ํ›„ ์–ผ๋งˆ ํ›„ ๋™์ผํ•œ ๋ฐฐํฌํŒ์œผ๋กœ ๋…ธ๋“œ๊ฐ€ ์„ค์น˜๋˜๊ณ  kubeadm-1.13 ๋ฐ kubelet-1.13
4) ๊ทธ๋Ÿฌ๋‚˜ ์ผ๋ถ€ ์—…๋ฐ์ดํŠธ๋Š” ์„ค์น˜๊ฐ€ ๋๋‚  ๋•Œ ์ ์šฉ๋˜๊ณ  ์ƒˆ๋กœ์šด kubelet-1.14 ๊ฐ€ ์„ค์น˜๋ฉ๋‹ˆ๋‹ค.
5) kubeadm join ๋Š” 1.14์— ๋Œ€ํ•œ configmap์„ ์ฐพ์œผ๋ ค๊ณ ํ•˜์ง€๋งŒ ๊ฑฐ๊ธฐ์— ์—†์Šต๋‹ˆ๋‹ค ...

์ผ์น˜ํ•˜๋Š” kubeadm ๋ฒ„์ „์œผ๋กœ k8s 1.13.1์„ ์„ค์น˜ํ•˜์ง€๋งŒ kube-proxy์— ๊ฒฉ๋ฆฌ ๋œ์ด ๋ฌธ์ œ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

kubeadm join --config /etc/kubernetes/kubeadm-client.conf --ignore-preflight-errors=all
[preflight] Running pre-flight checks
[discovery] Trying to connect to API Server "xxx.xxx.xxx.xxx:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://xxx.xxx.xxx.xxx:6443"
[discovery] Cluster info signature and contents are valid and no TLS pinning was specified, will use API Server "xxx.xxx.xxx.xxx:6443"
[discovery] Successfully established connection with API Server "xxx.xxx.xxx.xxx:6443"
[join] Reading configuration from the cluster...
[join] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
unable to fetch the kubeadm-config ConfigMap: failed to get component configs: configmaps "kube-proxy" is forbidden: User "system:bootstrap:3tw24k" cannot get resource "configmaps" in API group "" in the namespace "kube-system"

RoleBinding ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ์ˆ˜๋™์œผ๋กœ ์ƒ์„ฑํ•˜๋ฉด ๋…ธ๋“œ์— ๊ฐ€์ž… ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

# on controlplane node
kubectl create rolebinding -n kube-system --role kube-proxy --group system:bootstrappers:kubeadm:default-node-token kubeadm:kube-proxy-bootstrap

# on joining node
...
[join] Reading configuration from the cluster...
[join] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[kubelet] Downloading configuration for the kubelet from the "kubelet-config-1.13" ConfigMap in the kube-system namespace
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Activating the kubelet service
[tlsbootstrap] Waiting for the kubelet to perform the TLS Bootstrap...
[patchnode] Uploading the CRI Socket information "/var/run/dockershim.sock" to the Node API object "ci-pdk1-debug4144-k8sne-1" as an annotation

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the master to see this node join the cluster.

system:bootstrappers:kubeadm:default-node-token ๊ทธ๋ฃน์— ๋Œ€ํ•œ kube-proxy RoleBinding์ด ์ž๋™์œผ๋กœ ์ฑ„์›Œ ์ ธ์•ผํ•ฉ๋‹ˆ๊นŒ? ์—ฌ๊ธฐ์„œ ๋ฌด์Šจ ์ผ์ด ์ผ์–ด๋‚˜๊ณ  ์žˆ๋Š”์ง€ ์•„์‹ญ๋‹ˆ๊นŒ?

ํŽธ์ง‘ : ๋˜ํ•œ ์ฒซ ๋ฒˆ์งธ kubeadm init ์ดํ›„์— ๋ช…์‹œ ์ ์œผ๋กœ kubeadm init phase addon kube-proxy ์‹คํ–‰ํ•˜๋ฉด system:bootstrappers:kubeadm:default-node-token ๋Œ€ํ•œ kube-proxy RoleBinding์ด ์ƒ์„ฑ๋œ๋‹ค๋Š” ์‚ฌ์‹ค์„ ๋ฐœ๊ฒฌํ–ˆ์Šต๋‹ˆ๋‹ค. ์™œ ๋‚ด ์ดˆ๊ธฐ kubeadm init ์—์„œ์ด RoleBinding ์ƒ์„ฑ์„ ๊ฑด๋„ˆ ๋›ฐ๋Š” ์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.

์ด๊ฒƒ์€ ๋‚˜๋ฅผ ์œ„ํ•ด ์ผํ–ˆ์Šต๋‹ˆ๋‹ค.

kubeadm ๋ฐ kubelet์˜ ๋ฒ„์ „์„ ํ™•์‹คํžˆ ํ™•์ธํ•˜๊ณ  ์ด๋Ÿฌํ•œ ํŒจํ‚ค์ง€์˜ ๋™์ผํ•œ ๋ฒ„์ „์ด ๋ชจ๋“  ๋…ธ๋“œ์—์„œ ์‚ฌ์šฉ๋˜๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค. ์„ค์น˜ํ•˜๊ธฐ ์ „์— ํ˜ธ์ŠคํŠธ์—์„œ ๋‹ค์Œ ๋ฒ„์ „์„ "ํ‘œ์‹œํ•˜๊ณ  ์œ ์ง€"ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.

๊ฐ๊ฐ์˜ ํ˜„์žฌ ๋ฒ„์ „์„ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.
kubelet-๋ฒ„์ „

kubeadm ํ™•์ธ
kubeadm ๋ฒ„์ „

๊ทธ๋“ค์ด ๋‹ค๋ฅด๋ฉด ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋“  ๋…ธ๋“œ์— ๋™์ผํ•œ ๋ฒ„์ „์„ ๋‹ค์‹œ ์„ค์น˜ํ•˜๊ณ  ๋‹ค์šด ๊ทธ๋ ˆ์ด๋“œ๋ฅผ ํ—ˆ์šฉํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜ ๋ช…๋ น์˜ ๋‚ด ๋ฒ„์ „์ด ํ˜„์žฌ ์ถœ์‹œ ๋œ ๊ฒƒ๋ณด๋‹ค ์ด์ „ ๋ฒ„์ „ ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฒ„์ „ ๋ฒˆํ˜ธ๋ฅผ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์ง€๋งŒ์ด ๋ฐฉ๋ฒ•์€ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.
sudo apt-get install -y docker-ce = 18.06.1 ~ ce ~ 3-0 ~ ubuntu kubelet = 1.12.2-00 kubeadm = 1.12.2-00 kubectl = 1.12.2-00 --allow-downgrades

๊ทธ๋Ÿฐ ๋‹ค์Œ ์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ์ž๋™์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ๋˜์ง€ ์•Š๋„๋ก ํ‘œ์‹œํ•˜๊ณ  ๋ˆ„๋ฅด๊ณ  ์žˆ์œผ๋ฉด ์‹œ์Šคํ…œ์ด ์†์ƒ๋ฉ๋‹ˆ๋‹ค.
sudo apt-mark hold docker-ce kubelet kubeadm kubectl

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰