Configure k8s-coredump token on other nodes

Copy k8s-coredump token on install for secondary
controller nodes and worker nodes.

Test Plan:
PASS: Install and bootstrap Standard system
PASS: Verify if /etc/k8s-coredump-conf.json file is
      created on all controller and compute nodes.

Regression:

PASS: After bootstrap, create and crash a pod with
      annotations configured and verify if coredump
      is generated on pod namespace on each node.
PASS: After bootstrap, crash a non k8s application
      and verify that the coredump is generated as
      previously (by systemd-coredump) on each node.

Depends-On: https://review.opendev.org/c/starlingx/ansible-playbooks/+/864113
Closes-bug: 1996054

Signed-off-by: Heron Vieira <heron.vieira@windriver.com>
Change-Id: Ib15b84ca8cc8ca870a21d314f6ee2b7193532aa1
This commit is contained in:
Heron Vieira 2022-11-09 10:10:08 -03:00
parent d7dede71ce
commit 638eb21ccd
2 changed files with 24 additions and 0 deletions

View File

@ -486,6 +486,18 @@ start()
fi
fi
# Copy over k8s-coredump-handler token
if [ -e $CONFIG_DIR/k8s-coredump-conf.json ]
then
cp $CONFIG_DIR/k8s-coredump-conf.json /etc/k8s-coredump-conf.json
if [ $? -ne 0 ]
then
fatal_error "Unable to copy k8s-coredump-handler token config file"
else
chmod 600 /etc/k8s-coredump-conf.json
fi
fi
if [ ! -e "${ACTIVE_CONTROLLER_NOT_FOUND_FLAG}" ]
then
# Keep the /opt/branding directory to preserve any new files

View File

@ -272,6 +272,18 @@ start()
fi
fi
# Copy over k8s-coredump-handler token
if [ -e $CONFIG_DIR/k8s-coredump-conf.json ]
then
cp $CONFIG_DIR/k8s-coredump-conf.json /etc/k8s-coredump-conf.json
if [ $? -ne 0 ]
then
fatal_error "Unable to copy k8s-coredump-handler token config file"
else
chmod 600 /etc/k8s-coredump-conf.json
fi
fi
# banner customization always returns 0, success:
/usr/sbin/install_banner_customization