-
Notifications
You must be signed in to change notification settings - Fork 141
/
opcua-configuration.yaml
193 lines (192 loc) · 8.07 KB
/
opcua-configuration.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
187
188
189
190
191
192
193
{{- if .Values.opcua.configuration.enabled }}
apiVersion: {{ printf "%s/%s" .Values.crds.group .Values.crds.version }}
kind: Configuration
metadata:
name: {{ .Values.opcua.configuration.name }}
spec:
discoveryHandler:
name: opcua
discoveryDetails: |+
opcuaDiscoveryMethod:
standard:
discoveryUrls:
{{- toYaml .Values.opcua.configuration.discoveryDetails.discoveryUrls | nindent 10 }}
applicationNames:
action: {{ .Values.opcua.configuration.discoveryDetails.applicationNames.action }}
{{- if .Values.opcua.configuration.discoveryDetails.applicationNames.items}}
items:
{{- toYaml .Values.opcua.configuration.discoveryDetails.applicationNames.items | nindent 8 }}
{{- else }}
items: []
{{- end }}
{{- if or .Values.opcua.configuration.brokerPod.image.repository .Values.opcua.configuration.brokerJob.image.repository }}
{{- /* Only add brokerSpec if a broker image is provided */}}
brokerSpec:
{{- if .Values.opcua.configuration.brokerPod.image.repository }}
brokerPodSpec:
containers:
- name: {{ .Values.opcua.configuration.name }}-broker
image: {{ printf "%s:%s" .Values.opcua.configuration.brokerPod.image.repository .Values.opcua.configuration.brokerPod.image.tag | quote }}
{{- with .Values.opcua.configuration.brokerPod.image.pullPolicy }}
imagePullPolicy: {{ . }}
{{- end }}
{{- if .Values.opcua.configuration.brokerPod.env }}
env:
{{- range $key, $val := .Values.opcua.configuration.brokerPod.env }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if .Values.opcua.configuration.brokerPod.envFrom }}
envFrom:
{{- range $val := .Values.opcua.configuration.brokerPod.envFrom.secretRef }}
- secretRef:
name: {{ $val | quote }}
{{- end }}
{{- range $val := .Values.opcua.configuration.brokerPod.envFrom.configMapRef }}
- configMapRef:
name: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if .Values.opcua.configuration.brokerPod.env }}
env:
{{- range $key, $val := .Values.opcua.configuration.brokerPod.env }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end }}
{{- end }}
resources:
requests:
{{`"{{PLACEHOLDER}}"`}} : "1"
memory: {{ .Values.opcua.configuration.brokerPod.resources.memoryRequest }}
cpu: {{ .Values.opcua.configuration.brokerPod.resources.cpuRequest }}
limits:
{{`"{{PLACEHOLDER}}"`}} : "1"
memory: {{ .Values.opcua.configuration.brokerPod.resources.memoryLimit }}
cpu: {{ .Values.opcua.configuration.brokerPod.resources.cpuLimit }}
{{- if or .Values.opcua.configuration.brokerPod.volumeMounts .Values.opcua.configuration.mountCertificates }}
volumeMounts:
{{- with .Values.opcua.configuration.brokerPod.volumeMounts}}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.opcua.configuration.mountCertificates}}
- name: credentials
mountPath: "/etc/opcua-certs/client-pki"
readOnly: false
{{- end }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if or .Values.opcua.configuration.brokerPod.volumeMounts .Values.opcua.configuration.mountCertificates }}
volumes:
{{- with .Values.opcua.configuration.brokerPod.volumes}}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.opcua.configuration.mountCertificates }}
- name: credentials
secret:
secretName: opcua-broker-credentials
items:
- key: client_certificate
path: own/certs/AkriBroker.der
- key: client_key
path: own/private/AkriBroker.pfx
- key: ca_certificate
path: trusted/certs/SomeCA.der
- key: ca_crl
path: trusted/crl/SomeCA.crl
{{- end }}
{{- end }}
{{- else }}
brokerJobSpec:
template:
spec:
containers:
- name: {{ .Values.opcua.configuration.name }}-broker
image: {{ printf "%s:%s" .Values.opcua.configuration.brokerJob.image.repository .Values.opcua.configuration.brokerPod.image.tag | quote }}
{{- if .Values.opcua.configuration.brokerJob.command }}
command:
{{- toYaml .Values.opcua.configuration.brokerJob.command | nindent 14 }}
{{- end }}
{{- with .Values.opcua.configuration.pullPolicy }}
imagePullPolicy: {{ . }}
{{- end }}
{{- if .Values.opcua.configuration.brokerJob.env }}
env:
{{- range $key, $val := .Values.opcua.configuration.brokerJob.env }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if .Values.opcua.configuration.brokerJob.envFrom }}
envFrom:
{{- range $val := .Values.opcua.configuration.brokerJob.envFrom.secretRef }}
- secretRef:
name: {{ $val | quote }}
{{- end }}
{{- range $val := .Values.opcua.configuration.brokerJob.envFrom.configMapRef }}
- configMapRef:
name: {{ $val | quote }}
{{- end }}
{{- end }}
resources:
requests:
{{`"{{PLACEHOLDER}}"`}} : "1"
memory: {{ .Values.opcua.configuration.brokerJob.resources.memoryRequest }}
cpu: {{ .Values.opcua.configuration.brokerJob.resources.cpuRequest }}
limits:
{{`"{{PLACEHOLDER}}"`}} : "1"
memory: {{ .Values.opcua.configuration.brokerJob.resources.memoryLimit }}
cpu: {{ .Values.opcua.configuration.brokerJob.resources.cpuLimit }}
{{- with .Values.opcua.configuration.brokerJob.volumeMounts}}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.opcua.configuration.brokerJob.volumes}}
volumes:
{{- toYaml . | nindent 10 }}
{{- end }}
restartPolicy: {{ .Values.opcua.configuration.brokerJob.restartPolicy }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 10 }}
{{- end }}
backoffLimit: {{ .Values.opcua.configuration.brokerJob.backoffLimit }}
parallelism: {{ .Values.opcua.configuration.brokerJob.parallelism }}
completions: {{ .Values.opcua.configuration.brokerJob.completions }}
{{- end }}
{{- end }}
{{- /* Only add service specs if a broker image was specified and service
creation was not disabled */}}
{{- if .Values.opcua.configuration.brokerPod.image.repository }}
{{- if .Values.opcua.configuration.createInstanceServices }}
instanceServiceSpec:
type: {{ .Values.opcua.configuration.instanceService.type }}
ports:
- name: grpc
port: {{ .Values.opcua.configuration.instanceService.port }}
protocol: {{ .Values.opcua.configuration.instanceService.protocol }}
targetPort: {{ .Values.opcua.configuration.instanceService.targetPort }}
{{- end }}
{{- if .Values.opcua.configuration.createConfigurationService }}
configurationServiceSpec:
type: {{ .Values.opcua.configuration.configurationService.type }}
ports:
- name: grpc
port: {{ .Values.opcua.configuration.configurationService.port }}
protocol: {{ .Values.opcua.configuration.configurationService.protocol }}
targetPort: {{ .Values.opcua.configuration.configurationService.targetPort }}
{{- end }}
{{- end }}
{{- if .Values.opcua.configuration.brokerProperties }}
brokerProperties:
{{- range $key, $val := .Values.opcua.configuration.brokerProperties }}
{{- $key | nindent 4 }}: {{ $val | quote }}
{{- end }}
{{- else }}
brokerProperties: {}
{{- end }}
capacity: {{ .Values.opcua.configuration.capacity }}
{{- end }}