forked from carlosedp/kubernetes-elasticsearch-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
teardown
executable file
·46 lines (33 loc) · 1010 Bytes
/
teardown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
if [ -z "${KUBECONFIG}" ]; then
export KUBECONFIG=~/.kube/config
fi
# CAUTION - setting NAMESPACE will deploy most components to the given namespace
# however some are hardcoded to 'monitoring'. Only use if you have reviewed all manifests.
if [ -z "${NAMESPACE}" ]; then
NAMESPACE=logging
fi
kctl() {
kubectl --namespace "$NAMESPACE" "$@"
}
# Delete Fluentd
kctl delete -f fluentd-configmap.yaml
kctl delete -f fluentd-daemonset.yaml
# Delete Kibana
kctl delete -f kibana-configmap.yaml
kctl delete -f kibana-external-ingress.yaml
kctl delete -f kibana-svc.yaml
kctl delete -f kibana.yaml
# Delete Curator
kctl delete -f es-curator-configmap.yaml
kctl delete -f es-curator-cronjob.yaml
# Delete Elasticsearch nodes
kctl delete -f es-full.yaml
# Delete Elasticsearch services
kctl delete -f es-full-svc.yaml
# Delete Cerebro
kctl delete -f cerebro.yaml
kctl delete -f cerebro-external-ingress.yaml
# Delete namespace
kubectl delete namespace $NAMESPACE
echo "done!"