Uninstall NGINX Service Mesh
This topic explains how to uninstall NGINX Service Mesh.
This document contains instructions for uninstalling NGINX Service Mesh.
For Helm users, see how to uninstall using Helm.
For OpenShfit users, removal behaves differently in order to ensure all injected Pods are serviced. See the Remove section of the OpenShift Considerations document for more information.
Uninstalling does the following:
- Removes the control plane and its contents from Kubernetes.
- Deletes all NGINX Service Mesh traffic policies.
nginx-meshctl command-line utility prints a list of resources that contain the sidecar proxies when the uninstall completes. You must re-roll the Deployments in Kubernetes to remove the sidecars. Until you re-roll the resources, the sidecar proxies still exist, but they don’t apply any rules to the traffic.
Before uninstalling the Service Mesh control plane, make sure your Kubernetes user has the permissions to access the internal NGINX Service Mesh API endpoints needed for removal.
Below is an example of a
ClusterRole with the necessary remove permissions:
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: nsm-remove rules: - apiGroups: - nsm.nginx.com resources: - clear verbs: - create - apiGroups: - nsm.nginx.com resources: - resources verbs: - list
If your Kubernetes user account has the
ClusterAdminrole, then no additional permissions are necessary to run the remove command.
To uninstall the Service Mesh control plane using the
nginx-meshctl command-line utility, run the command shown below.
When prompted for confirmation, specify
If you want to skip the confirmation prompt, add the
-yflag as shown in the example below.
nginx-meshctl remove -y
If your resources support Rolling Updates (Deployments, DaemonSets, and StatefulSets), run the following
kubectl command for each resource to complete the uninstall.
kubectl rollout restart <resource type>/<resource name>
kubectl rollout restart deployment/frontend
If you want to redeploy NGINX Service Mesh after removing it, you need to re-roll the resources after the new NGINX Service Mesh is installed. Sidecars from an earlier NGINX Service Mesh installation won’t work with a new installation.
Refer to the Kubernetes
kubectlCheat Sheet documentation for more information about rolling resources.