-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy-oci.sh
36 lines (29 loc) · 984 Bytes
/
deploy-oci.sh
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
#!/bin/bash
##
# The script is expected to run in the OCI Cloud console
#
NAMESPACE=cinema-reservation
kubectl delete namespace ${NAMESPACE}
kubectl create namespace ${NAMESPACE}
kubectl config set-context --current --namespace=${NAMESPACE}
TENANCY_NAMESPACE=$(oci os ns get --query "data" --raw-output)
REGION_KEY=${OCI_CONFIG_PROFILE}
OCI_IMAGE_REGISTRY=${REGION_KEY}.ocir.io/${TENANCY_NAMESPACE}
cat <<EOF >./kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- booking-db/app.yaml
- payment-service/app.yaml
- seat-booking-service/app.yaml
- lra-coordinator-service/app.yaml
- oci-lb.yaml
images:
- name: cinema-reservation/payment-service
newName: ${OCI_IMAGE_REGISTRY}/cinema-reservation/payment-service
newTag: "1.0"
- name: cinema-reservation/seat-booking-service
newName: ${OCI_IMAGE_REGISTRY}/cinema-reservation/seat-booking-service
newTag: "1.0"
EOF
kubectl apply -k . --namespace ${NAMESPACE}