sonic-buildimage/files/build_templates
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
..
per_namespace [swss.service]: Remove ordering with pmon (#7614) 2021-05-27 22:29:35 +00:00
share_image [ChassisDB]: bring up ChassisDB service (#5283) 2020-10-14 15:15:24 -07:00
arp_update_vars.j2 [swss] Enhance ARP Update to Call Sonic Cfggen Once (#5398) 2020-09-18 18:44:23 -07:00
buffers_config.j2 [Dynamic buffer calc] Support dynamic buffer calculation (#6194) 2020-12-13 11:35:39 -08:00
config-chassisdb.service.j2 [ChassisDB]: bring up ChassisDB service (#5283) 2020-10-14 15:15:24 -07:00
config-setup.service.j2 [config-setup]: create a SONiC configuration management service (#3227) 2019-12-04 07:15:58 -08:00
database.service.j2 Multi-ASIC implementation (#3888) 2020-03-31 10:06:19 -07:00
dhcp_relay.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
docker_image_ctl.j2 [teamd]: Increase wait timeout for teamd docker stop to clean Port channels. (#6537) 2021-02-05 16:22:28 -08:00
gbsyncd.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
iccpd.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
init_cfg.json.j2 [init_cfg]: allow enable/disable swss/teamd/syncd services (#6291) 2020-12-28 10:33:46 -08:00
kube_cni.10-flannel.conflist First cut image update for kubernetes support. (#5421) 2020-12-22 08:01:33 -08:00
lldp.service.j2 Changes for LLDP docker to support multi-npu platforms (#4530) 2020-05-11 11:05:44 -07:00
mgmt-framework.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
mgmt-framework.timer [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
nat.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
organization_extensions.sh Framework to plugin Organization specific scripts during ONIE Image build (#951) 2017-09-19 16:23:31 -07:00
pmon.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
qos_config.j2 [qos]: modify dot1p to tc mapping (#7661) 2021-05-24 22:25:47 +00:00
radv.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
restapi.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
sflow.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
snmp.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
snmp.timer [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
sonic_debian_extension.j2 [Kubernetes]: The kube server could be used as http-proxy for docker (#7469) 2021-06-17 07:09:50 +00:00
sonic.target [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
swss_vars.j2 [swss_vars]: Add 'resource_type' attribute. (#7188) 2021-05-03 10:38:11 -07:00
tacacs-config.service Add service to restore TACACS from old config (#7560) 2021-06-07 06:02:32 +00:00
tacacs-config.timer Add service to restore TACACS from old config (#7560) 2021-06-07 06:02:32 +00:00
telemetry.service.j2 [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
telemetry.timer [services] introduce sonic.target (#5705) 2021-03-04 21:23:05 +00:00
updategraph.service.j2 [config-setup]: create a SONiC configuration management service (#3227) 2019-12-04 07:15:58 -08:00