Skip to content

Uninstalling Codacy

To ensure a clean removal you should uninstall Codacy before destroying the cluster. To do so run:

helm -n codacy uninstall codacy
kubectl -n codacy delete --all pod &
kubectl -n codacy delete --all pvc &
kubectl -n codacy delete --all pv  &
kubectl -n codacy delete --all job &
sleep 5
kubectl -n codacy patch pvc -p '{"metadata":{"finalizers":null}}' $(kubectl -n codacy get pvc -o jsonpath='{.items[*]}')
kubectl -n codacy patch pv -p '{"metadata":{"finalizers":null}}' $(kubectl -n codacy get pv -o jsonpath='{.items[*]}')
sleep 5
kubectl -n codacy delete pod $(kubectl -n codacy get pod -o jsonpath='{.items[*]}') --force --grace-period=0
kubectl -n codacy get pod &
kubectl -n codacy get pvc &
kubectl -n codacy get pv  &
kubectl -n codacy get job &

Note that the deletion of pvcs in the above command has to run in the background due to a cyclic dependency in one of the components. If you are unsure of the effects of these commands please run each of the bash subcommands and validate their output.

echo "PVCs to delete:"
kubectl get pvc -n codacy -o jsonpath='{.items[*]}'
echo "PODS to delete:"
kubectl get pods -n codacy -o jsonpath='{.items[*]}'
Last update: September 29, 2020