Uninstalling Knative¶
Warning
Before uninstalling, inventory your Knative Services, Brokers, Triggers, and Sources, and back up any manifests or data you need. Deleting Knative CRDs removes all custom resources of those kinds across the cluster. Only remove shared infrastructure (such as Istio, Contour, Kafka, or RabbitMQ) if no other workloads in the cluster depend on it.
To uninstall an Operator-based Knative installation, see Uninstall an Operator-based Knative Installation. To uninstall a YAML-based Knative installation, see Uninstall a YAML-based Knative Installation.
Uninstall YAML installation¶
To uninstall a YAML-based Knative installation:
Uninstalling optional Serving extensions¶
Uninstall any Serving extensions you have installed by performing the steps in the following relevant tab:
Knative also supports the use of the Kubernetes Horizontal Pod Autoscaler (HPA) for driving autoscaling decisions. The following command will uninstall the components needed to support HPA-class autoscaling:
kubectl delete -f https://storage.googleapis.com/knative-nightly/serving/latest/serving-hpa.yaml
Uninstalling a networking layer¶
Follow the relevant procedure to uninstall the networking layer you installed:
The following commands uninstall Contour and enable its Knative integration.
-
Uninstall the Knative Contour controller by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/net-contour/latest/net-contour.yaml -
Uninstall Contour:
kubectl delete -f https://storage.googleapis.com/knative-nightly/net-contour/latest/contour.yaml
The following commands uninstall Istio and enable its Knative integration.
-
Uninstall the Knative Istio controller by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/net-istio/latest/net-istio.yaml -
Optional: if you no longer need Istio, uninstall it by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/net-istio/latest/istio.yaml
Uninstall the Knative Kourier controller by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/net-kourier/latest/kourier.yaml
Uninstalling the Serving component¶
-
Uninstall the Serving core components by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/serving/latest/serving-core.yaml -
Uninstall the required custom resources by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/serving/latest/serving-crds.yaml
Uninstalling optional Eventing extensions¶
Uninstall any Eventing extensions you have installed by following the relevant procedure:
-
Uninstall the Kafka Sink data plane:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-kafka-broker/latest/eventing-kafka-sink.yaml -
Uninstall the Kafka controller:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-kafka-broker/latest/eventing-kafka-controller.yaml
Uninstall a single-tenant GitHub source by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-github/latest/github.yaml
Uninstall a multi-tenant GitHub source by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-github/latest/mt-github.yaml
Uninstall the Apache Kafka source by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-kafka-broker/latest/eventing-kafka-source.yaml
Uninstall the GCP sources by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/knative-gcp/latest/cloud-run-events.yaml
Uninstall the VMware sources and bindings by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/sources-for-knative/latest/release.yaml
Uninstalling an optional Broker (Eventing) layer¶
Uninstall a Broker (Eventing) layer, if you installed one:
-
Uninstall the Kafka Broker data plane by running the following command:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-kafka-broker/latest/eventing-kafka-broker.yaml -
Uninstall the Kafka controller by running the following command:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-kafka-broker/latest/eventing-kafka-controller.yaml
Uninstall the broker by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing/latest/mt-channel-broker.yaml
Uninstalling optional channel (messaging) layers¶
Uninstall each channel layer you have installed:
Uninstall the Apache Kafka Channel by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-kafka-broker/latest/eventing-kafka-channel.yaml
Uninstall the Google Cloud Pub/Sub Channel by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/knative-gcp/latest/cloud-run-events.yaml
Uninstall the in-memory channel implementation by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing/latest/in-memory-channel.yaml
-
Uninstall the NATS Streaming channel by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing-natss/latest/eventing-natss.yaml -
Uninstall NATS Streaming for Kubernetes. For more information, see the eventing-natss repository in GitHub.
Uninstalling the Eventing component¶
-
Uninstall the Eventing core components by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing/latest/eventing-core.yaml -
Uninstall the required custom resources by running:
kubectl delete -f https://storage.googleapis.com/knative-nightly/eventing/latest/eventing-crds.yaml
Uninstall Operator installation¶
To uninstall an Operator-based Knative installation, follow these procedures:
Removing the Knative Serving component¶
Remove the Knative Serving CR:
kubectl delete KnativeServing knative-serving -n knative-serving
Removing Knative Eventing component¶
Remove the Knative Eventing CR:
kubectl delete KnativeEventing knative-eventing -n knative-eventing
Note
Removing the KnativeServing and KnativeEventing CRs uninstalls the Knative controllers and data plane, while leaving the CRDs in place so existing custom resource objects are not automatically deleted. Those objects will no longer be reconciled or served once the controllers are removed.
Removing the Knative Operator¶
If you installed the Operator with YAML manifests, remove it using the same release manifest version you installed:
kubectl delete -f https://storage.googleapis.com/knative-nightly/operator/latest/operator.yaml
If you installed the Operator with Helm:
helm uninstall knative-operator -n knative-operator
If you installed the Operator from source, run the following command from the repository root:
ko delete -f config/