Skip to content

Commit 8a18cc4

Browse files
authored
[FLINK-37911][Helm] Reorganize Helm chart templates
1 parent a3f14ef commit 8a18cc4

24 files changed

+1052
-791
lines changed
Lines changed: 17 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
################################################################################
2-
# Licensed to the Apache Software Foundation (ASF) under one
3-
# or more contributor license agreements. See the NOTICE file
4-
# distributed with this work for additional information
5-
# regarding copyright ownership. The ASF licenses this file
6-
# to you under the Apache License, Version 2.0 (the
7-
# "License"); you may not use this file except in compliance
8-
# with the License. You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
17-
################################################################################
1+
{{- /*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/ -}}
1818

1919
{{/*
2020
Expand the name of the chart.
@@ -77,121 +77,3 @@ Create the path of the operator image to use
7777
{{- .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}
7878
{{- end }}
7979
{{- end }}
80-
81-
{{/*
82-
Create the name of the operator role to use
83-
*/}}
84-
{{- define "flink-operator.roleName" -}}
85-
{{- if .Values.rbac.operatorRole.create }}
86-
{{- default (include "flink-operator.fullname" .) .Values.rbac.operatorRole.name }}
87-
{{- else }}
88-
{{- default "default" .Values.rbac.operatorRole.name }}
89-
{{- end }}
90-
{{- end }}
91-
92-
{{/*
93-
Create the name of the operator role binding to use
94-
*/}}
95-
{{- define "flink-operator.roleBindingName" -}}
96-
{{- if .Values.rbac.operatorRoleBinding.create }}
97-
{{- default (include "flink-operator.fullname" .) .Values.rbac.operatorRoleBinding.name }}
98-
{{- else }}
99-
{{- default "default" .Values.rbac.operatorRoleBinding.name }}
100-
{{- end }}
101-
{{- end }}
102-
103-
{{/*
104-
Create the name of the job role to use
105-
*/}}
106-
{{- define "flink-operator.jobRoleName" -}}
107-
{{- if .Values.rbac.jobRoleBinding.create }}
108-
{{- default (include "flink-operator.fullname" .) .Values.rbac.jobRole.name }}
109-
{{- else }}
110-
{{- default "default" .Values.rbac.jobRole.name }}
111-
{{- end }}
112-
{{- end }}
113-
114-
{{/*
115-
Create the name of the job role to use
116-
*/}}
117-
{{- define "flink-operator.jobRoleBindingName" -}}
118-
{{- if .Values.rbac.jobRole.create }}
119-
{{- default (include "flink-operator.fullname" .) .Values.rbac.jobRoleBinding.name }}
120-
{{- else }}
121-
{{- default "default" .Values.rbac.jobRoleBinding.name }}
122-
{{- end }}
123-
{{- end }}
124-
125-
126-
{{/*
127-
Create the name of the operator service account to use
128-
*/}}
129-
{{- define "flink-operator.serviceAccountName" -}}
130-
{{- if .Values.operatorServiceAccount.create }}
131-
{{- default (include "flink-operator.fullname" .) .Values.operatorServiceAccount.name }}
132-
{{- else }}
133-
{{- default "default" .Values.operatorServiceAccount.name }}
134-
{{- end }}
135-
{{- end }}
136-
137-
{{/*
138-
Create the name of the job service account to use
139-
*/}}
140-
{{- define "flink-operator.jobServiceAccountName" -}}
141-
{{- if .Values.jobServiceAccount.create }}
142-
{{- default (include "flink-operator.fullname" .) .Values.jobServiceAccount.name }}
143-
{{- else }}
144-
{{- default "default" .Values.jobServiceAccount.name }}
145-
{{- end }}
146-
{{- end }}
147-
148-
{{/*
149-
Determine role scope based on name
150-
*/}}
151-
{{- define "flink-operator.roleScope" -}}
152-
{{- if contains ":" .role }}
153-
{{- printf "ClusterRole" }}
154-
{{- else }}
155-
{{- printf "Role" }}
156-
{{- end }}
157-
{{- end }}
158-
159-
{{- define "flink-operator.validating-webhook-enabled" -}}
160-
{{- if hasKey .Values.webhook "validator" }}
161-
{{- if .Values.webhook.validator.create }}
162-
{{- printf "true" }}
163-
{{- else }}
164-
{{- printf "false" }}
165-
{{- end }}
166-
{{- else }}
167-
{{- if or (.Values.webhook.create) }}
168-
{{- printf "true" }}
169-
{{- else }}
170-
{{- printf "false" }}
171-
{{- end }}
172-
{{- end }}
173-
{{- end }}
174-
175-
{{- define "flink-operator.mutating-webhook-enabled" -}}
176-
{{- if hasKey .Values.webhook "mutator" }}
177-
{{- if .Values.webhook.mutator.create }}
178-
{{- printf "true" }}
179-
{{- else }}
180-
{{- printf "false" }}
181-
{{- end }}
182-
{{- else }}
183-
{{- if or (.Values.webhook.create) }}
184-
{{- printf "true" }}
185-
{{- else }}
186-
{{- printf "false" }}
187-
{{- end }}
188-
{{- end }}
189-
{{- end }}
190-
191-
{{- define "flink-operator.webhook-enabled" -}}
192-
{{- if or (eq (include "flink-operator.validating-webhook-enabled" .) "true") (eq (include "flink-operator.mutating-webhook-enabled" .) "true") }}
193-
{{- printf "true" }}
194-
{{- else }}
195-
{{- printf "false" }}
196-
{{- end }}
197-
{{- end }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{{- /*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/ -}}
18+
19+
{{- if eq (include "flink-operator.webhook-enabled" .) "true" }}
20+
apiVersion: cert-manager.io/v1
21+
kind: Certificate
22+
metadata:
23+
name: flink-operator-serving-cert
24+
namespace: {{ .Release.Namespace }}
25+
spec:
26+
dnsNames:
27+
- flink-operator-webhook-service.{{ .Release.Namespace }}.svc
28+
- flink-operator-webhook-service.{{ .Release.Namespace }}.svc.cluster.local
29+
keystores:
30+
pkcs12:
31+
create: true
32+
passwordSecretRef:
33+
{{- if .Values.webhook.keystore.useDefaultPassword }}
34+
name: flink-operator-webhook-secret
35+
key: password
36+
{{- else }}
37+
{{- with .Values.webhook.keystore.passwordSecretRef }}
38+
{{- toYaml . | nindent 8 }}
39+
{{- end }}
40+
{{- end }}
41+
issuerRef:
42+
kind: Issuer
43+
name: flink-operator-selfsigned-issuer
44+
commonName: FlinkDeployment Validator
45+
secretName: webhook-server-cert
46+
{{- end }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- /*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/ -}}
18+
19+
{{- if eq (include "flink-operator.webhook-enabled" .) "true" }}
20+
apiVersion: cert-manager.io/v1
21+
kind: Issuer
22+
metadata:
23+
name: flink-operator-selfsigned-issuer
24+
namespace: {{ .Release.Namespace }}
25+
spec:
26+
selfSigned: {}
27+
{{- end }}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{{- /*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/ -}}
16+
17+
{{- if .Values.defaultConfiguration.create }}
18+
apiVersion: v1
19+
kind: ConfigMap
20+
metadata:
21+
name: flink-operator-config
22+
namespace: {{ .Release.Namespace }}
23+
labels:
24+
{{- include "flink-operator.labels" . | nindent 4 }}
25+
data:
26+
config.yaml: |+
27+
{{- if .Values.defaultConfiguration.append }}
28+
{{- $.Files.Get "conf/flink-conf.yaml" | nindent 4 -}}
29+
{{- end }}
30+
{{- if hasKey (.Values.defaultConfiguration) "config.yaml" }}
31+
{{- index (.Values.defaultConfiguration) "config.yaml" | nindent 4 -}}
32+
{{- end }}
33+
{{- if .Values.watchNamespaces }}
34+
kubernetes.operator.watched.namespaces: {{ join "," .Values.watchNamespaces }}
35+
{{- end }}
36+
{{- if index .Values "operatorHealth" }}
37+
kubernetes.operator.health.probe.enabled: true
38+
kubernetes.operator.health.probe.port: {{ .Values.operatorHealth.port }}
39+
{{- end }}
40+
flink-conf.yaml: |+
41+
{{- if .Values.defaultConfiguration.append }}
42+
{{- $.Files.Get "conf/flink-conf.yaml" | nindent 4 -}}
43+
{{- end }}
44+
{{- if hasKey (.Values.defaultConfiguration) "flink-conf.yaml" }}
45+
{{- index (.Values.defaultConfiguration) "flink-conf.yaml" | nindent 4 -}}
46+
{{- end }}
47+
{{- if .Values.watchNamespaces }}
48+
kubernetes.operator.watched.namespaces: {{ join "," .Values.watchNamespaces }}
49+
{{- end }}
50+
{{- if index .Values "operatorHealth" }}
51+
kubernetes.operator.health.probe.enabled: true
52+
kubernetes.operator.health.probe.port: {{ .Values.operatorHealth.port }}
53+
{{- end }}
54+
log4j-operator.properties: |+
55+
{{- if .Values.defaultConfiguration.append }}
56+
{{- $.Files.Get "conf/log4j-operator.properties" | nindent 4 -}}
57+
{{- end }}
58+
{{- if index (.Values.defaultConfiguration) "log4j-operator.properties" }}
59+
{{- index (.Values.defaultConfiguration) "log4j-operator.properties" | nindent 4 -}}
60+
{{- end }}
61+
log4j-console.properties: |+
62+
{{- if .Values.defaultConfiguration.append }}
63+
{{- $.Files.Get "conf/log4j-console.properties" | nindent 4 -}}
64+
{{- end }}
65+
{{- if index (.Values.defaultConfiguration) "log4j-console.properties" }}
66+
{{- index (.Values.defaultConfiguration) "log4j-console.properties" | nindent 4 -}}
67+
{{- end }}
68+
{{- end }}

helm/flink-kubernetes-operator/templates/flink-operator.yaml renamed to helm/flink-kubernetes-operator/templates/controller/deployment.yaml

Lines changed: 16 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
################################################################################
2-
# Licensed to the Apache Software Foundation (ASF) under one
3-
# or more contributor license agreements. See the NOTICE file
4-
# distributed with this work for additional information
5-
# regarding copyright ownership. The ASF licenses this file
6-
# to you under the Apache License, Version 2.0 (the
7-
# "License"); you may not use this file except in compliance
8-
# with the License. You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
17-
################################################################################
18-
---
1+
{{- /*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/ -}}
16+
1917
apiVersion: apps/v1
2018
kind: Deployment
2119
metadata:
@@ -273,56 +271,3 @@ spec:
273271
secretName: {{ .Values.tls.secretName }}
274272
optional: true
275273
{{- end }}
276-
---
277-
{{- if .Values.defaultConfiguration.create }}
278-
apiVersion: v1
279-
kind: ConfigMap
280-
metadata:
281-
name: flink-operator-config
282-
namespace: {{ .Release.Namespace }}
283-
labels:
284-
{{- include "flink-operator.labels" . | nindent 4 }}
285-
data:
286-
config.yaml: |+
287-
{{- if .Values.defaultConfiguration.append }}
288-
{{- $.Files.Get "conf/flink-conf.yaml" | nindent 4 -}}
289-
{{- end }}
290-
{{- if hasKey (.Values.defaultConfiguration) "config.yaml" }}
291-
{{- index (.Values.defaultConfiguration) "config.yaml" | nindent 4 -}}
292-
{{- end }}
293-
{{- if .Values.watchNamespaces }}
294-
kubernetes.operator.watched.namespaces: {{ join "," .Values.watchNamespaces }}
295-
{{- end }}
296-
{{- if index .Values "operatorHealth" }}
297-
kubernetes.operator.health.probe.enabled: true
298-
kubernetes.operator.health.probe.port: {{ .Values.operatorHealth.port }}
299-
{{- end }}
300-
flink-conf.yaml: |+
301-
{{- if .Values.defaultConfiguration.append }}
302-
{{- $.Files.Get "conf/flink-conf.yaml" | nindent 4 -}}
303-
{{- end }}
304-
{{- if hasKey (.Values.defaultConfiguration) "flink-conf.yaml" }}
305-
{{- index (.Values.defaultConfiguration) "flink-conf.yaml" | nindent 4 -}}
306-
{{- end }}
307-
{{- if .Values.watchNamespaces }}
308-
kubernetes.operator.watched.namespaces: {{ join "," .Values.watchNamespaces }}
309-
{{- end }}
310-
{{- if index .Values "operatorHealth" }}
311-
kubernetes.operator.health.probe.enabled: true
312-
kubernetes.operator.health.probe.port: {{ .Values.operatorHealth.port }}
313-
{{- end }}
314-
log4j-operator.properties: |+
315-
{{- if .Values.defaultConfiguration.append }}
316-
{{- $.Files.Get "conf/log4j-operator.properties" | nindent 4 -}}
317-
{{- end }}
318-
{{- if index (.Values.defaultConfiguration) "log4j-operator.properties" }}
319-
{{- index (.Values.defaultConfiguration) "log4j-operator.properties" | nindent 4 -}}
320-
{{- end }}
321-
log4j-console.properties: |+
322-
{{- if .Values.defaultConfiguration.append }}
323-
{{- $.Files.Get "conf/log4j-console.properties" | nindent 4 -}}
324-
{{- end }}
325-
{{- if index (.Values.defaultConfiguration) "log4j-console.properties" }}
326-
{{- index (.Values.defaultConfiguration) "log4j-console.properties" | nindent 4 -}}
327-
{{- end }}
328-
{{- end }}

0 commit comments

Comments
 (0)