Skip to content

Commit cd4993d

Browse files
committed
chore(flink): update flink chart
1 parent 116d26f commit cd4993d

8 files changed

Lines changed: 434 additions & 22 deletions

File tree

addons/flink/1/chart/flink/README.md

Lines changed: 66 additions & 4 deletions
Large diffs are not rendered by default.

addons/flink/1/chart/flink/templates/jobmanager/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ spec:
3535
{{- end }}
3636
spec:
3737
{{- include "flink.imagePullSecrets" . | nindent 6 }}
38+
automountServiceAccountToken: {{ .Values.jobmanager.automountServiceAccountToken }}
39+
{{- if .Values.jobmanager.hostAliases }}
40+
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.hostAliases "context" $) | nindent 8 }}
41+
{{- end }}
3842
{{- if .Values.jobmanager.schedulerName }}
3943
schedulerName: {{ .Values.jobmanager.schedulerName }}
4044
{{- end }}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{{- /*
2+
Copyright Drycc Community.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if .Values.jobmanager.networkPolicy.enabled }}
7+
kind: NetworkPolicy
8+
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
9+
metadata:
10+
name: {{ template "flink.jobmanager.fullname" . }}
11+
namespace: {{ include "common.names.namespace" . | quote }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
13+
app.kubernetes.io/part-of: flink
14+
app.kubernetes.io/component: jobmanager
15+
{{- if .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
17+
{{- end }}
18+
spec:
19+
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.jobmanager.podLabels .Values.commonLabels ) "context" . ) }}
20+
podSelector:
21+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
22+
app.kubernetes.io/part-of: flink
23+
app.kubernetes.io/component: jobmanager
24+
policyTypes:
25+
- Ingress
26+
- Egress
27+
{{- if .Values.jobmanager.networkPolicy.allowExternalEgress }}
28+
egress:
29+
- {}
30+
{{- else }}
31+
egress:
32+
- ports:
33+
# Allow dns resolution
34+
- port: 53
35+
protocol: UDP
36+
- port: 53
37+
protocol: TCP
38+
# Allow outbound connections to other jobmanager pods
39+
- ports:
40+
- port: {{ .Values.jobmanager.containerPorts.blob }}
41+
- port: {{ .Values.jobmanager.containerPorts.rpc }}
42+
- port: {{ .Values.jobmanager.containerPorts.http }}
43+
to:
44+
- podSelector:
45+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
46+
app.kubernetes.io/part-of: flink
47+
app.kubernetes.io/component: jobmanager
48+
# Allow outbound connections to other taskmanager pods
49+
- ports:
50+
- port: {{ .Values.taskmanager.containerPorts.data }}
51+
- port: {{ .Values.taskmanager.containerPorts.rpc }}
52+
to:
53+
- podSelector:
54+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
55+
app.kubernetes.io/part-of: flink
56+
app.kubernetes.io/component: taskmanager
57+
{{- if .Values.jobmanager.networkPolicy.extraEgress }}
58+
{{- include "common.tplvalues.render" ( dict "value" .Values.jobmanager.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
59+
{{- end }}
60+
{{- end }}
61+
ingress:
62+
- ports:
63+
- port: {{ .Values.jobmanager.containerPorts.blob }}
64+
- port: {{ .Values.jobmanager.containerPorts.rpc }}
65+
- port: {{ .Values.jobmanager.containerPorts.http }}
66+
{{- if not .Values.jobmanager.networkPolicy.allowExternal }}
67+
from:
68+
- podSelector:
69+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
70+
- podSelector:
71+
matchLabels:
72+
{{ template "flink.jobmanager.fullname" . }}-client: "true"
73+
{{- if .Values.jobmanager.networkPolicy.ingressNSMatchLabels }}
74+
- namespaceSelector:
75+
matchLabels:
76+
{{- range $key, $value := .Values.jobmanager.networkPolicy.ingressNSMatchLabels }}
77+
{{ $key | quote }}: {{ $value | quote }}
78+
{{- end }}
79+
{{- if .Values.jobmanager.networkPolicy.ingressNSPodMatchLabels }}
80+
podSelector:
81+
matchLabels:
82+
{{- range $key, $value := .Values.jobmanager.networkPolicy.ingressNSPodMatchLabels }}
83+
{{ $key | quote }}: {{ $value | quote }}
84+
{{- end }}
85+
{{- end }}
86+
{{- end }}
87+
- podSelector:
88+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 14 }}
89+
app.kubernetes.io/part-of: flink
90+
{{- end }}
91+
{{- if .Values.jobmanager.networkPolicy.extraIngress }}
92+
{{- include "common.tplvalues.render" ( dict "value" .Values.jobmanager.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
93+
{{- end }}
94+
{{- end }}

addons/flink/1/chart/flink/templates/taskmanager/deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ spec:
3535
{{- end }}
3636
spec:
3737
{{- include "flink.imagePullSecrets" . | nindent 6 }}
38+
automountServiceAccountToken: {{ .Values.taskmanager.automountServiceAccountToken }}
39+
{{- if .Values.taskmanager.hostAliases }}
40+
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.taskmanager.hostAliases "context" $) | nindent 8 }}
41+
{{- end }}
3842
{{- if .Values.taskmanager.schedulerName }}
3943
schedulerName: {{ .Values.taskmanager.schedulerName }}
4044
{{- end }}
@@ -100,10 +104,6 @@ spec:
100104
value: 0.0.0.0
101105
- name: FLINK_CFG_TASKMANAGER_RPC_PORT
102106
value: {{ .Values.taskmanager.containerPorts.rpc | quote }}
103-
- name: FLINK_CFG_TASKMANAGER_HOST
104-
valueFrom:
105-
fieldRef:
106-
fieldPath: metadata.name
107107
- name: FLINK_CFG_TASKMANAGER_BIND__HOST
108108
value: 0.0.0.0
109109
- name: DRYCC_DEBUG
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{{- /*
2+
Copyright VMware, Inc.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if .Values.taskmanager.networkPolicy.enabled }}
7+
kind: NetworkPolicy
8+
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
9+
metadata:
10+
name: {{ template "flink.taskmanager.fullname" . }}
11+
namespace: {{ include "common.names.namespace" . | quote }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
13+
app.kubernetes.io/part-of: flink
14+
app.kubernetes.io/component: taskmanager
15+
{{- if .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
17+
{{- end }}
18+
spec:
19+
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.taskmanager.podLabels .Values.commonLabels ) "context" . ) }}
20+
podSelector:
21+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
22+
app.kubernetes.io/part-of: flink
23+
app.kubernetes.io/component: taskmanager
24+
policyTypes:
25+
- Ingress
26+
- Egress
27+
{{- if .Values.taskmanager.networkPolicy.allowExternalEgress }}
28+
egress:
29+
- {}
30+
{{- else }}
31+
egress:
32+
- ports:
33+
# Allow dns resolution
34+
- port: 53
35+
protocol: UDP
36+
- port: 53
37+
protocol: TCP
38+
# Allow outbound connections to other jobmanager pods
39+
- ports:
40+
- port: {{ .Values.jobmanager.containerPorts.blob }}
41+
- port: {{ .Values.jobmanager.containerPorts.rpc }}
42+
- port: {{ .Values.jobmanager.containerPorts.http }}
43+
to:
44+
- podSelector:
45+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
46+
app.kubernetes.io/part-of: flink
47+
app.kubernetes.io/component: jobmanager
48+
# Allow outbound connections to other taskmanager pods
49+
- ports:
50+
- port: {{ .Values.taskmanager.containerPorts.data }}
51+
- port: {{ .Values.taskmanager.containerPorts.rpc }}
52+
to:
53+
- podSelector:
54+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
55+
app.kubernetes.io/part-of: flink
56+
app.kubernetes.io/component: taskmanager
57+
{{- if .Values.taskmanager.networkPolicy.extraEgress }}
58+
{{- include "common.tplvalues.render" ( dict "value" .Values.taskmanager.networkPolicy.extraEgress "context" $ ) | nindent 4 }}
59+
{{- end }}
60+
{{- end }}
61+
ingress:
62+
- ports:
63+
- port: {{ .Values.taskmanager.containerPorts.data }}
64+
- port: {{ .Values.taskmanager.containerPorts.rpc }}
65+
{{- if not .Values.taskmanager.networkPolicy.allowExternal }}
66+
from:
67+
- podSelector:
68+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
69+
- podSelector:
70+
matchLabels:
71+
{{ template "flink.taskmanager.fullname" . }}-client: "true"
72+
{{- if .Values.taskmanager.networkPolicy.ingressNSMatchLabels }}
73+
- namespaceSelector:
74+
matchLabels:
75+
{{- range $key, $value := .Values.taskmanager.networkPolicy.ingressNSMatchLabels }}
76+
{{ $key | quote }}: {{ $value | quote }}
77+
{{- end }}
78+
{{- if .Values.taskmanager.networkPolicy.ingressNSPodMatchLabels }}
79+
podSelector:
80+
matchLabels:
81+
{{- range $key, $value := .Values.taskmanager.networkPolicy.ingressNSPodMatchLabels }}
82+
{{ $key | quote }}: {{ $value | quote }}
83+
{{- end }}
84+
{{- end }}
85+
{{- end }}
86+
- podSelector:
87+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 14 }}
88+
app.kubernetes.io/part-of: flink
89+
{{- end }}
90+
{{- if .Values.taskmanager.networkPolicy.extraIngress }}
91+
{{- include "common.tplvalues.render" ( dict "value" .Values.taskmanager.networkPolicy.extraIngress "context" $ ) | nindent 4 }}
92+
{{- end }}
93+
{{- end }}

0 commit comments

Comments
 (0)