How do I use proxy in microk8s.docker
See original GitHub issueI’m in china, so I can’t access k8s.gcr.io directly, and I use ‘lantern’ as a http/socks proxy to access it.
So when I try to exec command microk8s.enable istio
, the status of istio pod is always ContainerCreating
the output of command kubectl describe
is
Warning FailedScheduling 64s (x3 over 65s) default-scheduler 0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.
Normal Scheduled 59s default-scheduler Successfully assigned istio-system/grafana-6b99c54645-pghj4 to tianyu-virtual-machine
Warning FailedCreatePodSandBox 16s (x2 over 43s) kubelet, tianyu-virtual-machine Failed create pod sandbox: rpc error: code = Unknown desc = failed pulling image "k8s.gcr.io/pause:3.1": Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I followed the article: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy And now I can pull images via default docker(not microk8s.docker):
tianyu@tianyu-virtual-machine:~$ docker pull k8s.gcr.io/kube-apiserver:v1.13.3
v1.13.3: Pulling from kube-apiserver
Digest: sha256:cdb80dc78f3c25267229012a33800b8b203e8e8b9fa59f9fe93e156cc859f89c
Status: Image is up to date for k8s.gcr.io/kube-apiserver:v1.13.3
But when I try to pull image via microk8s.docker, the output is:
tianyu@tianyu-virtual-machine:~$ microk8s.docker pull k8s.gcr.io/kube-apiserver:v1.13.3
[sudo] password for tianyu:
Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
How do I use proxy in microk8s.docker? or Can microk8s use default docker(not microk8s.docker)? or can I share the images between docker and microk8s.docker?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Installing behind a proxy - MicroK8s
Configuring the proxy environment variables. MicroK8s packages a number of utilities (eg curl, helm) that may need to fetch resources from the internet....
Read more >How do I use proxy in microk8s.docker · Issue #344 - GitHub
I'm in china, so I can't access k8s.gcr.io directly, and I use 'lantern' as a http/socks proxy to access it. So when I...
Read more >Running microk8s behind proxy - Developer Diary
So we need to configure the daemon to bun with proper environment variables, rather then passing them via command line (as in apt...
Read more >How-to: Proxy and Load Balance your MicroK8s ... - YouTube
In this video, you will learn how to use two very cool MicroK8s networking addons ... governance, and management in Docker and Kubernetes....
Read more >Proxy and Load Balance your MicroK8s services ... - Portainer
Login to Portainer and select the endpoint where the MicroK8s were enabled: · On the left hand side menu select Cluster -> Setup:...
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
Ah I see, microk8s uses
containerd
on my system. The right file to edit is/var/snap/microk8s/current/args/containerd-env
.Hi @15050050972
Did you follow the proxy setup instructions in https://github.com/ubuntu/microk8s#deploy-behind-a-proxy ?
You will need to edit
/var/snap/microks8/current/args/dockerd-env
and restart MicroK8s (or just the dockerd shipped with MicroK8s).