Add chart flink cdc job

This commit is contained in:
wbsong111
2026-04-21 16:43:09 +09:00
parent bae49f352c
commit 24ee4ec731
9 changed files with 682 additions and 0 deletions
@@ -0,0 +1,26 @@
{{/*
Chart label
*/}}
{{- define "flink-cdc-job.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Fully qualified name: Release.Name (chart name )
*/}}
{{- define "flink-cdc-job.fullname" -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "flink-cdc-job.labels" -}}
helm.sh/chart: {{ include "flink-cdc-job.chart" . }}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
@@ -0,0 +1,45 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "flink-cdc-job.fullname" . }}-config
namespace: {{ .Release.Namespace }}
labels:
{{- include "flink-cdc-job.labels" . | nindent 4 }}
data:
flink-cdc.yaml: |
parallelism: {{ .Values.flinkCdc.parallelism }}
schema.change.behavior: {{ .Values.flinkCdc.schemaChangeBehavior }}
pipeline.yaml: |
source:
type: postgres
hostname: {{ .Values.postgres.hostname }}
port: {{ .Values.postgres.port }}
username: {{ .Values.postgres.username }}
password: {{ .Values.postgres.password }}
decoding.plugin.name: {{ .Values.postgres.decodingPlugin }}
slot.name: {{ .Values.postgres.slotName }}
tables: {{ .Values.postgres.tables }}
pipeline:
name: {{ .Values.pipeline.name }}
parallelism: {{ .Values.pipeline.parallelism }}
execution.checkpointing.interval: {{ .Values.pipeline.checkpointInterval }}
sink:
type: iceberg
catalog.properties.type: rest
catalog.properties.uri: {{ .Values.sink.catalog.uri | quote }}
catalog.properties.warehouse: {{ .Values.sink.catalog.warehouse }}
catalog.properties.io-impl: org.apache.iceberg.aws.s3.S3FileIO
catalog.properties.s3.endpoint: {{ .Values.sink.catalog.s3Endpoint | quote }}
catalog.properties.s3.path-style-access: {{ .Values.sink.catalog.s3PathStyleAccess | quote }}
catalog.properties.oauth2-server-uri: {{ .Values.sink.catalog.oauth2Uri | quote }}
catalog.properties.credential: {{ .Values.sink.catalog.credential }}
catalog.properties.scope: {{ .Values.sink.catalog.scope }}
route:
{{- range .Values.route }}
- source-table: {{ .sourceTable }}
sink-table: {{ .sinkTable }}
{{- end }}
@@ -0,0 +1,33 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "flink-cdc-job.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "flink-cdc-job.labels" . | nindent 4 }}
spec:
backoffLimit: 0
template:
spec:
serviceAccountName: {{ .Values.serviceAccount }}
containers:
- name: submit
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh", "-c"]
args:
- |
cd /opt/flink/flink-cdc-3.5.0
./bin/flink-cdc.sh \
./conf/pipeline.yaml \
-Dexecution.checkpointing.interval={{ .Values.pipeline.checkpointInterval }} \
-Drest.address={{ .Values.sessionCluster.restAddress }} \
-Drest.port={{ .Values.sessionCluster.restPort }}
volumeMounts:
- name: pipeline-config
mountPath: /opt/flink/flink-cdc-3.5.0/conf
volumes:
- name: pipeline-config
configMap:
name: {{ include "flink-cdc-job.fullname" . }}-config
restartPolicy: Never