kubectl

Downgrade kubectl version to match minikube k8s version

江枫思渺然 提交于 2019-12-05 00:44:56
I started minikube with k8s version 1.5.2 and I would like to downgrade my kubectl so that it is also 1.5.2. Currently when I run kubectl version I get: Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-08-31T19:32:12Z", GoVersion:"go1.9", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.7",

delete kubernetes cluster on docker-for-desktop OSX

心不动则不痛 提交于 2019-12-05 00:37:59
What is the equivalent command for minikube delete in docker-for-desktop on OSX As I understand, minikube creates a VM to host its kubernetes cluster but I do not understand how docker-for-desktop is managing this on OSX. Tear down Kubernetes in Docker for OS X is quite an easy task. Go to Preferences , open Reset tab, and click Reset Kubernetes cluster . All object that have been created with Kubectl before that will be deleted. You can also reset docker VM image ( Reset disk image ) and all settings ( Reset to factory defaults ) or even uninstall Docker. It's really under the hood in the

kubectl behind a proxy

我们两清 提交于 2019-12-05 00:27:12
I have installed a local Kubernetes cluster using minikube following the instructions here . I'm under a corporate proxy. Therefore I have set the http_proxy and https_proxy env vars. Once the cluster is started after minikube start command I also added the value of minikube ip to the no_proxy env var. However still kubectl cannot connect to the cluster. ubuntu@ros-2:~$ kubectl -v=7 get pods I0105 10:31:47.773801 17607 loader.go:354] Config loaded from file /home/ubuntu/.kube/config I0105 10:31:47.775151 17607 round_trippers.go:296] GET https://192.168.42.22:8443/api I0105 10:31:47.778533

Kubernetes Pod fails with CrashLoopBackOff

喜你入骨 提交于 2019-12-04 22:46:52
I 'm Following this guide in order to set up a pod using minikube and pull an image from a private repository hosted at: hub.docker.com When trying to set up a pod to pull the image i see CrashLoopBackoff pod config: apiVersion: v1 kind: Pod metadata: name: private-reg spec: containers: - name: private-reg-container image: ha/prod:latest imagePullSecrets: - name: regsecret output of "get pod" kubectl get pod private-reg NAME READY STATUS RESTARTS AGE private-reg 0/1 CrashLoopBackOff 5 4m As far as i can see there is no issue with the images and if i pull them manually and run them, they works.

How to access the Kubernetes API in Go and run kubectl commands

不问归期 提交于 2019-12-04 19:07:56
I want to access my Kubernetes cluster API in Go to run kubectl command to get available namespaces in my k8s cluster which is running on google cloud. My sole purpose is to get namespaces available in my cluster by running kubectl command: kindly let me know if there is any alternative. You can start with kubernetes/client-go , the Go client for Kubernetes, made for talking to a kubernetes cluster. (not through kubectl though: directly through the Kubernetes API) It includes a NamespaceLister , which helps list Namespaces . See " Building stuff with the Kubernetes API — Using Go " from

How to recycle pods in Kubernetes

和自甴很熟 提交于 2019-12-04 13:20:28
I want my pods to be gracefully recycled from my deployments after certain period of time such as every week or month. I know I can add a cron job for that if I know the Kubernetes command. The question is what is the best approach to do this in Kubernetes. Which command will let me achieve this goal? Thank you very much for helping me out on this. You should be managing your Pods via a higher-level controller like a Deployment or a StatefulSet. If you do, and you change any detail of the embedded pod spec, the Deployment/StatefulSet/... will restart all of your pods for you. Probably the most

kubectl run local docker image- ImagePullBackOff status

。_饼干妹妹 提交于 2019-12-04 11:47:51
i build the docker image on my local machine and trying to pull docker image using kubectl. but its not starting the docker container. images starts with docker command. REPOSITORY TAG IMAGE ID CREATED SIZE tomcat9 latest 8b228ac6f19f About an hour ago 111 MB It stats with ImagePullBackOff massage. $ kubectl get pods NAME READY STATUS RESTARTS AGE tomcat9-511437148-sgkwp 0/1 ImagePullBackOff 0 9m How can I make kubectl to run this docker image? Thanks I see from your comments bellow you are using Minikube locally. Minikube runs inside a virtual machine, the Docker running inside Minikube and

How can I update a secret on Kubernetes when it is generated from a file?

老子叫甜甜 提交于 2019-12-04 07:35:23
问题 I've created a secret using kubectl create secret generic production-tls --from-file=./tls.key --from-file=./tls.crt . If I'd like to update the values - how can I do this? 回答1: This should work: kubectl create secret generic production-tls \ --from-file=./tls.key --from-file=./tls.crt --dry-run -o yaml | kubectl apply -f - 回答2: You can delete and immediately recreate the secret: kubectl delete secret production-tls kubectl create secret generic production-tls --from-file=./tls.key --from

`Error: could not find tiller` when running `helm version`

坚强是说给别人听的谎言 提交于 2019-12-04 06:58:30
问题 I have minikube and kubectl installed: $ minikube version minikube version: v1.4.0 commit: 7969c25a98a018b94ea87d949350f3271e9d64b6 $ kubectl version Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:

Minikube not working in Windows 8

喜欢而已 提交于 2019-12-04 02:49:33
I'm new to Kubernetes. With the help of Kubernetes documentation , I installed minikube (v0.24.1) and kubectl in my Windows machine. VirtualBox(Version 5.1.18) is also installed in my machine. Before starting the minikube , i have executed set HTTP_PROXY=xx.xx.xx:8080 and set NO_PROXY=localhost,127.0.0.0/8,192.0.0.0/8 in Windows command prompt Started minikube by passing Proxy Details : C:\minikube>minikube start --memory 4096 --vm-driver=virtualbox --docker-env http_proxy=xx.xx.xx:8080 --docker-env https_proxy=xx.xx.xx:8080 --docker-env no_proxy=localhost,127.0.0.0/8,192.0.0.0/8 --cache