Skip to main content

Uninstall

Scripts for removing the praxis-collector supervisor from a Kubernetes cluster.


Uninstallation

sudo bash -c "$(curl -k -L https://storage.googleapis.com/download_dev/k8s_uninstall.sh)" -- -n praxis-collector
note

The -k flag disables TLS certificate verification for the script download. If your environment requires verified downloads, fetch the script separately, inspect it, and run it directly instead of piping to bash.


Parameters

ParameterTypeDefaultDescription
namespace / -nstringpraxis-collectorThe namespace to uninstall from. Must match the namespace used during installation. All namespace-scoped resources (Deployment, ConfigMap, ServiceAccount, child collectors) are removed from this namespace. The namespace itself is deleted at the end.

What the Script Does

The script shows you what will be removed and prompts for confirmation before touching anything. Once confirmed, it removes resources in this order:

  1. Child Collectors — deletes all OpenTelemetryCollector CRs in the namespace labelled app.kubernetes.io/managed-by=praxis-collector. Waits for full deletion before continuing, which causes the OTel Operator to tear down all child collector Deployments, DaemonSets, and StatefulSets.
  2. Node-level host path cleanup — log-tailing DaemonSets persist file read-offset checkpoints to host paths on every node they ran on. The script deploys a short-lived cleanup DaemonSet that mounts /var/lib on each node and removes the offset directories. It waits up to 120 seconds for the cleanup to complete on all nodes. Two host paths exist depending on which install path was used:
    • /var/lib/praxis-edge-collector/<pipeline>/ — written by every cloud-emitted log-tailing CR (the file_storage hostPath comes from the cloud-side packaging in adaptive-pipeline). Keyed on pipeline name so it's stable across split↔merged-DaemonSet migrations.
    • /var/lib/praxis-collector/file_storage/ — written when the supervisor's childCollector.fileStorage.enabled=true Helm option auto-injects a hostPath into a child CR.
  3. Supervisor Deployment — removes the supervisor Deployment. The pod begins terminating and is removed after its grace period.
  4. ConfigMap — removes the supervisor configuration ConfigMap (praxis-collector-config by default).
  5. ServiceAccount — removes the ServiceAccount the supervisor ran as.
  6. ClusterRoleBinding and ClusterRole — removes all cluster-scoped RBAC resources labelled app.kubernetes.io/name=praxis-collector. Also explicitly checks for and removes praxis-collector-k8s-receiver by name, covering installations where the optional k8s receiver RBAC was applied without the label.
  7. Namespace — deletes the entire namespace. Kubernetes garbage-collects any remaining resources inside it, including the cleanup DaemonSet.
warning

The current uninstall script only removes /var/lib/praxis-collector/ from nodes; it does not clean /var/lib/praxis-edge-collector/ (the path actually used for cloud-emitted log-tailing CRs). If you need a fully clean slate, run a one-shot DaemonSet to remove that directory after uninstall, or remove it manually on each node.

note

All deletions use --ignore-not-found=true. The script does not fail if a resource was already removed or was never created.

warning

If any node times out during the host path cleanup step, a warning is printed and the path must be removed manually from those nodes.


Verifying the Uninstallation

# Namespace should be gone
kubectl get namespace praxis-collector

# No cluster-scoped RBAC should remain with the app label
kubectl get clusterrole -l app.kubernetes.io/name=praxis-collector
kubectl get clusterrolebinding -l app.kubernetes.io/name=praxis-collector

# No supervisor pods should be present
kubectl get pods -n praxis-collector -l app.kubernetes.io/component=supervisor

# No child collectors should remain
kubectl get opentelemetrycollectors -n praxis-collector

All of the above should return NotFound or an empty list after a successful uninstall.


What Remains After Uninstall

The uninstall script removes only resources created by this installer. The following are intentionally left in place:

ResourceReason
cert-managerInstalled and managed independently. May be used by other workloads in your cluster. Remove it separately if no longer needed.
OpenTelemetry OperatorInstalled and managed independently. May manage other OpenTelemetryCollector resources in different namespaces. Remove it separately using its own Helm chart.
Prometheus CRDs (ServiceMonitor, PodMonitor)Installed independently (typically by the Prometheus Operator or kube-prometheus-stack). Not touched by this installer or uninstaller.
Supervisor metadata PVCCreated only by the Helm chart when supervisor.persistence.enabled=true (name: <release>-praxis-collector-supervisor-metadata). Helm and this script intentionally leave PVCs behind so a reinstall recovers state. Delete with kubectl delete pvc if you want a clean slate.
Child collector StatefulSet PVCsCreated by the OTel Operator from volumeClaimTemplates when childCollector.fileStorage.enabled=true. Survive child CR deletion by design. Find with kubectl get pvc -n <ns> and delete manually if no longer needed.
Manually-created PVCsAny PVCs you created outside the installer. Must be deleted separately.
/var/lib/praxis-edge-collector/ on each nodeCloud-side file_storage hostPath. Not removed by the current uninstall script (script only cleans /var/lib/praxis-collector/). See the warning under "What the Script Does".