Stay organized with collections
Save and categorize content based on your preferences.
Delete your stateful workloads using standard Kubernetes deletion methodologies.
Before you begin
To run commands against a Kubernetes cluster, ensure you have the following resources:
Locate the cluster name, or ask your Platform Administrator what the
cluster name is.
Sign in and generate the
kubeconfig file for the Kubernetes cluster if you don't have one.
Use the kubeconfig path of the Kubernetes cluster to replace
KUBERNETES_CLUSTER_KUBECONFIG in these instructions.
To get the required permissions to delete stateful workloads, ask your
Organization IAM Admin to grant you the Namespace Admin role (namespace-admin)
in your project namespace.
Delete a StatefulSet resource
Delete a StatefulSet resource if you no longer have a use for its associated
stateful container workloads.
CLUSTER_KUBECONFIG: the kubeconfig file for
the Kubernetes cluster.
NAMESPACE: the project namespace of the
container workload.
STATEFULSET_NAME: the name of the StatefulSet
object to delete.
When deleting a StatefulSet resource, all of its pods are also deleted. If
you prefer to only delete the StatefulSet resource and not its pods,
include the --cascade=orphan parameter.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-08 UTC."],[[["This document explains how to delete stateful workloads, specifically `StatefulSet` resources, in a Kubernetes user cluster using standard deletion methods."],["Before deleting any resources, you need to locate the user cluster name, have the correct kubeconfig file, and have Namespace Admin permissions granted by your Organization IAM Admin."],["To delete a `StatefulSet`, use the `kubectl delete statefulset STATEFULSET_NAME` command, where `STATEFULSET_NAME` is the name of the `StatefulSet` to be deleted."],["Deleting a `StatefulSet` also deletes its associated pods by default; however, you can use the `--cascade=orphan` parameter to only delete the `StatefulSet` resource."],["After deleting the `StatefulSet`, you must also delete the associated service using the `kubectl delete service SERVICE_NAME` command, where `SERVICE_NAME` is the name of the service to be deleted."]]],[]]