x509 certificate signed by unknown authority- Kubernetes

后端 未结 5 2255
-上瘾入骨i
-上瘾入骨i 2021-02-19 03:32

I am configuring Kubernetes cluster with 2 nodes in coreos as described in https://coreos.com/kubernetes/docs/latest/getting-started.html without flannel. Both

相关标签:
5条回答
  • 2021-02-19 03:34
    mkdir -p $HOME/.kube   
    sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config   
    sudo chown $(id -u):$(id -g) $HOME/.kube/config
    
    0 讨论(0)
  • 2021-02-19 03:40

    Well, to answer your first question I think you have to do a few things to resolve your problem.

    First, run the command given in this link : kubernetes.io/docs/setup/independent/create-cluster-kubeadm‌​/…

    Complete with those commands :

    • mkdir -p $HOME/.kube
    • sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    • sudo chown $(id -u):$(id -g) $HOME/.kube/config

    This admin.conf should be known to kubectl so as to work properly.

    0 讨论(0)
  • 2021-02-19 03:45

    Please see this as a reference and maybe help you resolve your issue by exporting your certs:

    kops export kubecfg "your cluster-name"
    export KOPS_STATE_STORE=s3://"paste your S3 store"
    

    Hope that will help.

    0 讨论(0)
  • 2021-02-19 03:51

    From [kubernetes][1] official site:

    1. Verify that the $HOME/.kube/config file contains a valid certificate, and regenerate a certificate
    2. Unset the KUBECONFIG environment variable using:

      unset KUBECONFIG

      Or set it to the default KUBECONFIG location:

      export KUBECONFIG=/etc/kubernetes/admin.conf

    3. Another workaround is to overwrite the existing kubeconfig for the “admin” user:

       mkdir $HOME/.kube
       sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
       sudo chown $(id -u):$(id -g) $HOME/.kube/config```
    
    
    **Reference:** [official site link reference][2]
    
    [1]: https://kubernetes.io/
    [2]: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/
    
    0 讨论(0)
  • 2021-02-19 03:56

    The above mentioned regular method does not work. I have tried to use the complete commands for a successful certificate. Please see the commands as follows.

    $ sudo kubeadm reset
    $ sudo swapoff -a 
    
    $ sudo kubeadm init --pod-network-cidr=10.244.10.0/16 --kubernetes- 
      version "1.18.3"
    $ sudo rm -rf /home/cm/.kube
    
    $ mkdir -p $HOME/.kube
    $ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    $ sudo chown $(id -u):$(id -g) $HOME/.kube/config
    
    $ sudo systemctl enable docker.service
    $ sudo service kubelet restart
    
    $ kubectl get nodes
    

    Notes:

    If the port refuses to be connected, please add the following command.

    $ export KUBECONFIG=$HOME/admin.conf
    
    0 讨论(0)
提交回复
热议问题