kubectl unable to connect to server: x509: certificate signed by unknown authority

后端 未结 11 1354
北恋
北恋 2020-12-10 00:39

i\'m getting an error when running kubectl one one machine (windows)

the k8s cluster is running on CentOs 7 kubernetes cluster 1.7 master, worker

Here\'s my

相关标签:
11条回答
  • 2020-12-10 01:29

    I got the same error while running $ kubectl get nodes as a root user. I fixed it by exporting kubelet.conf to environment variable.

    $ export KUBECONFIG=/etc/kubernetes/kubelet.conf
    $ kubectl get nodes
    
    0 讨论(0)
  • 2020-12-10 01:29

    In case of the error you should export all the kubecfg which contains the certs. kops export kubecfg "your cluster-name and export KOPS_STATE_STORE=s3://"paste your S3 store" .

    Now you should be able to access and see the resources of your cluster.

    0 讨论(0)
  • 2020-12-10 01:30

    I my case I resolved this issue copying the kubelet configuration to my home kube config

    cat /etc/kubernetes/kubelet.conf > ~/.kube/config

    0 讨论(0)
  • 2020-12-10 01:34

    On GCP

    check: gcloud version

    -- localMacOS# gcloud version

    Run: --- localMacOS# gcloud container clusters get-credentials 'clusterName' \ --zone=us-'zoneName'

    Get clusterName and zoneName from your console -- here: https://console.cloud.google.com/kubernetes/list?

    ref: .x509 @market place deployments on GCP #Kubernetes

    0 讨论(0)
  • 2020-12-10 01:36

    This was happening because my company's network does not allow self signing certificates through their network. Try switching to a different network

    0 讨论(0)
提交回复
热议问题