fd5289c63689a73beb615ae0693f2604254926df
[nonrtric/plt/sme.git] / servicemanager / deploy / src / delete-from-k8s.sh
1 #!/bin/bash
2 ##############################################################################
3 #
4 #   Copyright (C) 2024: OpenInfra Foundation Europe
5 #
6 #   Licensed under the Apache License, Version 2.0 (the "License");
7 #   you may not use this file except in compliance with the License.
8 #   You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #   Unless required by applicable law or agreed to in writing, software
13 #   distributed under the License is distributed on an "AS IS" BASIS,
14 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #   See the License for the specific language governing permissions and
16 #   limitations under the License.
17 #
18 ##############################################################################
19
20 echo $(date -u) "delete-from-k8s started"
21
22 # Delete R1-SME-Manager with Capifcore
23 kubectl delete -f ../manifests/servicemanager.yaml
24 kubectl delete configmap env-configmap -n servicemanager
25 kubectl delete -f ../manifests/capifcore.yaml
26 kubectl delete ns servicemanager
27
28 # Delete Kong
29 go run ../../internal/kongclearup.go
30 helm uninstall kong -n kong
31 helm repo remove kong
32 kubectl wait deploy/kong-kong --for=delete --timeout=-300s -n kong 
33
34 # Delete storage for the Postgres used by Kong
35 kubectl delete -f ../manifests/kong-postgres-pvc.yaml
36 kubectl delete ns kong
37
38 echo $(date -u) "delete-from-k8s completed"