Add cleanup instructions to external control plane doc (#11713)

This commit is contained in:
Frank Budinsky 2022-08-17 11:19:12 -04:00 committed by GitHub
parent fb6a90acc9
commit 0b21a60ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 25 deletions

View File

@ -815,3 +815,33 @@ $ export SECOND_CLUSTER_NAME=<your second remote cluster name>
Hello version: v2, instance: helloworld-v2-54df5f84b-9hxgw
...
{{< /text >}}
## Cleanup
Clean up the external control plane cluster:
{{< text bash >}}
$ kubectl delete -f external-istiod-gw.yaml --context="${CTX_EXTERNAL_CLUSTER}"
$ istioctl uninstall -y --purge --context="${CTX_EXTERNAL_CLUSTER}"
$ kubectl delete ns istio-system external-istiod --context="${CTX_EXTERNAL_CLUSTER}"
$ rm controlplane-gateway.yaml external-istiod.yaml external-istiod-gw.yaml
{{< /text >}}
Clean up the remote config cluster:
{{< text bash >}}
$ kubectl delete ns sample --context="${CTX_REMOTE_CLUSTER}"
$ istioctl manifest generate -f remote-config-cluster.yaml --set values.defaultRevision=default | kubectl delete --context="${CTX_REMOTE_CLUSTER}" -f -
$ kubectl delete ns external-istiod --context="${CTX_REMOTE_CLUSTER}"
$ rm remote-config-cluster.yaml istio-ingressgateway.yaml
$ rm istio-egressgateway.yaml eastwest-gateway-1.yaml || true
{{< /text >}}
Clean up the optional second remote cluster if you installed it:
{{< text bash >}}
$ kubectl delete ns sample --context="${CTX_SECOND_CLUSTER}"
$ istioctl manifest generate -f second-remote-cluster.yaml | kubectl delete --context="${CTX_SECOND_CLUSTER}" -f -
$ kubectl delete ns external-istiod --context="${CTX_SECOND_CLUSTER}"
$ rm second-remote-cluster.yaml eastwest-gateway-2.yaml
{{< /text >}}

View File

@ -557,3 +557,25 @@ Hello version: v1, instance: helloworld-v1-776f57d5f6-s7zfc
Hello version: v2, instance: helloworld-v2-54df5f84b-9hxgw
...
ENDSNIP
snip_cleanup_1() {
kubectl delete -f external-istiod-gw.yaml --context="${CTX_EXTERNAL_CLUSTER}"
istioctl uninstall -y --purge --context="${CTX_EXTERNAL_CLUSTER}"
kubectl delete ns istio-system external-istiod --context="${CTX_EXTERNAL_CLUSTER}"
rm controlplane-gateway.yaml external-istiod.yaml external-istiod-gw.yaml
}
snip_cleanup_2() {
kubectl delete ns sample --context="${CTX_REMOTE_CLUSTER}"
istioctl manifest generate -f remote-config-cluster.yaml --set values.defaultRevision=default | kubectl delete --context="${CTX_REMOTE_CLUSTER}" -f -
kubectl delete ns external-istiod --context="${CTX_REMOTE_CLUSTER}"
rm remote-config-cluster.yaml istio-ingressgateway.yaml
rm istio-egressgateway.yaml eastwest-gateway-1.yaml || true
}
snip_cleanup_3() {
kubectl delete ns sample --context="${CTX_SECOND_CLUSTER}"
istioctl manifest generate -f second-remote-cluster.yaml | kubectl delete --context="${CTX_SECOND_CLUSTER}" -f -
kubectl delete ns external-istiod --context="${CTX_SECOND_CLUSTER}"
rm second-remote-cluster.yaml eastwest-gateway-2.yaml
}

View File

@ -147,28 +147,6 @@ export CTX_EXTERNAL_CLUSTER="${KUBE_CONTEXTS[0]}"
export CTX_REMOTE_CLUSTER="${KUBE_CONTEXTS[2]}"
export CTX_SECOND_CLUSTER="${KUBE_CONTEXTS[1]}"
# TODO put the cleanup instructions in the doc and then call the snips.
kubectl delete ns sample --context="${CTX_REMOTE_CLUSTER}"
kubectl delete ns sample --context="${CTX_SECOND_CLUSTER}"
kubectl delete -f external-istiod-gw.yaml --context="${CTX_EXTERNAL_CLUSTER}"
istioctl manifest generate -f remote-config-cluster.yaml | kubectl delete --context="${CTX_REMOTE_CLUSTER}" -f -
istioctl manifest generate -f second-remote-cluster.yaml | kubectl delete --context="${CTX_SECOND_CLUSTER}" -f -
istioctl manifest generate -f eastwest-gateway-1.yaml | kubectl delete --context="${CTX_REMOTE_CLUSTER}" -f -
istioctl manifest generate -f eastwest-gateway-2.yaml | kubectl delete --context="${CTX_SECOND_CLUSTER}" -f -
istioctl manifest generate -f external-istiod.yaml | kubectl delete --context="${CTX_EXTERNAL_CLUSTER}" -f -
istioctl manifest generate -f controlplane-gateway.yaml | kubectl delete --context="${CTX_EXTERNAL_CLUSTER}" -f -
#TODO remove the following lines when https://github.com/istio/istio/issues/38599 is fixed
kubectl delete validatingwebhookconfigurations istiod-default-validator --context="${CTX_REMOTE_CLUSTER}"
kubectl delete validatingwebhookconfigurations istiod-default-validator --context="${CTX_EXTERNAL_CLUSTER}"
kubectl delete mutatingwebhookconfigurations istio-revision-tag-default-external-istiod --context="${CTX_REMOTE_CLUSTER}"
kubectl delete mutatingwebhookconfigurations istio-revision-tag-default-external-istiod --context="${CTX_EXTERNAL_CLUSTER}"
kubectl delete mutatingwebhookconfigurations istio-revision-tag-default --context="${CTX_EXTERNAL_CLUSTER}"
kubectl delete ns istio-system external-istiod --context="${CTX_EXTERNAL_CLUSTER}"
kubectl delete ns external-istiod --context="${CTX_REMOTE_CLUSTER}"
kubectl delete ns external-istiod --context="${CTX_SECOND_CLUSTER}"
rm external-istiod-gw.yaml remote-config-cluster.yaml external-istiod.yaml controlplane-gateway.yaml eastwest-gateway-1.yaml eastwest-gateway-2.yaml second-remote-cluster.yaml
snip_cleanup_1
snip_cleanup_2
snip_cleanup_3