-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcert-manager-setup.sh
executable file
·57 lines (46 loc) · 1.06 KB
/
cert-manager-setup.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
set -o xtrace
set -o errexit
set -o nounset
set -o pipefail
source ./env.sh $1
setupCertManager() {
local cluster=${1}
helm upgrade \
cert-manager ./charts/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.16.1 \
--values=./charts/cert-manager/"values-${cluster}".yaml \
--install \
--wait \
--kube-context=kind-${cluster}
}
createIssuer() {
local cluster=${1}
kubectl apply --context=kind-${cluster} -f - <<EOF
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: istio-ca
namespace: istio-system
spec:
vault:
server: http://host.docker.internal:8200
path: pki_int_${cluster}/sign/istio-ca-${cluster}
auth:
kubernetes:
mountPath: /v1/auth/${cluster}
role: issuer
secretRef:
name: issuer-token-lmzpj
key: token
EOF
}
main () {
helm repo add jetstack https://charts.jetstack.io
for cluster in ${CLUSTERS[@]}; do
setupCertManager ${cluster}
createIssuer ${cluster}
done
}
main