File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ mkdir -p $NODE_ROOT$KWASM_DIR/bin/
6161cp /assets/containerd-shim-spin-v2 $NODE_ROOT$KWASM_DIR /bin/
6262
6363if ! grep -q spin $NODE_ROOT$CONTAINERD_CONF ; then
64+ echo " Adding Spin runtime to containerd"
6465 if $IS_K3S ; then
6566 echo '
6667[plugins."io.containerd.cri.v1.runtime".containerd.runtimes."spin"]
@@ -70,11 +71,27 @@ if ! grep -q spin $NODE_ROOT$CONTAINERD_CONF; then
7071 echo '
7172[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin]
7273 runtime_type = "' $KWASM_DIR ' /bin/containerd-shim-spin-v2"
74+ ' >> $NODE_ROOT$CONTAINERD_CONF
75+ fi
76+ rm -Rf $NODE_ROOT$KWASM_DIR /active
77+ fi
78+
79+ # Check if Spin runtime options have not been configured
80+ # TODO: this should allow for some options to already be configured and just additively
81+ # configuring SystemdCgroup
82+ if ! grep -q ' runtimes.spin.options' $NODE_ROOT$CONTAINERD_CONF ; then
83+ echo " Setting SystemdCgroup to $SYSTEMD_CGROUP in Spin containerd configuration"
84+ if $IS_K3S ; then
85+ echo '
86+ [plugins."io.containerd.cri.v1.runtime".containerd.runtimes.spin.options]
87+ SystemdCgroup = ' $SYSTEMD_CGROUP '
88+ ' >> $NODE_ROOT$CONTAINERD_CONF
89+ else
90+ echo '
7391[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin.options]
7492 SystemdCgroup = ' $SYSTEMD_CGROUP '
7593' >> $NODE_ROOT$CONTAINERD_CONF
7694 fi
77- rm -Rf $NODE_ROOT$KWASM_DIR /active
7895fi
7996
8097if $IS_K3S ; then
Original file line number Diff line number Diff line change @@ -60,11 +60,10 @@ echo "Applying KWasm node installer job..."
6060kubectl apply -f ./microk8s-kwasm-job.yml
6161
6262echo " Waiting for node installer job to complete..."
63- kubectl wait -n kwasm --for=condition=Ready pod --selector=job-name=microk8s-provision-kwasm --timeout=90s || true
6463kubectl wait -n kwasm --for=jsonpath=' {.status.phase}' =Succeeded pod --selector=job-name=microk8s-provision-kwasm --timeout=60s
6564
6665# Verify the SystemdCgroup is set to true
67- cat /var/snap/microk8s/current/args/containerd.toml | grep -A5 " spin" | grep " SystemdCgroup = true"
66+ sudo cat /var/snap/microk8s/current/args/containerd.toml | grep -A5 " spin" | grep " SystemdCgroup = true"
6867
6968if ! kubectl get pods -n kwasm | grep -q " microk8s-provision-kwasm.*Completed" ; then
7069 echo " Node installer job failed!"
You can’t perform that action at this time.
0 commit comments