Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall istio (all components) completely from kubernetes cluster

I installed istio using these commands:

VERSION = 1.0.5
GCP = gcloud
K8S = kubectl

@$(K8S) apply -f istio-$(VERSION)/install/kubernetes/helm/istio/templates/crds.yaml
@$(K8S) apply -f istio-$(VERSION)/install/kubernetes/istio-demo-auth.yaml
@$(K8S) get pods -n istio-system
@$(K8S) label namespace default istio-injection=enabled
@$(K8S) get svc istio-ingressgateway -n istio-system

Now, how do I completely uninstall it including all containers/ingress/egress etc (everthing installed by istio-demo-auth.yaml?

Thanks.

like image 728
user674669 Avatar asked Jan 18 '19 21:01

user674669


People also ask

How do I delete a virtual service in Kubernetes?

5 Deleting a Service or Deployment. Objects can be deleted easily within Kubernetes so that your environment can be cleaned. Use the kubectl delete command to remove an object.

How do I check if Istio is installed?

The istioctl command saves the IstioOperator CR that was used to install Istio in a copy of the CR named installed-state. You can inspect this CR if you lose track of what is installed in a cluster. The installed-state CR is also used to perform checks in some istioctl commands and should therefore not be removed.

What does Istioctl install do?

istioctl install automatically prunes any resources that should be removed when the configuration changes (e.g. if you remove a gateway). This does not happen when you use istio manifest generate with kubectl and these resources must be removed manually.

Which of the following is not a recommended method of installing Istio?

Using the operator is not recommended for new installations. While the operator will continue to be supported, new feature requests will not be prioritized. The Istio operator provides an installation path without needing the istioctl binary.


2 Answers

If you used istioctl, it's pretty easy:

istioctl x uninstall --purge

Of course, it would be easier if that command were listed in istioctl --help...

Reference: https://istio.io/latest/docs/setup/install/istioctl/#uninstall-istio

like image 134
Tin Can Avatar answered Sep 21 '22 13:09

Tin Can


Based on their documentation here, you can generate all specs as yml file then pipe it to simple kubectl's delete operation

istioctl manifest generate <your original installation options> | kubectl delete -f -

here's an example:

istioctl manifest generate --set profile=default | kubectl delete -f -

A drawback of this approach though is to remember all options you have used when you installed istio which might be quite hard to remember especially if you enabled specific components.

If you have installed istio using helm's chart, you can uninstall it easily

First, list all installed charts:

helm list -n istio-system
NAME    NAMESPACE   REVISION    UPDATED                                 STATUS   
istiod  istio-system    1       2020-03-07 15:01:56.141094 -0500 EST    deployed   

and then delete/uninstall the chart using the following syntax:

helm delete -n istio-system --purge istio-system
helm delete -n istio-system --purge istio-init
...

Check their website for more information on how to do this.

If you already installed istio using istioctl or helm in its own separate namespace, you can easily delete completely that namespace which will in turn delete all resources created inside it.

kubectl delete namespace istio-system 
like image 34
Muhammad Soliman Avatar answered Sep 19 '22 13:09

Muhammad Soliman