question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I use proxy in microk8s.docker

See original GitHub issue

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 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:closed
  • Created 5 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
Hubrocommented, Dec 4, 2019

Ah I see, microk8s uses containerd on my system. The right file to edit is /var/snap/microk8s/current/args/containerd-env.

1reaction
ktsakalozoscommented, Mar 4, 2019

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found