-
Notifications
You must be signed in to change notification settings - Fork 205
/
operator_deployment.yml.tmpl
100 lines (100 loc) · 2.98 KB
/
operator_deployment.yml.tmpl
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
apiVersion: apps/v1
kind: Deployment
metadata:
{{- if .DevSupport }}
annotations:
#
# Sets a trigger on this deployment to overwrite
# the template.spec.image property and point to
# the syndesis-operator image stream.
#
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"syndesis-operator:{{.Tag}}"},"fieldPath":"spec.template.spec.containers[?(@.name==\"syndesis-operator\")].image"}]'
{{end}}
name: syndesis-operator
labels:
app: syndesis
syndesis.io/app: syndesis
syndesis.io/type: operator
syndesis.io/component: syndesis-operator
spec:
replicas: 1
selector:
matchLabels:
name: syndesis-operator
syndesis.io/app: syndesis
syndesis.io/type: operator
syndesis.io/component: syndesis-operator
template:
metadata:
labels:
name: syndesis-operator
syndesis.io/app: syndesis
syndesis.io/type: operator
syndesis.io/component: syndesis-operator
spec:
serviceAccountName: syndesis-operator
containers:
- name: syndesis-operator
#
# Image will always start out being set to the release .Image:.Tag pair
# In openshift this would be overwritten by the trigger annotation
# -- Requires DevSupport = true
# -- Requires imagePullPolicy = Always (otherwise annotation does nothing)
# -- Developer provides a new image in the associated imagestream
#
image: {{.Image}}:{{.Tag}}
{{- if .DevSupport}}
imagePullPolicy: Always
{{else}}
imagePullPolicy: IfNotPresent
{{end}}
ports:
- containerPort: 60000
name: metrics
{{- if gt .LogLevel 0}}
args:
- '--zap-level={{.LogLevel}}'
{{- end}}
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "syndesis-operator"
{{- if .DevSupport }}
- name: DEV_SUPPORT
value: "{{.DevSupport}}"
{{- end}}
volumeMounts:
- name: syndesis-operator-data
mountPath: /data
initContainers:
- name: operator-init
image: {{.Image}}:{{.Tag}}
imagePullPolicy: Always
command: ["/usr/local/bin/operator-init"]
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: PRODUCT_NAME
value: {{.ProductName}}
- command:
- bash
- -c
- "postgres -V > /data/postgresql.txt"
image: '{{.DatabaseImage}}'
imagePullPolicy: Always
name: postgres-version
volumeMounts:
- name: syndesis-operator-data
mountPath: /data
volumes:
- name: syndesis-operator-data
emptyDir: {}