-
Notifications
You must be signed in to change notification settings - Fork 406
/
crd-init-hydra-master.yaml
47 lines (47 loc) · 1.37 KB
/
crd-init-hydra-master.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
---
apiVersion: batch/v1
kind: Job
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-crd-init
annotations:
"helm.sh/hook-delete-policy": "before-hook-creation, hook-succeeded"
"helm.sh/hook": "pre-install, pre-upgrade"
"helm.sh/hook-weight": "10"
spec:
template:
metadata:
annotations:
sidecar.istio.io/inject: "false"
spec:
serviceAccountName: {{ .Release.Name }}-crd-init
containers:
- name: {{ .Release.Name }}-crd-oauth2clients
image: "{{ .Values.jobs.image.repository }}:{{ .Values.jobs.image.tag }}"
volumeMounts:
- name: crd-oauth2clients
mountPath: /etc/crd
readOnly: true
command:
- /bin/bash
- -c
- |
timeout 60s bash -c 'until kubectl apply -f /etc/crd/oauth2clients.yaml; do sleep 2; done'
volumes:
- name: crd-oauth2clients
configMap:
name: {{ .Release.Name }}-crd-oauth2clients
restartPolicy: OnFailure
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-crd-oauth2clients
annotations:
"helm.sh/hook": "pre-install, pre-upgrade"
"helm.sh/hook-weight": "1"
"helm.sh/hook-delete-policy": "before-hook-creation"
data:
oauth2clients.yaml: |-
{{.Files.Get "files/crd-oauth2clients.yaml" | printf "%s" | indent 4}}