-->
  • Recent Articles

    Failed to add a node in Kubernetes Cluster : cluster CA found in cluster-info configmap is invalid

    Failed to add a node in Kubernetes Cluster : cluster CA found in cluster-info configmap is invalid

    Kubernetes

    Error:

    [discovery] Failed to connect to API Server "192.168.2.4:6443": cluster CA found in cluster-info configmap is invalid: public key sha256:11ab9d8e4728650305eaea01fde5128a6868f02d5624806c114df42cef778b5d not pinned

    We faced a situation that we can not add the node to the kubernetes Cluster. When we tried to add we faced above given Error.


    We created the token:

    [root@kubemaster01 ~]# kubeadm token create
    87f3kl.1y21yg3fvp506jds



    We fetched the Public Key:

    [root@kubemaster01 ~]# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'

    03407c81fbecac9b68c430e479c8429f13506c49ca776387f3kl1y21yg3fvp506jds
    You have new mail in /var/spool/mail/root
    [root@kubemaster01 ~]#


    [root@kubeworker01 ~]# kubeadm join 192.168.2.4:6443 --token 87f3kl.1y21yg3fvp506jds --discovery-token-ca-cert-hash sha256:03407c81fbecac9b68c430e479c8429f13506c49ca776387f3kl1y21yg3fvp506jds

    [discovery] Failed to connect to API Server "192.168.2.4:6443": cluster CA found in cluster-info configmap is invalid: public key sha256:11ab9d8e4728650305eaea01fde5128a6868f02d5624806c114df42cef778b5d not pinned

    Solution:


    The Solution is pretty Simple. : replace the hash value of the error prompt with the hash value that was originally obtained.


    [root@kubeworker01 ~]# kubeadm join 192.168.2.4:6443 --token 87f3kl.1y21yg3fvp506jds --discovery-token-ca-cert-hash sha256:11ab9d8e4728650305eaea01fde5128a6868f02d5624806c114df42cef778b5d
    [preflight] running pre-flight checks

    No comments