lifechurch / k8s-deploy-helper

k8s-deploy-helper is a tool to help build and deploy containerized applications into Kubernetes using GitLab CI along with templated manifest files.
MIT License
141 stars 30 forks source link

Destroy command omits configMaps and Certmanager created certificates during removal of deployment objects #43

Closed brentonNeal closed 4 years ago

brentonNeal commented 4 years ago

When a branch removal triggers a destroy command via GitlabCI, configMaps and Certmanager created secrets are left behind as orphaned artifacts related to the now deleted deployment. Adding additional kubectl delete commands to the destroy script would remove these artifacts during the destroy run.

kubectl delete deploy,pod,rs,svc,ing,ds,configmap -l "app=$CI_ENVIRONMENT_SLUG" -n "$KUBE_NAMESPACE"

kubectl delete certificate tls-$CI_ENVIRONMENT_HOSTNAME -n "$KUBE_NAMESPACE"

bbelyeu commented 4 years ago

Merged https://github.com/lifechurch/k8s-deploy-helper/pull/44 and will include in our 7.1 release