-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
jobs.yaml
186 lines (185 loc) · 6.84 KB
/
jobs.yaml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Release.Name }}-job-st2-register-content
labels:
app: st2-register-content
tier: backend
vendor: stackstorm
support: enterprise
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
helm.sh/hook: post-install, post-upgrade, post-rollback
helm.sh/hook-delete-policy: before-hook-creation
helm.sh/hook-weight: "5"
spec:
template:
metadata:
name: job-st2-register-content
labels:
app: st2-register-content
tier: backend
vendor: stackstorm
support: enterprise
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
checksum/packs: {{ include (print $.Template.BasePath "/configmaps_packs.yaml") . | sha256sum }}
spec:
imagePullSecrets:
- name: {{ .Release.Name }}-st2-license
{{ if .Values.st2.packs.image.repository }}
initContainers:
# Merge packs and virtualenvs from st2actionrunner-enterprise with those from the st2.packs image
# Custom packs
- name: st2-custom-packs
image: "{{ .Values.st2.packs.image.repository }}/{{ .Values.st2.packs.image.name }}:{{ .Values.st2.packs.image.tag }}"
imagePullPolicy: {{ .Values.st2.packs.image.pullPolicy | quote }}
volumeMounts:
- name: st2-packs-vol
mountPath: /opt/stackstorm/packs-shared
- name: st2-virtualenvs-vol
mountPath: /opt/stackstorm/virtualenvs-shared
command:
- 'sh'
- '-ec'
- |
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
# System packs
- name: st2-system-packs
image: "{{ .Values.image.repository }}/st2actionrunner-enterprise:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: st2-packs-vol
mountPath: /opt/stackstorm/packs-shared
command:
- 'sh'
- '-ec'
- |
/bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
/bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
{{ end }}
containers:
- name: st2-register-content
image: "{{ .Values.image.repository }}/st2actionrunner-enterprise:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- st2-register-content
- --config-file=/etc/st2/st2.conf
- --config-file=/etc/st2/st2.docker.conf
- --config-file=/etc/st2/st2.user.conf
- --register-all
- --register-fail-on-failure
volumeMounts:
- name: st2-config-vol
mountPath: /etc/st2/st2.docker.conf
subPath: st2.docker.conf
- name: st2-config-vol
mountPath: /etc/st2/st2.user.conf
subPath: st2.user.conf
- name: st2-pack-configs-vol
mountPath: /opt/stackstorm/configs/
{{ if .Values.st2.packs.image.repository }}
- name: st2-packs-vol
mountPath: /opt/stackstorm/packs/
- name: st2-virtualenvs-vol
mountPath: /opt/stackstorm/virtualenvs/
{{ end }}
# TODO: Find out default resource limits for this specific service (#5)
#resources:
volumes:
- name: st2-config-vol
configMap:
name: {{ .Release.Name }}-st2-config
- name: st2-pack-configs-vol
configMap:
name: {{ .Release.Name }}-st2-pack-configs
{{ if .Values.st2.packs.image.repository }}
- name: st2-packs-vol
emptyDir: {}
- name: st2-virtualenvs-vol
emptyDir: {}
{{ end }}
restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Release.Name }}-job-st2-apply-rbac-definitions
labels:
app: st2-apply-rbac-definitions
tier: backend
vendor: stackstorm
support: enterprise
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
helm.sh/hook: post-install, post-upgrade, post-rollback
helm.sh/hook-delete-policy: before-hook-creation
helm.sh/hook-weight: "6"
spec:
template:
metadata:
name: job-st2-apply-rbac-definitions
labels:
app: st2-apply-rbac-definitions
tier: backend
vendor: stackstorm
support: enterprise
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
checksum/rbac: {{ include (print $.Template.BasePath "/configmaps_rbac.yaml") . | sha256sum }}
spec:
imagePullSecrets:
- name: {{ .Release.Name }}-st2-license
containers:
- name: st2-apply-rbac-definitions
image: "{{ .Values.image.repository }}/st2actionrunner-enterprise:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- st2-apply-rbac-definitions
- --verbose
- --config-file=/etc/st2/st2.conf
- --config-file=/etc/st2/st2.docker.conf
- --config-file=/etc/st2/st2.user.conf
volumeMounts:
- name: st2-config-vol
mountPath: /etc/st2/st2.docker.conf
subPath: st2.docker.conf
- name: st2-config-vol
mountPath: /etc/st2/st2.user.conf
subPath: st2.user.conf
- name: st2-rbac-roles-vol
mountPath: /opt/stackstorm/rbac/roles/
- name: st2-rbac-assignments-vol
mountPath: /opt/stackstorm/rbac/assignments/
- name: st2-rbac-mappings-vol
mountPath: /opt/stackstorm/rbac/mappings/
# TODO: Find out default resource limits for this specific service (#5)
#resources:
volumes:
- name: st2-config-vol
configMap:
name: {{ .Release.Name }}-st2-config
- name: st2-rbac-roles-vol
configMap:
name: {{ .Release.Name }}-st2-rbac-roles
- name: st2-rbac-assignments-vol
configMap:
name: {{ .Release.Name }}-st2-rbac-assignments
- name: st2-rbac-mappings-vol
configMap:
name: {{ .Release.Name }}-st2-rbac-mappings
restartPolicy: OnFailure