1

My cluster is behind a corporate proxy, and I have manually set http_proxy=myproxy, https_proxy=myproxy and no_proxy=10.96.0.0/16,10.244.0.0/16,<nodes-ip-range> in the three kubernetes core manifests (kube-apiserver.yaml, kube-controller-manager.yaml and kube-scheduler.yaml). Now, I want to upgrade kubernetes with kubeadm. But I know kubeadm will regenerate these manifests from the kubeadm-config configmap when upgrading, so without these environment variables. I can't find an extraEnvs key in kubeadm-config configmap (like extraArgs and extraVolumes).

Do I really need to set these variables in all kubernetes manifests ? If not, I think kubeadm will throw a warning because all communications will use the proxy (and I don't want that).

How can I pass these variables to kubeadm when upgrading ?

Antoine
  • 310
  • 1
  • 5
  • 14

1 Answers1

0

There are no such a flags available for Kubeadm at the moment. You may want to open github request for that feature.

You can use the way described here or here and export variables:

$ export http_proxy=http://proxy-ip:port/
$ export https_proxy=http://proxy-ip:port/
$ export no_proxy=master-ip,node-ip,127.0.0.1

And then use sudo -E bash to use the current

$ sudo -E bash -c "kubeadm init... "

Alternative way would be to reference those variables in the command as showed here:

NO_PROXY=master-ip,node-ip,127.0.0.1 HTTPS_PROXY=http://proxy-ip:port/ sudo kubeadm init --pod-network-cidr=192.168.0.0/16...
acid_fuji
  • 6,287
  • 7
  • 22