Skip to content

Commit 78d76ce

Browse files
committed
feat(addons): add flink
1 parent f240f07 commit 78d76ce

22 files changed

Lines changed: 1861 additions & 0 deletions
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright Drycc Community.
2+
# SPDX-License-Identifier: APACHE-2.0
3+
4+
annotations:
5+
category: Infrastructure
6+
licenses: Apache-2.0
7+
images: |
8+
- name: flink
9+
image: registry.drycc.cc/drycc-addons/flink:1
10+
apiVersion: v2
11+
appVersion: 1.18.1
12+
dependencies:
13+
- name: common
14+
repository: oci://registry.drycc.cc/charts
15+
version: ~1.1.3
16+
description: Apache Flink is a framework and distributed processing engine for stateful computations over unbounded and bounded data streams.
17+
home: https://bitnami.com
18+
icon: https://bitnami.com/assets/stacks/flink/img/flink-stack-220x234.png
19+
keywords:
20+
- flink
21+
- stream-processing
22+
- batch-processing
23+
maintainers:
24+
- name: VMware, Inc.
25+
url: https://github.com/bitnami/charts
26+
name: flink
27+
sources:
28+
- https://github.com/bitnami/charts/tree/main/bitnami/flink
29+
version: 0.5.3

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

Lines changed: 315 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
CHART NAME: {{ .Chart.Name }}
2+
CHART VERSION: {{ .Chart.Version }}
3+
APP VERSION: {{ .Chart.AppVersion }}
4+
5+
** Please be patient while the chart is being deployed **
6+
{{- if .Values.diagnosticMode.enabled }}
7+
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
8+
9+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
10+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
11+
12+
Get the list of pods by executing:
13+
14+
kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
15+
16+
Access the pod you want to debug by executing
17+
18+
kubectl exec --namespace {{ .Release.Namespace }} -ti <NAME OF THE POD> -- bash
19+
20+
In order to replicate the container startup scripts execute this command:
21+
22+
/opt/drycc/scripts/flink/entrypoint.sh /opt/drycc/scripts/flink/run.sh
23+
24+
{{- else }}
25+
26+
1. Get the jobmanager URL by running these commands:
27+
28+
{{- if contains "NodePort" .Values.jobmanager.service.type }}
29+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.names.fullname" . }})
30+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
31+
echo http://$NODE_IP:$NODE_PORT
32+
{{- else if contains "LoadBalancer" .Values.jobmanager.service.type }}
33+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
34+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "common.names.fullname" . }}'
35+
export SERVICE_IP=$(kubectl get svc --namespace {{ include "flink.jobmanager.fullname" . }} {{ include "common.names.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
36+
echo http://$SERVICE_IP:{{ .Values.jobmanager.service.ports.http }}
37+
{{- else if contains "ClusterIP" .Values.jobmanager.service.type }}
38+
echo "Browse to http://127.0.0.1:{{ .Values.jobmanager.service.ports.http }}"
39+
kubectl port-forward svc/{{ include "flink.jobmanager.fullname" . }} {{ .Values.jobmanager.service.ports.http }}:{{ .Values.jobmanager.service.ports.http }} &
40+
{{- end }}
41+
42+
{{- end }}
43+
44+
{{- include "common.warnings.rollingTag" .Values.image }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{{/*
2+
Copyright Drycc Community.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{/* vim: set filetype=mustache: */}}
7+
8+
{{/*
9+
Return the proper flink image name
10+
*/}}
11+
{{- define "flink.image" -}}
12+
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
13+
{{- end -}}
14+
15+
{{/*
16+
Return the proper Docker Image Registry Secret Names
17+
*/}}
18+
{{- define "flink.imagePullSecrets" -}}
19+
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) -}}
20+
{{- end -}}
21+
22+
{{/*
23+
Create the name of the jobmanager deployment
24+
*/}}
25+
{{- define "flink.jobmanager.fullname" -}}
26+
{{ printf "%s-jobmanager" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
27+
{{- end -}}
28+
29+
{{/*
30+
Create the name of the taskmanager deployment
31+
*/}}
32+
{{- define "flink.taskmanager.fullname" -}}
33+
{{ printf "%s-taskmanager" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
34+
{{- end -}}
35+
36+
{{/*
37+
Create the name of the service account to use for the taskmanager
38+
*/}}
39+
{{- define "flink.taskmanager.serviceAccountName" -}}
40+
{{- if .Values.taskmanager.serviceAccount.create -}}
41+
{{ default (include "flink.taskmanager.fullname" .) .Values.taskmanager.serviceAccount.name }}
42+
{{- else -}}
43+
{{ default "default" .Values.taskmanager.serviceAccount.name }}
44+
{{- end -}}
45+
{{- end -}}
46+
47+
{{/*
48+
Create the name of the service account to use for the jobmanager
49+
*/}}
50+
{{- define "flink.jobmanager.serviceAccountName" -}}
51+
{{- if .Values.jobmanager.serviceAccount.create -}}
52+
{{ default (include "flink.jobmanager.fullname" .) .Values.jobmanager.serviceAccount.name }}
53+
{{- else -}}
54+
{{ default "default" .Values.jobmanager.serviceAccount.name }}
55+
{{- end -}}
56+
{{- end -}}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{- /*
2+
Copyright Drycc Community.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- range .Values.extraDeploy }}
7+
---
8+
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
9+
{{- end }}
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
{{- /*
2+
Copyright Drycc Community.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
7+
kind: Deployment
8+
metadata:
9+
name: {{ include "flink.jobmanager.fullname" . }}
10+
namespace: {{ include "common.names.namespace" . | quote }}
11+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
12+
app.kubernetes.io/part-of: flink
13+
app.kubernetes.io/component: jobmanager
14+
{{- if .Values.commonAnnotations }}
15+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
16+
{{- end }}
17+
spec:
18+
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.jobmanager.podLabels .Values.commonLabels ) "context" . ) }}
19+
selector:
20+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
21+
app.kubernetes.io/part-of: flink
22+
app.kubernetes.io/component: jobmanager
23+
replicas: {{ .Values.jobmanager.replicaCount }}
24+
{{- if .Values.jobmanager.updateStrategy }}
25+
strategy: {{- toYaml .Values.jobmanager.updateStrategy | nindent 4 }}
26+
{{- end }}
27+
template:
28+
metadata:
29+
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
30+
app.kubernetes.io/part-of: flink
31+
app.kubernetes.io/component: jobmanager
32+
{{- if or .Values.jobmanager.podAnnotations .Values.commonAnnotations }}
33+
{{- $podAnnotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.jobmanager.podAnnotations .Values.commonAnnotations ) "context" . ) }}
34+
annotations: {{- include "common.tplvalues.render" (dict "value" $podAnnotations "context" $) | nindent 8 }}
35+
{{- end }}
36+
spec:
37+
{{- include "flink.imagePullSecrets" . | nindent 6 }}
38+
{{- if .Values.jobmanager.schedulerName }}
39+
schedulerName: {{ .Values.jobmanager.schedulerName }}
40+
{{- end }}
41+
priorityClassName: {{ .Values.jobmanager.priorityClassName | quote }}
42+
{{- if .Values.jobmanager.affinity }}
43+
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.affinity "context" $) | nindent 8 }}
44+
{{- else }}
45+
affinity:
46+
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.jobmanager.podAffinityPreset "component" "jobmanager" "customLabels" $podLabels "context" $) | nindent 10 }}
47+
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.jobmanager.podAntiAffinityPreset "component" "jobmanager" "customLabels" $podLabels "context" $) | nindent 10 }}
48+
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.jobmanager.nodeAffinityPreset.type "key" .Values.jobmanager.nodeAffinityPreset.key "values" .Values.jobmanager.nodeAffinityPreset.values) | nindent 10 }}
49+
{{- end }}
50+
{{- if .Values.jobmanager.podSecurityContext.enabled }}
51+
securityContext: {{- omit .Values.jobmanager.podSecurityContext "enabled" | toYaml | nindent 8 }}
52+
{{- end }}
53+
{{- if .Values.jobmanager.nodeSelector }}
54+
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.nodeSelector "context" $) | nindent 8 }}
55+
{{- end }}
56+
{{- if .Values.jobmanager.tolerations }}
57+
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.tolerations "context" $) | nindent 8 }}
58+
{{- end }}
59+
{{- if .Values.jobmanager.topologySpreadConstraints }}
60+
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.topologySpreadConstraints "context" $) | nindent 8 }}
61+
{{- end }}
62+
initContainers:
63+
{{- if .Values.jobmanager.initContainers }}
64+
{{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.initContainers "context" $) | nindent 8 }}
65+
{{- end }}
66+
containers:
67+
- name: flink-jobmanager
68+
image: {{ include "flink.image" . }}
69+
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
70+
{{- if .Values.jobmanager.containerSecurityContext.enabled }}
71+
securityContext: {{- omit .Values.jobmanager.containerSecurityContext "enabled" | toYaml | nindent 12 }}
72+
{{- end }}
73+
{{- if .Values.diagnosticMode.enabled }}
74+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
75+
{{- else if .Values.jobmanager.command }}
76+
command: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.command "context" $) | nindent 12 }}
77+
{{- end }}
78+
{{- if .Values.diagnosticMode.enabled }}
79+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
80+
{{- else if .Values.jobmanager.args }}
81+
args: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.args "context" $) | nindent 12 }}
82+
{{- end }}
83+
{{- if .Values.jobmanager.lifecycleHooks }}
84+
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.lifecycleHooks "context" $) | nindent 12 }}
85+
{{- end }}
86+
ports:
87+
- name: tcp-rpc
88+
containerPort: {{ .Values.jobmanager.containerPorts.rpc }}
89+
- name: http
90+
containerPort: {{ .Values.jobmanager.containerPorts.http }}
91+
- name: tcp-blob
92+
containerPort: {{ .Values.jobmanager.containerPorts.blob }}
93+
env:
94+
- name: FLINK_MODE
95+
value: jobmanager
96+
- name: FLINK_CFG_JOBMANAGER_RPC_ADDRESS
97+
value: {{ include "flink.jobmanager.fullname" . | quote }}
98+
- name: FLINK_CFG_JOBMANAGER_RPC_PORT
99+
value: {{ .Values.jobmanager.service.ports.rpc | quote }}
100+
- name: FLINK_CFG_JOBMANAGER_RPC_BIND__PORT
101+
value: {{ .Values.jobmanager.containerPorts.rpc | quote }}
102+
- name: FLINK_CFG_JOBMANAGER_BIND__HOST
103+
value: 0.0.0.0
104+
- name: FLINK_CFG_REST_ADDRESS
105+
value: {{ include "flink.jobmanager.fullname" . | quote }}
106+
- name: FLINK_CFG_REST_PORT
107+
value: {{ .Values.jobmanager.containerPorts.http | quote }}
108+
- name: FLINK_CFG_REST_BIND__ADDRESS
109+
value: 0.0.0.0
110+
- name: FLINK_CFG_BLOB_SERVER_PORT
111+
value: {{ .Values.jobmanager.containerPorts.blob | quote }}
112+
- name: DRYCC_DEBUG
113+
value: {{ ternary "true" "false" .Values.image.debug | quote }}
114+
{{- if .Values.jobmanager.extraEnvVars }}
115+
{{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.extraEnvVars "context" $) | nindent 12 }}
116+
{{- end }}
117+
envFrom:
118+
{{- if .Values.jobmanager.extraEnvVarsCM }}
119+
- configMapRef:
120+
name: {{ .Values.jobmanager.extraEnvVarsCM }}
121+
{{- end }}
122+
{{- if .Values.jobmanager.extraEnvVarsSecret }}
123+
- secretRef:
124+
name: {{ .Values.jobmanager.extraEnvVarsSecret }}
125+
{{- end }}
126+
{{- if not .Values.diagnosticMode.enabled }}
127+
{{- if .Values.jobmanager.customStartupProbe }}
128+
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.customStartupProbe "context" $) | nindent 12 }}
129+
{{- else if .Values.jobmanager.startupProbe.enabled }}
130+
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.jobmanager.startupProbe "enabled") "context" $) | nindent 12 }}
131+
tcpSocket:
132+
port: tcp-rpc
133+
{{- end }}
134+
{{- if .Values.jobmanager.customLivenessProbe }}
135+
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.customLivenessProbe "context" $) | nindent 12 }}
136+
{{- else if .Values.jobmanager.livenessProbe.enabled }}
137+
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.jobmanager.livenessProbe "enabled") "context" $) | nindent 12 }}
138+
tcpSocket:
139+
port: tcp-rpc
140+
{{- end }}
141+
{{- if .Values.jobmanager.customReadinessProbe }}
142+
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.customReadinessProbe "context" $) | nindent 12 }}
143+
{{- else if .Values.jobmanager.readinessProbe.enabled }}
144+
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.jobmanager.readinessProbe "enabled") "context" $) | nindent 12 }}
145+
tcpSocket:
146+
port: tcp-rpc
147+
{{- end }}
148+
{{- end }}
149+
{{- if .Values.jobmanager.resources }}
150+
resources: {{- toYaml .Values.jobmanager.resources | nindent 12 }}
151+
{{- end }}
152+
{{- if .Values.jobmanager.extraVolumeMounts }}
153+
volumeMounts: {{- include "common.tplvalues.render" ( dict "value" .Values.jobmanager.extraVolumeMounts "context" $) | nindent 12 }}
154+
{{- end }}
155+
{{- if .Values.jobmanager.sidecars }}
156+
{{- include "common.tplvalues.render" ( dict "value" .Values.jobmanager.sidecars "context" $) | nindent 8 }}
157+
{{- end }}
158+
volumes:
159+
{{- if .Values.jobmanager.extraVolumes }}
160+
{{- include "common.tplvalues.render" ( dict "value" .Values.jobmanager.extraVolumes "context" $) | nindent 8 }}
161+
{{- end }}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{{- /*
2+
Copyright Drycc Community.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
apiVersion: v1
7+
kind: Service
8+
metadata:
9+
name: {{ include "flink.jobmanager.fullname" . }}
10+
namespace: {{ include "common.names.namespace" . | quote }}
11+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
12+
app.kubernetes.io/part-of: flink
13+
app.kubernetes.io/component: jobmanager
14+
{{- if or .Values.jobmanager.service.annotations .Values.commonAnnotations }}
15+
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.jobmanager.service.annotations .Values.commonAnnotations ) "context" . ) }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
17+
{{- end }}
18+
spec:
19+
type: {{ .Values.jobmanager.service.type }}
20+
{{- if and (eq .Values.jobmanager.service.type "LoadBalancer") (not (empty .Values.jobmanager.service.loadBalancerIP)) }}
21+
loadBalancerIP: {{ .Values.jobmanager.service.loadBalancerIP }}
22+
{{- end }}
23+
{{- if and (eq .Values.jobmanager.service.type "LoadBalancer") (not (empty .Values.jobmanager.service.loadBalancerSourceRanges)) }}
24+
loadBalancerSourceRanges: {{ .Values.jobmanager.service.loadBalancerSourceRanges }}
25+
{{- end }}
26+
{{- if and .Values.jobmanager.service.clusterIP (eq .Values.jobmanager.service.type "ClusterIP") }}
27+
clusterIP: {{ .Values.jobmanager.service.clusterIP }}
28+
{{- end }}
29+
{{- if .Values.jobmanager.service.sessionAffinity }}
30+
sessionAffinity: {{ .Values.jobmanager.service.sessionAffinity }}
31+
{{- end }}
32+
{{- if .Values.jobmanager.service.sessionAffinityConfig }}
33+
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.service.sessionAffinityConfig "context" $) | nindent 4 }}
34+
{{- end }}
35+
{{- if or (eq .Values.jobmanager.service.type "LoadBalancer") (eq .Values.jobmanager.service.type "NodePort") }}
36+
externalTrafficPolicy: {{ .Values.jobmanager.service.externalTrafficPolicy | quote }}
37+
{{- end }}
38+
ports:
39+
- name: tcp-rpc
40+
port: {{ .Values.jobmanager.service.ports.rpc }}
41+
targetPort: {{ .Values.jobmanager.containerPorts.rpc }}
42+
{{- if and (or (eq .Values.jobmanager.service.type "NodePort") (eq .Values.jobmanager.service.type "LoadBalancer")) (not (empty .Values.jobmanager.service.nodePorts.rpc)) }}
43+
nodePort: {{ .Values.jobmanager.service.nodePorts.rpc }}
44+
{{- else if eq .Values.jobmanager.service.type "ClusterIP" }}
45+
nodePort: null
46+
{{- end }}
47+
- name: http
48+
port: {{ .Values.jobmanager.service.ports.http }}
49+
targetPort: {{ .Values.jobmanager.containerPorts.http }}
50+
{{- if and (or (eq .Values.jobmanager.service.type "NodePort") (eq .Values.jobmanager.service.type "LoadBalancer")) (not (empty .Values.jobmanager.service.nodePorts.http)) }}
51+
nodePort: {{ .Values.jobmanager.service.nodePorts.http }}
52+
{{- else if eq .Values.jobmanager.service.type "ClusterIP" }}
53+
nodePort: null
54+
{{- end }}
55+
- name: tcp-blob
56+
port: {{ .Values.jobmanager.service.ports.blob }}
57+
targetPort: {{ .Values.jobmanager.containerPorts.blob }}
58+
{{- if and (or (eq .Values.jobmanager.service.type "NodePort") (eq .Values.jobmanager.service.type "LoadBalancer")) (not (empty .Values.jobmanager.service.nodePorts.blob)) }}
59+
nodePort: {{ .Values.jobmanager.service.nodePorts.blob }}
60+
{{- else if eq .Values.jobmanager.service.type "ClusterIP" }}
61+
nodePort: null
62+
{{- end }}
63+
{{- if .Values.jobmanager.service.extraPorts }}
64+
{{- include "common.tplvalues.render" (dict "value" .Values.jobmanager.service.extraPorts "context" $) | nindent 4 }}
65+
{{- end }}
66+
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.jobmanager.podLabels .Values.commonLabels ) "context" . ) }}
67+
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
68+
app.kubernetes.io/part-of: flink
69+
app.kubernetes.io/component: jobmanager

0 commit comments

Comments
 (0)