Skip to content

Commit 09f7fe5

Browse files
author
Sponzilli, James (js7975)
committed
Allow for scripts in CKS ISO to fully control CKS deployment
1 parent 21af134 commit 09f7fe5

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

Diff for: plugins/integrations/kubernetes-service/src/main/resources/conf/k8s-control-node-add.yml

+16
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ write_files:
8989
export PATH=$PATH:/opt/bin
9090
fi
9191
92+
if [ -f "${BINARIES_DIR}/scripts/control-node-add/setup-kube-system" ]; then
93+
# This setup script will copy any necessary files out of the iso, and possibly overwrite /opt/bin/deploy-kube-system for the second stage
94+
if /bin/bash ${BINARIES_DIR}/scripts/control-node-add/setup-kube-system ${BINARIES_DIR} "{{ k8s_control_node.join_ip }}" "{{ k8s_control_node.cluster.token }}" "{{ k8s_control_node.cluster.ha.certificate.key }}" "{{registry.url}}" "{{registry.url.endpoint}}" "{{registry.username}}" "{{registry.password}}" "{{registry.token}}"; then
95+
rc=0
96+
echo "Success running setup-kube-system on a control plane node add from ISO."
97+
else
98+
rc=$?
99+
echo "Failed running setup-kube-system on a control plane node add from ISO."
100+
fi
101+
umount "${ISO_MOUNT_DIR}" && rmdir "${ISO_MOUNT_DIR}"
102+
if [ "$EJECT_ISO_FROM_OS" = true ] && [ "$iso_drive_path" != "" ]; then
103+
eject "${iso_drive_path}"
104+
fi
105+
exit $rc
106+
fi
107+
92108
if [ -d "$BINARIES_DIR" ]; then
93109
### Binaries available offline ###
94110
echo "Installing binaries from ${BINARIES_DIR}"

Diff for: plugins/integrations/kubernetes-service/src/main/resources/conf/k8s-control-node.yml

+16
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@ write_files:
109109
export PATH=$PATH:/opt/bin
110110
fi
111111
112+
if [ -f "${BINARIES_DIR}/scripts/control-node/setup-kube-system" ]; then
113+
# This setup script will copy any necessary files out of the iso, and possibly overwrite /opt/bin/deploy-kube-system, /opt/bin/setup-containerd, etc
114+
if /bin/bash ${BINARIES_DIR}/scripts/control-node/setup-kube-system ${BINARIES_DIR} "{{ k8s_control_node.cluster.token }}" "{{ k8s_control_node.cluster.initargs }}" "{{registry.url}}" "{{registry.url.endpoint}}" "{{registry.username}}" "{{registry.password}}" "{{registry.token}}"; then
115+
rc=0
116+
echo "Success running setup-kube-system on control plane node from ISO."
117+
else
118+
rc=$?
119+
echo "Failed running setup-kube-system on control plane node from ISO."
120+
fi
121+
umount "${ISO_MOUNT_DIR}" && rmdir "${ISO_MOUNT_DIR}"
122+
if [ "$EJECT_ISO_FROM_OS" = true ] && [ "$iso_drive_path" != "" ]; then
123+
eject "${iso_drive_path}"
124+
fi
125+
exit $rc
126+
fi
127+
112128
if [ -d "$BINARIES_DIR" ]; then
113129
### Binaries available offline ###
114130
echo "Installing binaries from ${BINARIES_DIR}"

Diff for: plugins/integrations/kubernetes-service/src/main/resources/conf/k8s-node.yml

+16
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ write_files:
8989
export PATH=$PATH:/opt/bin
9090
fi
9191
92+
if [ -f "${BINARIES_DIR}/scripts/node/setup-kube-system" ]; then
93+
# This setup script will copy any necessary files out of the iso, and possibly overwrite /opt/bin/deploy-kube-system, /opt/bin/setup-containerd, etc
94+
if /bin/bash ${BINARIES_DIR}/scripts/node/setup-kube-system ${BINARIES_DIR} "{{ k8s_control_node.join_ip }}" "{{ k8s_control_node.cluster.token }}" "{{registry.url}}" "{{registry.url.endpoint}}" "{{registry.username}}" "{{registry.password}}" "{{registry.token}}"; then
95+
rc=0
96+
echo "Success running setup-kube-system on worker node from ISO."
97+
else
98+
rc=$?
99+
echo "Failed running setup-kube-system on worker node from ISO."
100+
fi
101+
umount "${ISO_MOUNT_DIR}" && rmdir "${ISO_MOUNT_DIR}"
102+
if [ "$EJECT_ISO_FROM_OS" = true ] && [ "$iso_drive_path" != "" ]; then
103+
eject "${iso_drive_path}"
104+
fi
105+
exit $rc
106+
fi
107+
92108
if [ -d "$BINARIES_DIR" ]; then
93109
### Binaries available offline ###
94110
echo "Installing binaries from ${BINARIES_DIR}"

0 commit comments

Comments
 (0)