3

I have an installation of kubernetes, which contains only helm, kube apps , contanerd.io. Docker is not installed. I have internet-connection only throw proxy. I am trying to pool longhorn containers with help of helm. but it is not working.Export proxy in .bashrc of /root/.bashrc readed, but not used. I am working from root only. Proxy config in bashrc

http_proxy=http://proxy.example.com
https_proxy=http://proxy.example.com
HTTP_PROXY=http://proxy.example.com
HTTPS_PROXY=http://proxy.example.com

All the time i have to write proxy to make command work. Like

 https_proxy=http://proxy.example.com helm install longhorn/longhorn --name longhorn --namespace longhorn-system

But this is not working when everything is installed into the kuber. There are I have an error Failed to pull and image from every longhorn container.

What is wrong with my proxy configuration? How to configure proxy on kubernetes correctly to pool images from the internet?

1
  • after containerd proxy configuration, does k8s pull images on your setup? Commented Oct 19, 2023 at 7:42

1 Answer 1

7

As I understand from your configuration, you didn't configure the containerd runtime proxy settings. Because K8s pull images using containerd runtime. If your PCs are behind the proxy, you should always configure the app settings if it doesn't directly use proxy system settings (e.g. docker, containerd, etc.)

Run on terminal:

sudo mkdir -p /etc/systemd/system/containerd.service.d
sudo touch /etc/systemd/system/containerd.service.d/http-proxy.conf
nano /etc/systemd/system/containerd.service.d/http-proxy.conf

Copy and paste into the http-proxy.conf:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com"
Environment="HTTPS_PROXY=http://proxy.example.com"
Environment="NO_PROXY=localhost"

Then restart containerd service:

sudo systemctl daemon-reload
sudo systemctl restart containerd
sudo systemctl show --property=Environment containerd
2
  • Thanks a lot. I've seen something like that in docker documentation, but was not sure about this in containerd
    – ar rr
    Commented Oct 19, 2023 at 12:56
  • Behind the proxy, Docker should also be configured like that when running as K8s container runtime. But the service name and directory name should be different (docker.service.d, docker). Commented Oct 19, 2023 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.