File tree Expand file tree Collapse file tree
akernel/charts/core/templates/node Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,12 +132,26 @@ jobs:
132132 IMAGE_TAG="${GITHUB_SHA}" \
133133 RUNTIME_PROFILE=rrt
134134
135+ - name : Verify systemd container identity in the image
136+ run : |
137+ docker image inspect "akernel-ci/all-in-one:${GITHUB_SHA}" \
138+ --format '{{json .Config.Env}}' | \
139+ python -c 'import json, sys; assert "container=oci" in json.load(sys.stdin)'
140+
135141 - name : Start standalone AKernel
136142 run : |
137143 IMAGE="akernel-ci/all-in-one:${GITHUB_SHA}" \
138144 AKERNEL_NAT_BACKEND=iptables \
139145 ./deploy/standalone/start.sh
140146
147+ - name : Verify PID 1 detects its container
148+ run : |
149+ docker exec akernel-node bash -euo pipefail -c '
150+ tr "\0" "\n" < /proc/1/environ | grep -x "container=oci"
151+ test "$(cat /run/systemd/container)" = oci
152+ systemd-detect-virt --container
153+ '
154+
141155 - name : Run SDK end-to-end examples
142156 run : |
143157 gateway_ip="$(docker inspect \
Original file line number Diff line number Diff line change @@ -183,6 +183,13 @@ Use [`deploy/README.md`](./deploy/README.md) as the deployment entry point.
183183AKernel supports standalone, existing Kubernetes clusters via Helm, and
184184Terraform-based cloud provisioning.
185185
186+ The all-in-one image and node launchers declare lowercase ` container=oci `
187+ for PID 1 systemd. Preserve this in the final image, Helm node environment,
188+ and standalone launcher: without container detection, privileged systemd
189+ shutdown can remount shared host filesystems read-only. See
190+ [ ` deploy/README.md#systemd-container-identity ` ] ( ./deploy/README.md#systemd-container-identity )
191+ for deployment implications.
192+
186193Aliyun's aggregate Pod PID budget is configurable independently of the
187194per-sandbox limit; see ` deploy/terraform/aliyun/README.md#pod-pid-budget ` .
188195
Original file line number Diff line number Diff line change @@ -233,6 +233,9 @@ COPY ./src/distill-fs/ ./
233233RUN cargo build --locked --release --bin distill_fs
234234
235235FROM ${AKERNEL_NODE_BASE_IMAGE}
236+ # Let PID 1 systemd avoid remounting shared host filesystems during shutdown.
237+ ENV container=oci
238+
236239ARG AKERNEL_ENABLE_KATA
237240ARG AKERNEL_ENABLE_RUNC
238241ARG AKERNEL_ENABLE_FIRECRACKER
Original file line number Diff line number Diff line change @@ -71,6 +71,14 @@ The node must support TC eBPF and bpffs. bpfnat does not manage host firewall
7171policy, so custom host-network deployments must allow forwarding to and from
7272the sandbox bridge when their ` FORWARD ` policy is ` DROP ` .
7373
74+ ### systemd container identity
75+
76+ The all-in-one image, Helm node template, and standalone launcher set
77+ ` container=oci ` so PID 1 systemd recognizes the container and does not remount
78+ shared host filesystems read-only during shutdown. Preserve this variable in
79+ custom launchers. Applying the fix requires replacing the node Pod or
80+ standalone container; it does not repair an already read-only filesystem.
81+
7482### Network ACLs
7583
7684The bundled standalone, Helm, and Terraform sandboxd configurations enable
Original file line number Diff line number Diff line change 7676 resources :
7777 {{- toYaml .Values.node.resources | nindent 10 }}
7878 env :
79+ # Required for systemd shutdown safety, including with older images.
80+ - name : container
81+ value : " oci"
7982 - name : AKERNEL_ROLE
8083 value : " node"
8184 - name : RUNSC_AKERNEL
Original file line number Diff line number Diff line change @@ -361,6 +361,7 @@ start_node_container() {
361361 --privileged \
362362 --net bridge \
363363 --restart always \
364+ -e container=oci \
364365 -e AKS_LOCAL_MODE=" true" \
365366 -e YR_RRT_CONTROL_SOCKET_PATH=" /run/akernel" \
366367 -e YR_IMAGE_PROCESS_CONFIG=" ${YR_IMAGE_PROCESS_CONFIG} " \
You can’t perform that action at this time.
0 commit comments