config set-context is not working
See original GitHub issueinspection-report-20190204_171917.tar.gz
Please run microk8s.inspect
and attach the generated tarball to this issue.
When I run following command
$ microk8s.kubectl config set-context qqq-staging --kubeconfig="/home/www/admin.conf"
Context "qqq-staging" modified.
and running following does not list created context:
$ microk8s.kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* microk8s microk8s-cluster admin
Am I missing something here, or is it a known issue?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:9 (1 by maintainers)
Top Results From Across the Web
config set-context is not working · Issue #304
When I run following command $ microk8s.kubectl config set-context qqq-staging --kubeconfig="/home/www/admin.conf" Conte...
Read more >Kubernetes context is not set
Yes, Try the following steps to access the kubernetes cluster. This steps assumes that you have your k8s certificates in /etc/kubernetes.
Read more >kubectl config set-context - Kubernetes
Synopsis. Sets a context entry in kubeconfig Specifying a name that already exists will merge new fields on top of existing values for...
Read more >Kubectl Config Set-Context | Tutorial and Best Practices
Kubernetes comes with many tools to help you manage your clusters, including kubectl set-context. In this guide, you'll learn how to use this...
Read more >kubectl config set-context not working
If you want to switch between contexts, you might be thinking of use-context? kubectl config use-context my-context.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @reyou,
Here is what I tried. First I moved the kubeconfig file that you need to access MicroK8s in the default location that is also read/write:
Then I made sure I have a
kubectl
(other than the kubectl you get with microk8s):At this point you should be able to access the MicroK8s cluster with
kubectl
. For example:Adding the context with
kubectl
now works:microk8s.kubectl
uses always the kubeconfig of microk8s stored on a read only location this is why you need a non-microk8skubectl
.OK, I had to follow below;
https://blog.ubuntu.com/2017/01/28/ubuntu-core-how-to-enable-aliases-for-your-snaps-commands