-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.bash
More file actions
executable file
·46 lines (37 loc) · 1.21 KB
/
deploy.bash
File metadata and controls
executable file
·46 lines (37 loc) · 1.21 KB
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
46
#!/usr/bin/env bash
ns="holvi"
uninstall() {
kubectl -n $ns delete -f holvi.yaml
kubectl -n $ns delete secret holvi-keys holvi-certs
kubectl -n $ns delete pvc -l vault_cr=holvi
kubectl -n $ns delete -f hop.yaml
kubectl delete ns $ns
}
if [[ $1 = "-r" ]]; then
printf "%s\n" "Redeploying..."
uninstall
sleep 1
elif [[ $1 = "-u" ]]; then
printf "%s\n" "Removing..."
uninstall
exit 0
elif [[ $1 = "-h" ]]; then
printf "%s\n\n" "Usage: ./deploy.bash [options]"
printf "%s\n" "The script will deploy holvi when no options are provided"
printf "%s\n" "Other options:"
printf "\t%s\t%s\n" "-r" "Redeploy holvi"
printf "\t%s\t%s\n" "-u" "Uninstall holvi"
printf "\t%s\t%s\n" "-h" "This help prompt"
exit 0
else
printf "%s\n" "Deploying..."
fi
kubectl apply -f https://raw.githubusercontent.com/bank-vaults/vault-operator/main/deploy/crd.yaml
kubectl create ns $ns
# Create TLS secret
kubectl -n $ns create secret generic holvi-certs \
--from-file=tls.crt=certs/holvi.pem --from-file=tls.key=certs/holvi-key.pem --from-file=ca.crt=certs/root.pem
# Create operator
kubectl -n $ns apply -f hop.yaml
# Create holvi
kubectl -n $ns apply -f holvi.yaml