jx: Failed to connect to kubernetes: invalid configuration: no configuration has been provided

Summary

Failed to connect to kubernetes: invalid configuration: no configuration has been provided

Jx version

The output of jx version is:

ubuntu@master:~$ jx version
Failed to connect to kubernetes: invalid configuration: no configuration has been provided
NAME        VERSION
jx          1.3.123
kubectl     v1.10.3
helm client v2.9.1+g20adb27
helm server v2.9.1+g20adb27
git         git version 2.7.4

Kubernetes cluster

What kind of Kubernetes cluster are you using & how did you create it?

run api-server etc. by systemd export KUBECONFIG=$KUBECONFIG:$HOME/.kube/config

ubuntu@master:~$ cat .kube/config 
apiVersion: v1
kind: Config

clusters:
- cluster:
    certificate-authority: /etc/kubernetes/ssl/k8s-root-ca.csr
    server: 10.1.129.8:6443
  name: kubernetes
contexts:
- context:
    cluster: default
    user: kubectl
  name: default
- context:
    cluster: default
    namespace: jx
    user: jx
  name: jx
current-context: default
preferences: {}
users: 
- name: kubectl
  user:
    client-certificate: /etc/kubernetes/ssl/kubelet-client.crt
    client-key: /etc/kubernetes/ssl/kubelet-client.key

Operating system / Environment

ubuntu 16.04

Expected behavior

Actual behavior

CLI:

ubuntu@master:~$ jx version
Failed to connect to kubernetes: invalid configuration: no configuration has been provided
NAME        VERSION
jx          1.3.123
kubectl     v1.10.3
helm client v2.9.1+g20adb27
helm server v2.9.1+g20adb27
git         git version 2.7.4
jubuntu@master:~$ jx compliance run
error: could not create the compliance client: compliance client failed to load the Kubernetes configuration: invalid configuration: no configuration has been provided
ubuntu@master:~$ kubectl cluster-info 
Kubernetes master is running at http://localhost:8080
Elasticsearch is running at http://localhost:8080/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy
Heapster is running at http://localhost:8080/api/v1/namespaces/kube-system/services/heapster/proxy
Kibana is running at http://localhost:8080/api/v1/namespaces/kube-system/services/kibana-logging/proxy
CoreDNS is running at http://localhost:8080/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
monitoring-grafana is running at http://localhost:8080/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
monitoring-influxdb is running at http://localhost:8080/api/v1/namespaces/kube-system/services/monitoring-influxdb/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
ubuntu@master:~$ kubectl config view 
apiVersion: v1
clusters:
- cluster:
    certificate-authority: /etc/kubernetes/ssl/k8s-root-ca.csr
    server: 10.1.129.8:6443
  name: kubernetes
contexts:
- context:
    cluster: default
    user: kubectl
  name: default
- context:
    cluster: default
    namespace: jx
    user: jx
  name: jx
current-context: default
kind: Config
preferences: {}
users:
- name: kubectl
  user:
    client-certificate: /etc/kubernetes/ssl/kubelet-client.crt
    client-key: /etc/kubernetes/ssl/kubelet-client.key

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

echo $KUBECONFIG /etc/kubernetes/admin.conf kubectl get ns W0426 09:51:32.538172 1775 loader.go:223] Config not found: /etc/kubernetes/admin.conf error: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

i to am having this issue cmd = echo $KUBECONFIG results = :/root/.kube/config cmd = kubectl get ns results = W0504 02:12:47.037118 187212 loader.go:223] Config not found: /root/.kube/config error: no configuration has been provided, try setting KUBERNETES_MASTER environment variable much help is appreciated thanks in advance