secrets-init
secrets-init copied to clipboard
Error: unable to start container process: error during container init
Version 0.4.2 GKE CloudBuild based Helm deployment.
Here's the error:
Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/lib/kubelet/pods/aece9c11-6a55-443b-8851-1fa6a053f6a4/volumes/kubernetes.io~empty-dir/secrets-init-volume" to rootfs at "/secrets-init/bin": open o_path procfd: open /run/containerd/io.containerd.runtime.v2.task/k8s.io/secrets-init/rootfs/secrets-init/bin: not a directory: unknown
Here's what I'm doing to start the container as one of three other containers inside the pod, the other two depend on this to get at the Google Secrets Manager secrets from the env values specified as they are in your readme, the workload identity service account should be working correctly so I think the issue is specifically mount path related:
- name: secrets-init
image: ghcr.io/doitintl/secrets-init:latest
command:
- sh
args:
- -c
- "cp /usr/local/bin/secrets-init /secrets-init/bin/"
volumeMounts:
- mountPath: /secrets-init/bin
name: secrets-init-volume
I defined the volumes in the yaml as well:
- mountPath: /secrets-init/bin
name: secrets-init-volume
@sephethus please check the full example
The valid flow is the following:
- create a new
emptyDirvolume in a Pod, call itsecrets-init-volumefor example - add a
secrets-initcontainer to theinitContainerssection and copy thesecrets-initbinary to thesecrets-init-volumevolume - Modify the target container: mount the same
secrets-init-volume(with copiedsecrets-initbinary) and change the container's ENTRYPOINT or CMD to thesecrets-initbinary. Put the original ENTRYPOINT/CMD as arguments to thesecrets-init.
I could reproduce that issue, if I use the example from the blog post it uses this version: doitintl/secrets-init:v0.2.1 which works fine, this version fails with the error above: doitintl/secrets-init:0.4.7
fixed
FYI that I'm still able to reproduce this behavior with version 0.5.0. I downgraded to v0.2.1 as mentioned above and things are now working.
@caseycrites can you please attach log message
I'll see if I can bring it back up today, but from what I remember, it's the exact same message as OP.
here's the exact error message, does look to be the same as OP:
Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/lib/kubelet/pods/af20fbba-b03a-4019-85ae-f40671642b9e/volumes/kubernetes.io~empty-dir/secrets-init-volume" to rootfs at "/secrets-init/bin": open o_path procfd: open /run/containerd/io.containerd.runtime.v2.task/k8s.io/secrets-init/rootfs/secrets-init/bin: not a directory: unknown
@caseycrites please attach your pod YAML file here