3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2022 Nordix Foundation.
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
24 echo "No argument supplied"
30 if [ "$OPERATION" == "deploy" ]; then
31 echo "Deploying applications..."
32 echo "-------------------------"
33 istioctl kube-inject -f postgres.yaml | kubectl apply -f -
35 istioctl kube-inject -f keycloak.yaml | kubectl apply -f -
37 echo "Waiting for pods to start..."
38 echo "----------------------------"
39 kubectl wait deployment -n default postgres --for=condition=available --timeout=90s
40 kubectl wait deployment -n default keycloak --for=condition=available --timeout=300s
42 echo "Checking pod status..."
43 echo "----------------------"
44 kubectl get pods -n default
45 elif [ "$OPERATION" == "undeploy" ]; then
46 echo "Undeploying applications..."
47 echo "---------------------------"
48 kubectl delete -f keycloak.yaml
49 kubectl delete -f postgres.yaml
51 echo "Unrecogized operation ${OPERATION}"