-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathupgrade.sh
executable file
·70 lines (68 loc) · 1.51 KB
/
upgrade.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
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
RELEASE=${1:-6.001205}
REPO=${2:-gcr.io/cloud-marketplace/redislabs-public/redis-enterprise)
SA=$3
RELEASE_SUFFIX=$(echo $RELEASE | sed s/\\./-/g)
if [ -z "$SA" ];
then
SA=redis-enterprise-operator-upgrade-${RELEASE_SUFFIX}
cat <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: redis-enterprise-operator
name: ${SA}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/name: redis-enterprise-operator
name: ${SA}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: ${SA}
---
EOF
fi
cat <<EOF
apiVersion: batch/v1
kind: Job
metadata:
labels:
app.kubernetes.io/name: redis-enterprise-operator
name: redis-enterprise-operator-deployer-${RELEASE_SUFFIX}
spec:
backoffLimit: 0
template:
metadata:
annotations:
sidecar.istio.io/inject: 'false'
spec:
containers:
- command:
- /bin/deploy.sh
image: ${REPO}/deployer:${RELEASE}
imagePullPolicy: Always
name: deployer
resources:
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- mountPath: /data/values.yaml
name: config-volume
readOnly: true
subPath: values.yaml
restartPolicy: Never
serviceAccountName: $SA
volumes:
- name: config-volume
secret:
secretName: redis-enterprise-operator-deployer-config
EOF