From 00e361c1ee5fc64ead71039d0ac83bc4e99ab81c Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Fri, 27 Oct 2023 01:21:32 -0400 Subject: [PATCH] preserve the resources Signed-off-by: Carlos Santana --- patterns/gitops/getting-started-argocd/README.md | 12 ++++++++---- .../getting-started-argocd/bootstrap/addons.yaml | 2 +- patterns/gitops/getting-started-argocd/destroy.sh | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/patterns/gitops/getting-started-argocd/README.md b/patterns/gitops/getting-started-argocd/README.md index d0cd0db8c9..758b9db048 100644 --- a/patterns/gitops/getting-started-argocd/README.md +++ b/patterns/gitops/getting-started-argocd/README.md @@ -21,7 +21,9 @@ Verify Addons are ready ```shell kubectl get applications -n argocd \ addon-getting-started-gitops-aws-load-balancer-controller \ - addon-getting-started-gitops-metrics-server + addon-getting-started-gitops-metrics-server \ + addon-getting-started-gitops-argo-cd +kubectl get sts -n argocd kubectl get deployment -n kube-system \ aws-load-balancer-controller \ metrics-server @@ -44,15 +46,17 @@ kubectl get -n game-2048 deployments kubectl get -n game-2048 ingress ``` -Get the Ingress URL for the Application +Get the Ingress URL for the Application (You need to wait 2 minutes for Load Balancer to be created) ```shell -echo "Application URL: http://$(kubectl get -n game-2048 ingress ingress-2048 -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')" +echo "Application URL: http://$(kubectl get -n game-2048 ingress game-2048 -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')" ``` + Verify Application from Terminal ```shell -curl -I $(kubectl get -n game-2048 ingress ingress-2048 -o jsonpath='{.status.loadBalancer.ingress[0].hostname}') +curl -I $(kubectl get -n game-2048 ingress game-2048 -o jsonpath='{.status.loadBalancer.ingress[0].hostname}') ``` + Destroy EKS Cluster ```shell ./destroy.sh diff --git a/patterns/gitops/getting-started-argocd/bootstrap/addons.yaml b/patterns/gitops/getting-started-argocd/bootstrap/addons.yaml index 58bd8c2344..e867a1c878 100644 --- a/patterns/gitops/getting-started-argocd/bootstrap/addons.yaml +++ b/patterns/gitops/getting-started-argocd/bootstrap/addons.yaml @@ -5,7 +5,7 @@ metadata: namespace: argocd spec: syncPolicy: - preserveResourcesOnDeletion: false + preserveResourcesOnDeletion: true generators: - clusters: {} template: diff --git a/patterns/gitops/getting-started-argocd/destroy.sh b/patterns/gitops/getting-started-argocd/destroy.sh index 9fae53e59c..b2a3d8b32b 100755 --- a/patterns/gitops/getting-started-argocd/destroy.sh +++ b/patterns/gitops/getting-started-argocd/destroy.sh @@ -13,8 +13,10 @@ terraform -chdir=$SCRIPTDIR output -raw configure_kubectl > "$TMPFILE" if [[ ! $(cat $TMPFILE) == *"No outputs found"* ]]; then source "$TMPFILE" kubectl delete -n argocd applicationset workloads + echo "Waiting for ingress and load balancer to be deleted" + sleep 240 kubectl delete -n argocd applicationset cluster-addons - kubectl delete -n argocd application addon-dev-argo-cd + kubectl delete -n argocd applicationset addons-argocd kubectl delete -n argocd svc argo-cd-argocd-server fi