StackState for Kubernetes troubleshooting Self-hosted
To un-install StackState the first action is to run the
helm uninstallcommand. This command will remove all resources created by the
helm upgrade --installcommand.
stackstaterelease from the
stackstatenamespace like this, replace the namespace or release name with any custom names used during installation:
helm uninstall --namespace stackstate stackstate
The command will return almost immediately but shutting down all the pods and removing all other resources can take a while. Check if all pods are gone with:
kubectl get pods --namespace stackstate
If you want to re-install StackState later and have the old data still available this is all, for a full uninstall continue with the next 2 sections.
Removing the Persistent Volume Claims and/or the namespace will result in all data being lost that was stored in StackState.
To remove the namespace and with that, the Persistent Volume Claims and their linked Persistent Volumes simply remove the entire namespace:
kubectl delete namespace stackstate
When the command returns the namespace and all volumes will have been removed.
To only remove the Persistent Volume Claims (PVCs) and keep the namespace run:
kubectl delete pvc --all -n stackstate
On OpenShift the Helm chart also created a security context constraint (SCC). It is not cleaned up automatically by Helm but instead needs to be manually removed:
# The scc is always named stackstate-k8s-<namespace>
oc delete scc stackstate-k8s-stackstate
Even if you intend to re-install StackState on the same cluster but in a different namespace these can be removed. The resources contain references to the StackState namespace.
As described in the required permissions it might have been necessary that your cluster admin created some resources manually. These resources can now be removed again, but that also is a manual task that requires admin permission.
Delete the cluster role and the cluster role bindings that have been created like this:
kubectl delete cluster-role stackstate-authorization
kubectl delete cluster-role-binding stackstate-authorization
kubectl delete cluster-role-binding stackstate-authentication