Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubectl not respecting $KUBECONFIG setting? #10688

Closed
aronchick opened this issue Jul 2, 2015 · 1 comment
Closed

kubectl not respecting $KUBECONFIG setting? #10688

aronchick opened this issue Jul 2, 2015 · 1 comment

Comments

@aronchick
Copy link
Contributor

I'm trying to lean more heavily on using KUBECONFIG instead of the default, but it doesn't seem to be working as an environment variable:

#
$ cluster/kubectl.sh config view --kubeconfig="/Users/me/.kube/gce"
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: REDACTED
    server: https://104.154.55.112
  name: linear-pointer-51831_kubernetes
contexts:
- context:
    cluster: linear-pointer-51831_kubernetes
    user: linear-pointer-51831_kubernetes
  name: linear-pointer-51831_kubernetes
current-context: linear-pointer-51831_kubernetes
kind: Config
preferences: {}
users:
- name: linear-pointer-51831_kubernetes
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
    token: REDACTED
- name: linear-pointer-51831_kubernetes-basic-auth
  user:
    password: <password>
    username: admin

#
$ KUBECONFIG="/Users/me/.kube/gce"

#
$ echo $KUBECONFIG
/Users/me/.kube/gce

#
$ cluster/kubectl.sh config view
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []

#
$ cluster/kubectl.sh get po --kubeconfig="/Users/me/.kube/gce"
NAME                                           READY     REASON    RESTARTS   AGE
fluentd-cloud-logging-kubernetes-minion-4zgf   1/1       Running   0          1d
fluentd-cloud-logging-kubernetes-minion-8w6v   1/1       Running   0          1d
fluentd-cloud-logging-kubernetes-minion-lhom   1/1       Running   0          1d
fluentd-cloud-logging-kubernetes-minion-tr0n   1/1       Running   0          1d
kube-dns-v4-f7mdy                              3/3       Running   0          1d
monitoring-heapster-v4-t2iru                   1/1       Running   0          1d
monitoring-influx-grafana-v1-srtjm             2/2       Running   0          1d

#

Am I doing something wrong?

@aronchick
Copy link
Contributor Author

Sigh. Didn't realize that kubectl started a new shell, and needed to export KUBECONFIG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant