2017-05-08 17:43:31 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
First cut image update for kubernetes support. (#5421)
* First cut image update for kubernetes support.
With this,
1) dockers dhcp_relay, lldp, pmon, radv, snmp, telemetry are enabled
for kube management
init_cfg.json configure set_owner as kube for these
2) Each docker's start.sh updated to call container_startup.py to register going up
As part of this call, it registers the current owner as local/kube and its version
The images are built with its version ingrained into image during build
3) Update all docker's bash script to call 'container start/stop/wait' instead of 'docker start/stop/wait'.
For all locally managed containers, it calls docker commands, hence no change for locally managed.
4) Introduced a new ctrmgrd service, that helps with transition between owners as kube & local and carry over any labels update from STATE-DB to API server
5) hostcfgd updated to handle owner change
6) Reboot scripts are updatd to tag kube running images as local, so upon reboot they run the same image.
7) Added kube_commands.py to handle all updates with Kubernetes API serrver -- dedicated for k8s interaction only.
2020-12-22 10:01:33 -06:00
|
|
|
|
|
|
|
if [ "${RUNTIME_OWNER}" == "" ]; then
|
|
|
|
RUNTIME_OWNER="kube"
|
|
|
|
fi
|
|
|
|
|
|
|
|
CTR_SCRIPT="/usr/share/sonic/scripts/container_startup.py"
|
|
|
|
if test -f ${CTR_SCRIPT}
|
|
|
|
then
|
|
|
|
${CTR_SCRIPT} -f snmp -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION}
|
|
|
|
fi
|
|
|
|
|
2020-08-17 17:46:29 -05:00
|
|
|
mkdir -p /etc/ssw /etc/snmp
|
2017-05-08 17:43:31 -05:00
|
|
|
|
2020-12-28 13:51:58 -06:00
|
|
|
# Parse snmp.yml and insert the data in Config DB
|
|
|
|
/usr/bin/snmp_yml_to_configdb.py
|
|
|
|
|
2020-08-17 17:46:29 -05:00
|
|
|
SONIC_CFGGEN_ARGS=" \
|
|
|
|
-d \
|
|
|
|
-y /etc/sonic/sonic_version.yml \
|
|
|
|
-t /usr/share/sonic/templates/sysDescription.j2,/etc/ssw/sysDescription \
|
|
|
|
-t /usr/share/sonic/templates/snmpd.conf.j2,/etc/snmp/snmpd.conf \
|
|
|
|
"
|
|
|
|
|
|
|
|
sonic-cfggen $SONIC_CFGGEN_ARGS
|
2017-05-08 17:43:31 -05:00
|
|
|
|
|
|
|
mkdir -p /var/sonic
|
|
|
|
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
|
2023-06-25 18:36:09 -05:00
|
|
|
|
|
|
|
TZ=$(cat /etc/timezone)
|
|
|
|
rm -rf /etc/localtime
|
|
|
|
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
|