Skip to content

Commit

Permalink
Preserve the service namespace during undeploy (#49)
Browse files Browse the repository at this point in the history
If a pod is on a host that cannot be reached, then any attempt to delete the
namespace will hang.  So change this to preserve the namespace and leave that
pod for k8s to cleanup when it can.

Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe authored Jan 29, 2024
1 parent eb84599 commit 91980e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2023 Hewlett Packard Enterprise Development LP
# Copyright 2023-2024 Hewlett Packard Enterprise Development LP
# Other additional copyright holders may be indicated within.
#
# The entirety of this work is licensed under the Apache License,
Expand Down Expand Up @@ -39,7 +39,8 @@ if [[ $CMD == 'undeploy' ]]; then
if kubectl get crd servicemonitors.monitoring.coreos.com > /dev/null 2>&1; then
$KUSTOMIZE build config/prometheus | kubectl delete --ignore-not-found -f-
fi
$KUSTOMIZE build $OVERLAY_DIR | kubectl delete --ignore-not-found -f -
# Do not touch the namespace resource when deleting this service.
$KUSTOMIZE build $OVERLAY_DIR | yq eval 'select(.kind != "Namespace")' | kubectl delete --ignore-not-found -f -
fi

exit 0

0 comments on commit 91980e2

Please sign in to comment.