KoB
뭐라도 하자 😎
KoB
📬 kingbj0429@gmail.com
와주신 분들 🙇‍♂️
342,507
오늘
46
어제
1,002
  • 지식 공유 📚 (183)
    • Develop (0)
    • DevOps (3)
      • Kubernetes (3)
    • AWS (4)
      • EC2 (1)
      • EKS (0)
      • S3 (1)
      • EFS (1)
      • Route53 (1)
    • Network (0)
    • 트러블 빵야 (1)
    • 겉핥기 시리즈 (2)
    • ... (173)

최근 댓글

  • 넵 감사합니다 :)
    KoB
  • 안녕하세요 웹 개발중인데 매우 잘 봤습니다. 혹시 제 블로⋯
    DeanLee9
  • 감사합니다 :)
    KoB
  • 글을 쉽고 자세하게 써주셔서 이해가 쏙쏙 되는 것 같아요!⋯
    지원.
  • 감사합니다 :) 재밌을 때가 좋은거 같아요 ㅋㅋㅋㅋㅋ
    KoB

티스토리

Design by hELLO ·
KoB

뭐라도 하자 😎

[K8S]unable to fetch the kubeadm-config ConfigMap: failed to get config map: UnauthorizedTo see the stack trace of this error execute with --v=5 or higher 에러
...

[K8S]unable to fetch the kubeadm-config ConfigMap: failed to get config map: UnauthorizedTo see the stack trace of this error execute with --v=5 or higher 에러

2021. 11. 23. 00:11
반응형

 

만약 kubeadm을 통해 master에 node join을 시도할 경우 아래와 같이 오류가 난다면

ubuntu@node:~$ sudo kubeadm join 192.168.241.92:6443 --token 4rlhh1.4dehcs172qy9enyj --discovery-token-ca-cert-hash sha256:b5347bb4959f63e6100142700db4b7d69ea0d860c332265a1748cef29698f814
[preflight] Running pre-flight checks
	[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Unauthorized
To see the stack trace of this error execute with --v=5 or higher

 

 master의 token이 expire되었을 가능성이 높다.

ubuntu@master:~$ sudo kubeadm token list
[sudo] password for ubuntu: 
TOKEN                     TTL         EXPIRES                USAGES                   DESCRIPTION                                                EXTRA GROUPS
4rlhh1.4dehcs172qy9enyj   <invalid>   2021-03-08T04:42:08Z   authentication,signing   The default bootstrap token generated by 'kubeadm init'.   system:bootstrappers:kubeadm:default-node-token

 

TTL이 invalid 되어있는 것을 확인 가능하다.

token을 새롭게 발행하자.

ubuntu@master:~$ sudo kubeadm token create
qigsyn.hkxhfwyks4sohiem

 

list를 확인해 보면 23시간동안 token사용 가능함을 확인 할 수 있다.

ubuntu@master:~$ sudo kubeadm token list
TOKEN                     TTL         EXPIRES                USAGES                   DESCRIPTION                                                EXTRA GROUPS
4rlhh1.4dehcs172qy9enyj   <invalid>   2021-03-08T04:42:08Z   authentication,signing   The default bootstrap token generated by 'kubeadm init'.   system:bootstrappers:kubeadm:default-node-token
qigsyn.hkxhfwyks4sohiem   23h         2021-03-09T12:49:20Z   authentication,signing   <none>                                                     system:bootstrappers:kubeadm:default-node-token

 

node에서 token을 변경해서 다시 join을 해주자. 아래와 같이 로그가 나오면 성공한 것이다.

ubuntu@node:~$ sudo kubeadm join 192.168.241.92:6443 --token qigsyn.hkxhfwyks4sohiem --discovery-token-ca-cert-hash sha256:b5347bb4959f63e6100142700db4b7d69ea0d860c332265a1748cef29698f814
[preflight] Running pre-flight checks
	[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[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] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...

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 control-plane to see this node join the cluster.

 

반응형

'...' 카테고리의 다른 글

[Linux] VM을 NFS로 사용하기  (0) 2021.12.08
[K8S] 파일(.yaml)에서 문자열 검색 한 후 그 문자열의 라인 넘버 가져오기  (0) 2021.11.26
[Kubernetes] kubeadm 이용하여 k8s Cluster 배포하기(공식문서 위주)  (0) 2021.11.19
[Network] netstat 명령어를 이용한 라우팅 테이블 확인  (0) 2021.11.17
[Linux] Add Directory to $PATH in Linux  (0) 2021.11.12
    '...' 카테고리의 다른 글
    • [Linux] VM을 NFS로 사용하기
    • [K8S] 파일(.yaml)에서 문자열 검색 한 후 그 문자열의 라인 넘버 가져오기
    • [Kubernetes] kubeadm 이용하여 k8s Cluster 배포하기(공식문서 위주)
    • [Network] netstat 명령어를 이용한 라우팅 테이블 확인
    KoB
    KoB
    Lunit CSG - Backend Engineer 로 일하고 있습니다 👨‍💻
    댓글쓰기

    티스토리툴바