Skip to content

Commit

Permalink
Fix eks restart pods helm
Browse files Browse the repository at this point in the history
Fixes issue where Helm breaks the node init script when restartPods is enabled.

Fixes issue where removing container can cause issues with Kubelet scheduling.

fixes: #9571

Signed-off-by: Tom Hadlaw <thomas.hadlaw@hootsuite.com>
  • Loading branch information
tom-hadlaw-hs authored and tgraf committed Mar 5, 2020
1 parent c832368 commit 99e6bc8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ spec:
if grep -q 'docker' /etc/crictl.yaml; then
# Works for COS, ubuntu
for f in `find /var/lib/cni/networks/ -type f ! -name lock ! -name last_reserved_ip.0`; do docker rm -f $(cat $f) || true; done
elif [ -n "$(docker ps --format "{{.Image}}" | grep ^[0-9]*\.dkr\.ecr\.[a-z]*-[a-z]*-[0-9]*\.amazonaws\.com/amazon-k8s-cni)" ]; then
elif [ -n "$(docker ps --format '{{ "{{" }}.Image{{ "}}" }}' | grep ^[0-9]*\.dkr\.ecr\.[a-z]*-[a-z]*-[0-9]*\.amazonaws\.com/amazon-k8s-cni)" ]; then
timeout=1
for i in $(seq 1 7); do
echo "Checking introspection API"
Expand All @@ -190,7 +190,7 @@ spec:
for pod in $(curl "localhost:61679/v1/pods" 2> /dev/null | jq -r '. | keys[]'); do
container_id=$(echo "$pod" | awk -F_ ' { print $3 } ' | cut -c1-12)
echo "Restarting ${container_id}"
docker rm -f "${container_id}" || true
docker kill "${container_id}" || true
done
else
# COS-beta (with containerd)
Expand Down

0 comments on commit 99e6bc8

Please sign in to comment.