Skip to content

Commit d1f28bc

Browse files
committed
Refactor Helm chart
Signed-off-by: Yi Chen <[email protected]>
1 parent 2bf49a2 commit d1f28bc

29 files changed

+1423
-1052
lines changed
Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
118
# Patterns to ignore when building packages.
219
# This supports shell glob matching, relative path matching, and
320
# negation (prefixed with !). Only one pattern per line.
4-
.DS_Store
21+
22+
ci/
23+
24+
# helm-unittest
25+
./tests
26+
.debug
27+
__snapshot__
28+
29+
# helm-docs
30+
README.md.gotmpl
31+
532
# Common VCS dirs
633
.git/
734
.gitignore
@@ -10,14 +37,19 @@
1037
.hg/
1138
.hgignore
1239
.svn/
40+
1341
# Common backup files
1442
*.swp
1543
*.bak
1644
*.tmp
1745
*.orig
1846
*~
47+
1948
# Various IDEs
2049
.project
2150
.idea/
2251
*.tmproj
2352
.vscode/
53+
54+
# MacOS
55+
.DS_Store

helm/flink-kubernetes-operator/Chart.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,18 @@
1616
# limitations under the License.
1717
################################################################################
1818

19-
---
2019
apiVersion: v2
20+
2121
name: flink-kubernetes-operator
22+
2223
description: A Helm chart for the Apache Flink Kubernetes Operator
24+
2325
type: application
26+
2427
version: 1.12-SNAPSHOT
28+
2529
appVersion: 1.12-SNAPSHOT
30+
31+
home: https://github.com/apache/flink-kubernetes-operator
32+
2633
icon: https://flink.apache.org/img/logo/png/50/color_50.png
Lines changed: 17 additions & 124 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.
@@ -78,73 +78,6 @@ Create the path of the operator image to use
7878
{{- end }}
7979
{{- end }}
8080

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-
14881
{{/*
14982
Determine role scope based on name
15083
*/}}
@@ -155,43 +88,3 @@ Determine role scope based on name
15588
{{- printf "Role" }}
15689
{{- end }}
15790
{{- 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: 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+
{{- /* Create the name of the deployment to use. */ -}}
20+
{{- define "flink-operator.certManager.certificate.name" -}}
21+
flink-operator-serving-cert
22+
{{- end -}}
23+
24+
{{- /* Create the name of the configmap to use. */ -}}
25+
{{- define "flink-operator.certManager.issuer.name" -}}
26+
flink-operator-selfsigned-issuer
27+
{{- end -}}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
apiVersion: cert-manager.io/v1
20+
kind: Certificate
21+
metadata:
22+
name: {{ include "flink-operator.certManager.certificate.name" . }}
23+
namespace: {{ .Release.Namespace }}
24+
spec:
25+
dnsNames:
26+
- flink-operator-webhook-service.{{ .Release.Namespace }}.svc
27+
- flink-operator-webhook-service.{{ .Release.Namespace }}.svc.cluster.local
28+
keystores:
29+
pkcs12:
30+
create: true
31+
passwordSecretRef:
32+
{{- if .Values.webhook.keystore.useDefaultPassword }}
33+
name: flink-operator-webhook-secret
34+
key: password
35+
{{- else }}
36+
{{- with .Values.webhook.keystore.passwordSecretRef }}
37+
{{- toYaml . | nindent 8 }}
38+
{{- end }}
39+
{{- end }}
40+
issuerRef:
41+
group: cert-manager.io
42+
kind: Issuer
43+
name: {{ include "flink-operator.certManager.issuer.name" . }}
44+
commonName: FlinkDeployment Validator
45+
secretName: webhook-server-cert
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
apiVersion: cert-manager.io/v1
20+
kind: Issuer
21+
metadata:
22+
name: {{ include "flink-operator.certManager.issuer.name" . }}
23+
namespace: {{ .Release.Namespace }}
24+
spec:
25+
selfSigned: {}
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+
{{- /* Create the name of the deployment to use. */ -}}
20+
{{- define "flink-operator.deployment.name" -}}
21+
{{- include "flink-operator.name" . }}
22+
{{- end -}}
23+
24+
{{- /* Create the name of the configmap to use. */ -}}
25+
{{- define "flink-operator.configmap.name" -}}
26+
flink-operator-config
27+
{{- end -}}

0 commit comments

Comments
 (0)