Skip to content

Commit a422d34

Browse files
committed
2 parents 455dc68 + d9ed40e commit a422d34

14 files changed

Lines changed: 317 additions & 20 deletions

File tree

addons/flink/1.17/chart/flink/templates/jobmanager/networkpolicy.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ spec:
7373
- podSelector:
7474
matchLabels:
7575
{{ template "flink.jobmanager.fullname" . }}-client: "true"
76+
{{- if .Values.jobmanager.networkPolicy.allowCurrentNamespace }}
77+
- namespaceSelector:
78+
matchLabels:
79+
kubernetes.io/metadata.name: {{ .Release.Namespace }}
80+
{{- end }}
81+
{{- range $namespace := .Values.jobmanager.networkPolicy.allowNamespaces }}
82+
{{- if $namespace }}
83+
- namespaceSelector:
84+
matchLabels:
85+
kubernetes.io/metadata.name: {{ $namespace }}
86+
{{- end }}
87+
{{- end }}
7688
{{- if .Values.jobmanager.networkPolicy.ingressNSMatchLabels }}
7789
- namespaceSelector:
7890
matchLabels:

addons/flink/1.17/chart/flink/templates/taskmanager/headless-service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- /*
2-
Copyright VMware, Inc.
2+
Copyright Drycc Community.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

addons/flink/1.17/chart/flink/templates/taskmanager/networkpolicy.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- /*
2-
Copyright VMware, Inc.
2+
Copyright Drycc Community.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

@@ -49,6 +49,7 @@ spec:
4949
- ports:
5050
- port: {{ .Values.taskmanager.containerPorts.data }}
5151
- port: {{ .Values.taskmanager.containerPorts.rpc }}
52+
- port: {{ .Values.taskmanager.containerPorts.internalMetrics }}
5253
to:
5354
- podSelector:
5455
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
@@ -62,16 +63,25 @@ spec:
6263
{{- if eq .Values.taskmanager.service.type "LoadBalancer" }}
6364
- {}
6465
{{- else }}
65-
- ports:
66-
- port: {{ .Values.taskmanager.containerPorts.data }}
67-
- port: {{ .Values.taskmanager.containerPorts.rpc }}
68-
{{- if not .Values.taskmanager.networkPolicy.allowExternal }}
69-
from:
66+
- from:
67+
{{- if not .Values.taskmanager.networkPolicy.allowExternal }}
7068
- podSelector:
7169
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
7270
- podSelector:
7371
matchLabels:
7472
{{ template "flink.taskmanager.fullname" . }}-client: "true"
73+
{{- if .Values.taskmanager.networkPolicy.allowCurrentNamespace }}
74+
- namespaceSelector:
75+
matchLabels:
76+
kubernetes.io/metadata.name: {{ .Release.Namespace }}
77+
{{- end }}
78+
{{- range $namespace := .Values.taskmanager.networkPolicy.allowNamespaces }}
79+
{{- if $namespace }}
80+
- namespaceSelector:
81+
matchLabels:
82+
kubernetes.io/metadata.name: {{ $namespace }}
83+
{{- end }}
84+
{{- end }}
7585
{{- if .Values.taskmanager.networkPolicy.ingressNSMatchLabels }}
7686
- namespaceSelector:
7787
matchLabels:

addons/flink/1.17/chart/flink/templates/taskmanager/statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- /*
2-
Copyright VMware, Inc.
2+
Copyright Drycc Community.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

addons/flink/1.17/chart/flink/values.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,12 @@ jobmanager:
303303
## on. When true, server will accept connections from any source
304304
## (with the correct destination port).
305305
##
306-
allowExternal: true
306+
allowExternal: false
307307
## @param jobmanager.networkPolicy.allowExternalEgress Allow the pod to access any range of port and all destinations.
308308
##
309309
allowExternalEgress: true
310+
allowCurrentNamespace: true
311+
allowNamespaces: []
310312
## @param jobmanager.networkPolicy.extraIngress [array] Add extra ingress rules to the NetworkPolice
311313
## e.g:
312314
## extraIngress:
@@ -672,10 +674,12 @@ taskmanager:
672674
## on. When true, server will accept connections from any source
673675
## (with the correct destination port).
674676
##
675-
allowExternal: true
677+
allowExternal: false
676678
## @param taskmanager.networkPolicy.allowExternalEgress Allow the pod to access any range of port and all destinations.
677679
##
678680
allowExternalEgress: true
681+
allowCurrentNamespace: true
682+
allowNamespaces: []
679683
## @param taskmanager.networkPolicy.extraIngress [array] Add extra ingress rules to the NetworkPolice
680684
## e.g:
681685
## extraIngress:

addons/flink/1.17/meta.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ allow_parameters:
1818
- name: "jobmanager.service.type"
1919
required: false
2020
description: "jobmanager service type config for values.yaml"
21+
- name: "jobmanager.networkPolicy.allowNamespaces"
22+
required: false
23+
description: "jobmanager networkPolicy allowNamespaces config for values.yaml"
2124
- name: "jobmanager.extraEnvVars"
2225
required: false
2326
description: "jobmanager extraEnvVars config for values.yaml"
2427
- name: "taskmanager.service.type"
2528
required: false
2629
description: "taskmanager service type config for values.yaml"
30+
- name: "taskmanager.networkPolicy.allowNamespaces"
31+
required: false
32+
description: "taskmanager networkPolicy allowNamespaces config for values.yaml"
2733
- name: "taskmanager.extraEnvVars"
2834
required: false
2935
description: "taskmanager extraEnvVars config for values.yaml"

addons/kafka/3.6/chart/kafka/templates/_helpers.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ Init container definition for waiting for Kubernetes autodiscovery
956956
image: {{ include "kafka.externalAccess.autoDiscovery.image" .context }}
957957
imagePullPolicy: {{ .context.Values.externalAccess.autoDiscovery.image.pullPolicy | quote }}
958958
command:
959+
- init-stack
959960
- /scripts/auto-discovery.sh
960961
env:
961962
- name: MY_POD_NAME

addons/kafka/3.6/chart/kafka/values.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ controller:
644644
drop: ["ALL"]
645645
## @param controller.automountServiceAccountToken Mount Service Account token in pod
646646
##
647-
automountServiceAccountToken: false
647+
automountServiceAccountToken: true
648648
## @param controller.hostAliases Kafka pods host aliases
649649
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
650650
##
@@ -1053,7 +1053,7 @@ broker:
10531053
drop: ["ALL"]
10541054
## @param broker.automountServiceAccountToken Mount Service Account token in pod
10551055
##
1056-
automountServiceAccountToken: false
1056+
automountServiceAccountToken: true
10571057
## @param broker.hostAliases Kafka pods host aliases
10581058
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
10591059
##
@@ -1381,7 +1381,7 @@ externalAccess:
13811381
autoDiscovery:
13821382
## @param externalAccess.autoDiscovery.enabled Enable using an init container to auto-detect external IPs/ports by querying the K8s API
13831383
##
1384-
enabled: false
1384+
enabled: true
13851385
## Bitnami Kubectl image
13861386
## ref: https://hub.docker.com/r/bitnami/kubectl/tags/
13871387
## @param externalAccess.autoDiscovery.image.registry [default: REGISTRY_NAME] Init container auto-discovery image registry
@@ -1728,7 +1728,7 @@ serviceAccount:
17281728
## @param serviceAccount.automountServiceAccountToken Allows auto mount of ServiceAccountToken on the serviceAccount created
17291729
## Can be set to false if pods using this serviceAccount do not need to use K8s API
17301730
##
1731-
automountServiceAccountToken: false
1731+
automountServiceAccountToken: true
17321732
## @param serviceAccount.annotations Additional custom annotations for the ServiceAccount
17331733
##
17341734
annotations: {}
@@ -1740,7 +1740,7 @@ rbac:
17401740
## binding Kafka ServiceAccount to a role
17411741
## that allows Kafka pods querying the K8s API
17421742
##
1743-
create: false
1743+
create: true
17441744

17451745
## @section Metrics parameters
17461746
##
@@ -1920,7 +1920,7 @@ metrics:
19201920
drop: ["ALL"]
19211921
## @param metrics.kafka.automountServiceAccountToken Mount Service Account token in pod
19221922
##
1923-
automountServiceAccountToken: false
1923+
automountServiceAccountToken: true
19241924
## @param metrics.kafka.hostAliases Kafka exporter pods host aliases
19251925
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
19261926
##
@@ -2063,7 +2063,7 @@ metrics:
20632063
## @param metrics.kafka.serviceAccount.automountServiceAccountToken Allows auto mount of ServiceAccountToken on the serviceAccount created
20642064
## Can be set to false if pods using this serviceAccount do not need to use K8s API
20652065
##
2066-
automountServiceAccountToken: false
2066+
automountServiceAccountToken: true
20672067
## Prometheus JMX exporter: exposes the majority of Kafka metrics
20682068
##
20692069
jmx:

addons/kafka/3.6/meta.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ instances_retrievable: true
1515
bindings_retrievable: true
1616
plan_updateable: true
1717
allow_parameters:
18+
- name: "listeners.client.protocol"
19+
required: false
20+
description: "listeners client protocol config for values.yaml"
21+
- name: "listeners.controller.protocol"
22+
required: false
23+
description: "listeners controller protocol config for values.yaml"
24+
- name: "listeners.interbroker.protocol"
25+
required: false
26+
description: "listeners interbroker protocol config for values.yaml"
27+
- name: "listeners.external.protocol"
28+
required: false
29+
description: "listeners external protocol config for values.yaml"
1830
- name: "networkPolicy.allowNamespaces"
1931
required: false
2032
description: "networkPolicy allowNamespaces config for values.yaml"
@@ -24,4 +36,13 @@ allow_parameters:
2436
- name: "metrics.kafka.enabled"
2537
required: false
2638
description: "metrics kafka enabled or not config for values.yaml"
39+
- name: "externalAccess.enabled"
40+
required: false
41+
description: "externalAccess enabled or not config for values.yaml"
42+
- name: "listeners.advertisedListeners"
43+
required: false
44+
description: "listeners advertisedListeners or not config for values.yaml"
45+
- name: "metrics.kafka.enabled"
46+
required: false
47+
description: "metrics kafka enabled or not config for values.yaml"
2748
archive: false
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
credential:
2+
{{- if (eq .Values.service.type "LoadBalancer") }}
3+
- name: EXTERNAL_OPENSEARCH_HOST
4+
valueFrom:
5+
serviceRef:
6+
name: {{ include "opensearch.service.name" . }}
7+
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
8+
{{- end }}
9+
10+
- name: OPENSEARCH_HOST
11+
valueFrom:
12+
serviceRef:
13+
name: {{ include "opensearch.service.name" . }}
14+
jsonpath: '{ .spec.clusterIP }'
15+
16+
- name: OPENSEARCH_TCP_REST_API_PORT
17+
valueFrom:
18+
serviceRef:
19+
name: {{ include "opensearch.service.name" . }}
20+
jsonpath: '{ .spec.ports[?(@.name=="tcp-rest-api")].port }'
21+
22+
- name: OPENSEARCH_TCP_TRANSPORT_PORT
23+
valueFrom:
24+
serviceRef:
25+
name: {{ include "opensearch.service.name" . }}
26+
jsonpath: '{ .spec.ports[?(@.name=="tcp-transport")].port }'
27+
28+
{{- if .Values.dashboards.enabled }}
29+
{{ if (eq .Values.dashboards.service.type "LoadBalancer") }}
30+
- name: EXTERNAL_OPENSEARCH_DASHBOARDS_HOST
31+
valueFrom:
32+
serviceRef:
33+
name: {{ include "opensearch.dashboards.servicename" . }}
34+
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
35+
{{- end }}
36+
37+
- name: OPENSEARCH_DASHBOARDS_HOST
38+
valueFrom:
39+
serviceRef:
40+
name: {{ include "opensearch.dashboards.servicename" . }}
41+
jsonpath: '{ .spec.clusterIP }'
42+
43+
- name: OPENSEARCH_DASHBOARDS_PORT
44+
valueFrom:
45+
serviceRef:
46+
name: {{ include "opensearch.dashboards.servicename" . }}
47+
jsonpath: '{ .spec.ports[?(@.name=="http")].port }'
48+
{{- end }}
49+
50+
{{- if .Values.security.enabled }}
51+
- name: OPENSEARCH_PASSWORD
52+
valueFrom:
53+
secretKeyRef:
54+
name: {{ template "common.names.fullname" . }}
55+
jsonpath: '{ .data.opensearch-password }'
56+
57+
- name: OPENSEARCH_DASHBOARDS_PASSWORD
58+
valueFrom:
59+
secretKeyRef:
60+
name: {{ template "common.names.fullname" . }}
61+
jsonpath: '{ .data.opensearch-dashboards-password }'
62+
63+
- name: LOGSTASH_PASSWORD
64+
valueFrom:
65+
secretKeyRef:
66+
name: {{ template "common.names.fullname" . }}
67+
jsonpath: '{ .data.logstash-password }'
68+
{{- end }}

0 commit comments

Comments
 (0)