From cca6c4bad5a9c31b9e0a716aec18e0d1d57f968c Mon Sep 17 00:00:00 2001 From: Mikkel Bjerg Date: Thu, 24 Aug 2023 14:04:09 +0200 Subject: [PATCH 1/3] Creates default args for topics --- charts/flink-job/README.md | 2 +- charts/flink-job/templates/flink-deployment.yaml | 7 +++++++ charts/flink-job/values.yaml | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/flink-job/README.md b/charts/flink-job/README.md index 66ebf418..91f32b0c 100644 --- a/charts/flink-job/README.md +++ b/charts/flink-job/README.md @@ -148,7 +148,7 @@ Read more about Flink and highly available job-managers [here](https://nightlies | job.jarURI | string | `""` | The path of the job jar | | job.entryClass | string | `""` | The name of the job class | | job.args | list | `[]` | Arguments for the job | -| job.topics | list | `[]` | Define which topics this job will consume. Used for data-discovery in Cheetah Backstage. If the `arg` variable is set, adds `-- ` to the arguments passed to the job See [values.yaml](values.yaml) for the format | +| job.topics | list | `[]` | Define which topics this job will consume. Used for data-discovery in Cheetah Backstage. If the `arg` variable is set, adds `-- ` to the arguments passed to the job If `arg` is not set, adds `---kafka-topic ` or `---kafka-topic- ` See [values.yaml](values.yaml) for the format | | job.parallelism | int | `1` | How many jobs to run in parallel, see more here: | | job.state | string | `"running"` | Desired state of the job. Must be either: `running` or `suspended` | | job.upgradeMode | string | `"savepoint"` | Application upgrade mode. Must be either: stateless, last_state, savepoint `stateless` upgrades is done from an empty state `last-state` does a quick upgrade. Does not require the job to be in a healthy state, as it makes use of the HA metadata `savepoint` makes use of savepoints when upgrading and requires the job to be running. This provides maximal safety Read more here: | diff --git a/charts/flink-job/templates/flink-deployment.yaml b/charts/flink-job/templates/flink-deployment.yaml index 9e226f16..8dc20591 100644 --- a/charts/flink-job/templates/flink-deployment.yaml +++ b/charts/flink-job/templates/flink-deployment.yaml @@ -40,6 +40,13 @@ spec: {{- if .arg }} - {{ printf "--%s" (trimPrefix "--" .arg) | quote }} - {{ printf "%s" .name | quote }} + {{- else }} + {{- if .postfix }} + - {{ printf "--%s-kafka-topic-%s" .type .postfix | quote }} + {{- else }} + - {{ printf "--%s-kafka-topic" .type | quote }} + {{- end }} + - {{ printf "%s" .name | quote }} {{- end }} {{- end }} {{- range .Values.job.args }} diff --git a/charts/flink-job/values.yaml b/charts/flink-job/values.yaml index 517b81cb..61042925 100644 --- a/charts/flink-job/values.yaml +++ b/charts/flink-job/values.yaml @@ -114,10 +114,12 @@ job: # -- Define which topics this job will consume. # Used for data-discovery in Cheetah Backstage. # If the `arg` variable is set, adds `-- ` to the arguments passed to the job + # If `arg` is not set, adds `---kafka-topic ` or `---kafka-topic- ` # See [values.yaml](values.yaml) for the format topics: [] # must be defined as follows # - arg: + # postfix: # type: # name: # ie: @@ -129,6 +131,9 @@ job: # - arg: output-kafka-topic # type: output # name: sinkTopic + # - postfix: special + # type: output + # name: specialSinkTopic # -- How many jobs to run in parallel, # see more here: From 423d7b0355821fc36b009fc4cd4ff92641b0ed8f Mon Sep 17 00:00:00 2001 From: Mikkel Bjerg Date: Thu, 24 Aug 2023 14:10:50 +0200 Subject: [PATCH 2/3] Bump version and values --- charts/flink-job/Chart.yaml | 2 +- charts/flink-job/ci/example-values.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/flink-job/Chart.yaml b/charts/flink-job/Chart.yaml index b976563e..df05688b 100644 --- a/charts/flink-job/Chart.yaml +++ b/charts/flink-job/Chart.yaml @@ -7,7 +7,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.6 +version: 0.4.7 dependencies: - name: image-automation diff --git a/charts/flink-job/ci/example-values.yaml b/charts/flink-job/ci/example-values.yaml index ccb61a12..56a1a206 100644 --- a/charts/flink-job/ci/example-values.yaml +++ b/charts/flink-job/ci/example-values.yaml @@ -18,6 +18,10 @@ job: jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar entryClass: org.apache.flink.streaming.examples.statemachine.StateMachineExample parallelism: 2 + topics: + - name: test + type: input + postfix: postfix taskManager: replicas: 2 resource: From 4ff7b27db2e9405b3fe12088d133ed259525714b Mon Sep 17 00:00:00 2001 From: Mikkel Bjerg Date: Thu, 24 Aug 2023 14:13:12 +0200 Subject: [PATCH 3/3] Documentation --- charts/flink-job/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/flink-job/README.md b/charts/flink-job/README.md index 91f32b0c..e7e1f00c 100644 --- a/charts/flink-job/README.md +++ b/charts/flink-job/README.md @@ -1,6 +1,6 @@ # flink-job -![Version: 0.4.6](https://img.shields.io/badge/Version-0.4.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.4.7](https://img.shields.io/badge/Version-0.4.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for handling Cheetah Data Platform Flink jobs