sonic-buildimage/files
Renuka Manavalan e851a42db7 [Kubernetes]: The kube server could be used as http-proxy for docker (#7469)
Why I did it
The SONiC switches get their docker images from local repo, populated during install with container images pre-built into SONiC FW. With the introduction of kubernetes, new docker images available in remote repo could be deployed. This requires dockerd to be able to pull images from remote repo.

Depending on the Switch network domain & config, it may or may not be able to reach the remote repo. In the case where remote repo is unreachable, we could potentially make Kubernetes server to also act as http-proxy.

How I did it
When admin explicitly enables, the kubernetes-server could be configured as docker-proxy. But any update to docker-proxy has to be via service-conf file environment variable, implying a "service restart docker" is required. But restart of dockerd is vey expensive, as it would restarts all dockers, including database docker.

To avoid dockerd restart, pre-configure an http_proxy using an unused IP. When k8s server is enabled to act as http-proxy, an IP table entry would be created to direct all traffic to the configured-unused-proxy-ip to the kubernetes-master IP. This way any update to Kubernetes master config would be just manipulating IPTables, which will be transparent to all modules, until dockerd needs to download from remote repo.

How to verify it
Configure a switch such that image repo is unreachable
Pre-configure dockerd with http_proxy.conf using an unused IP (e.g. 172.16.1.1)
Update ctrmgrd.service to invoke ctrmgrd.py with "-p" option.
Configure a k8s server, and deploy an image for feature with set_owner="kube"
Check if switch could successfully download the image or not.
2021-06-17 07:09:50 +00:00
..
Aboot [Arista] Fix dockerd issue on Arista platforms (#7376) 2021-05-01 19:43:51 -07:00
apt Add mirrors for reproducible build (#6813) 2021-02-19 11:51:34 -08:00
build/versions [202012] Bring in BRCM SAI changes from SAI 4.3.3.7 (#7850) 2021-06-14 17:52:35 -07:00
build_scripts [hostcfgd]: Add Ability To Configure Feature During Run-time (#6700) 2021-03-15 19:09:31 -07:00
build_templates [Kubernetes]: The kube server could be used as http-proxy for docker (#7469) 2021-06-17 07:09:50 +00:00
dhcp ZTP infrastructure changes to support DHCP discovery provisioning data (#3298) 2019-12-10 08:16:56 -08:00
docker Enabling ipv6 support on docker container network. This is needed (#5418) 2020-09-22 08:32:17 -07:00
image_config [202012][Monit] Deprecate the feature of monitoring the critical processes by Monit (#7823) 2021-06-09 09:04:22 -07:00
initramfs-tools [NVMe] Add NVMe SSD disc type support to installer.sh script (#6142) 2020-12-09 19:03:27 -08:00
scripts [Mux] Do not clean-up HW_MUX_CABLE_TABLE from State DB (#7710) 2021-05-27 22:30:06 +00:00
sshd [sshd]: Create /run/sshd under systemd using RuntimeDirectory 2020-04-17 04:51:51 +00:00