mirror of https://github.com/linkerd/linkerd2.git
fix(linkerd2-cni): execute container preStop command `kill` command as shell builtin (#5453)
The container-image `ghcr.io/linkerd/cni-plugin:stable-2.9.1` does not contain the `kill` command as an executable. Instead, it is available as a shell built-in. In its current state, Kubernetes emits error events whenever linkerd2-cni pods are terminated because the `kill` command can not be found. Signed-off-by: Mitch Hulscher <mitch.hulscher@lib.io>
This commit is contained in:
parent
57460bdc42
commit
462fe32ef2
|
@ -220,9 +220,14 @@ spec:
|
|||
- name: SLEEP
|
||||
value: "true"
|
||||
lifecycle:
|
||||
# In some edge-cases this helps ensure that cleanup() is called in the container's script
|
||||
# https://github.com/linkerd/linkerd2/issues/2355
|
||||
preStop:
|
||||
exec:
|
||||
command: ["kill","-15","1"]
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kill -15 1
|
||||
volumeMounts:
|
||||
{{- if ne .Values.destCNIBinDir .Values.destCNINetDir }}
|
||||
- mountPath: /host{{.Values.destCNIBinDir}}
|
||||
|
|
|
@ -185,9 +185,14 @@ spec:
|
|||
- name: SLEEP
|
||||
value: "true"
|
||||
lifecycle:
|
||||
# In some edge-cases this helps ensure that cleanup() is called in the container's script
|
||||
# https://github.com/linkerd/linkerd2/issues/2355
|
||||
preStop:
|
||||
exec:
|
||||
command: ["kill","-15","1"]
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kill -15 1
|
||||
volumeMounts:
|
||||
- mountPath: /host/opt/cni/bin
|
||||
name: cni-bin-dir
|
||||
|
|
|
@ -186,9 +186,14 @@ spec:
|
|||
- name: SLEEP
|
||||
value: "true"
|
||||
lifecycle:
|
||||
# In some edge-cases this helps ensure that cleanup() is called in the container's script
|
||||
# https://github.com/linkerd/linkerd2/issues/2355
|
||||
preStop:
|
||||
exec:
|
||||
command: ["kill","-15","1"]
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kill -15 1
|
||||
volumeMounts:
|
||||
- mountPath: /host/opt/my-cni/bin
|
||||
name: cni-bin-dir
|
||||
|
|
|
@ -186,9 +186,14 @@ spec:
|
|||
- name: SLEEP
|
||||
value: "true"
|
||||
lifecycle:
|
||||
# In some edge-cases this helps ensure that cleanup() is called in the container's script
|
||||
# https://github.com/linkerd/linkerd2/issues/2355
|
||||
preStop:
|
||||
exec:
|
||||
command: ["kill","-15","1"]
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kill -15 1
|
||||
volumeMounts:
|
||||
- mountPath: /host/etc/kubernetes/cni/net.d
|
||||
name: cni-net-dir
|
||||
|
|
|
@ -176,9 +176,14 @@ spec:
|
|||
- name: SLEEP
|
||||
value: "true"
|
||||
lifecycle:
|
||||
# In some edge-cases this helps ensure that cleanup() is called in the container's script
|
||||
# https://github.com/linkerd/linkerd2/issues/2355
|
||||
preStop:
|
||||
exec:
|
||||
command: ["kill","-15","1"]
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kill -15 1
|
||||
volumeMounts:
|
||||
- mountPath: /host/opt/my-cni/bin
|
||||
name: cni-bin-dir
|
||||
|
|
|
@ -185,9 +185,14 @@ spec:
|
|||
- name: SLEEP
|
||||
value: "true"
|
||||
lifecycle:
|
||||
# In some edge-cases this helps ensure that cleanup() is called in the container's script
|
||||
# https://github.com/linkerd/linkerd2/issues/2355
|
||||
preStop:
|
||||
exec:
|
||||
command: ["kill","-15","1"]
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kill -15 1
|
||||
volumeMounts:
|
||||
- mountPath: /host/opt/cni/bin
|
||||
name: cni-bin-dir
|
||||
|
|
|
@ -187,9 +187,14 @@ spec:
|
|||
- name: SLEEP
|
||||
value: "true"
|
||||
lifecycle:
|
||||
# In some edge-cases this helps ensure that cleanup() is called in the container's script
|
||||
# https://github.com/linkerd/linkerd2/issues/2355
|
||||
preStop:
|
||||
exec:
|
||||
command: ["kill","-15","1"]
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kill -15 1
|
||||
volumeMounts:
|
||||
- mountPath: /host/opt/cni/bin
|
||||
name: cni-bin-dir
|
||||
|
|
|
@ -188,9 +188,14 @@ spec:
|
|||
- name: SLEEP
|
||||
value: "true"
|
||||
lifecycle:
|
||||
# In some edge-cases this helps ensure that cleanup() is called in the container's script
|
||||
# https://github.com/linkerd/linkerd2/issues/2355
|
||||
preStop:
|
||||
exec:
|
||||
command: ["kill","-15","1"]
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- kill -15 1
|
||||
volumeMounts:
|
||||
- mountPath: /host/opt/cni/bin-test
|
||||
name: cni-bin-dir
|
||||
|
|
Loading…
Reference in New Issue