summaryrefslogtreecommitdiff
path: root/contrib/k8s-emc/acme-hack/do.sh
blob: 3c2b5e369d21603886c30b6d475fe40d5e705074 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

declare -A domains
domains[emc-live]="emc-live.elev8.at"
domains[emc-stats]="emc-stats.elev8.at"
domains[stream-elev8]="stream.elev8.at"
domains[stream-elevate]="stream.elevate.at"

kubectl apply -f nginx-acme-cm.yml
kubectl apply -f nginx-acme-deploy.yml
kubectl apply -f nginx-acme-svc.yml
for name in "${!domains[@]}"; do
  cat nginx-acme-ingress.yml | sed "s/<<name>>/$name/g" | sed "s/<<hostname>>/${domains[$name]}/g" | kubectl apply -f -
done

### TODO: wait for all pods and then contiune the script
#exit 0

ssh emc-00 systemctl start acmetool

for name in "${!domains[@]}"; do
  ssh emc-00 kubectl -n emc create secret tls "$name\-tls" "--cert=/var/lib/acme/live/${domains[$name]}/fullchain" "--key=/var/lib/acme/live/${domains[$name]}/privkey" --dry-run -o json | kubectl apply -f -
done