Kubernetes Pod无法启动,在代理后面运行 [英] Kubernetes pods not starting, running behind a proxy
问题描述
我在minikube上运行kubernetes,我在代理后面,所以我在/etc/systemd/system/docker.service.d/http-proxy.conf中为docker设置了env变量(HTTP_PROXY& NO_PROXY) 。
我能够执行docker pull,但是当我运行以下示例时
I am running kubernetes on minikube, I am behind a proxy, so I had set the env variables(HTTP_PROXY & NO_PROXY) for docker in /etc/systemd/system/docker.service.d/http-proxy.conf. I was able to do docker pull but when I run the below example
kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
kubectl expose deployment hello-minikube --type=NodePort
kubectl get pod
pod永远不会启动,并且出现错误
pod never starts and I get the error
desc =无法拉出沙盒图片\ gcr.io/google_containers/pause-amd64:3.0\
docker pull gcr .io / google_containers / echoserver:1.4
正常工作
推荐答案
我能够自己修复它。
我的主机上有Docker,而Minikube中有Docker。在Minukube的
Docker遇到了问题
,我不得不将其SSH到minikube VM中并按照这篇文章
I was able to fix it myself. I had Docker on my host and there is Docker in Minikube. Docker in Minukube had issues I had to ssh into minikube VM and follow this post
无法在代理后面下载Docker镜像
,现在一切正常,
Cannot download Docker images behind a proxy and it all works nows,
应该有更好的方法,在启动minikube时,我已经通过了如下所示的docker env,但没有用
There should be a better way of doing this, on starting minikube i have passed docker env like below, which did not work
minikube start --docker-env HTTP_PROXY=http://xxxx:8080 --docker-env HTTPS_PROXY=http://xxxx:8080
--docker-env NO_PROXY=localhost,127.0.0.0/8,192.0.0.0/8 --extra-config=kubelet.PodInfraContainerImage=myhub/pause:3.0
我已经在Minikube VM中设置了相同的env变量,以使其正常工作
I had set the same env variable inside Minikube VM, to make it work
这篇关于Kubernetes Pod无法启动,在代理后面运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!