Skip to content

PreStop hook fails on csi-node-driver-registrar — distroless image has no /bin/sh #24

@SHaaD94

Description

@SHaaD94

The csi-vast-node DaemonSet defines a PreStop lifecycle hook on the csi-node-driver-registrar container:

  lifecycle:
    preStop:
      exec:
        command:
        - /bin/sh
        - -c
        - rm -rf /registration/csi.vastdata.com
  /registration/csi.vastdata.com-reg.sock

However, the default registrar image registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.0 is a distroless image that does not contain /bin/sh. The hook fails silently on every pod termination:

 LAST SEEN   TYPE      REASON              OBJECT
MESSAGE
17m         Warning   FailedPreStopHook   pod/csi-vast-node-gbppq

/bin/sh: no such file or directory — same error as the kubelet logs from
  the incident. The csi-node-driver-registrar:v2.10.0 container is
  distroless. The PreStop hook ["/bin/sh", "-c", "rm -rf
  /registration/csi.vastdata.com ..."] fails every time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions