From e70bd1bb00f62563fa74507b162f24b0185e3ff0 Mon Sep 17 00:00:00 2001 From: Ramin Gharib Date: Wed, 22 Nov 2023 16:15:38 +0100 Subject: [PATCH] Fix usage of --- .../templates/_helpers.tpl | 7 ++++-- charts/producer-app-cleanup-job/values.yaml | 2 +- charts/producer-app/README.md | 15 ++++++------ charts/producer-app/values.yaml | 2 +- .../templates/_helpers.tpl | 7 ++++-- charts/streams-app-cleanup-job/values.yaml | 2 +- charts/streams-app/README.md | 23 ++++++++++--------- charts/streams-app/templates/_helpers.tpl | 8 +++++-- charts/streams-app/values.yaml | 2 +- 9 files changed, 40 insertions(+), 28 deletions(-) diff --git a/charts/producer-app-cleanup-job/templates/_helpers.tpl b/charts/producer-app-cleanup-job/templates/_helpers.tpl index 6c95d457..96f64eae 100644 --- a/charts/producer-app-cleanup-job/templates/_helpers.tpl +++ b/charts/producer-app-cleanup-job/templates/_helpers.tpl @@ -16,8 +16,11 @@ If release name contains chart name it will be used as a full name. {{- if .Values.fullnameOverride -}} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- else -}} -{{- $name := default .Values.nameOverride -}} -{{- printf "%s-clean" $name | trunc 63 | trimSuffix "-" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} diff --git a/charts/producer-app-cleanup-job/values.yaml b/charts/producer-app-cleanup-job/values.yaml index fb2eac64..f4eb756b 100644 --- a/charts/producer-app-cleanup-job/values.yaml +++ b/charts/producer-app-cleanup-job/values.yaml @@ -1,4 +1,4 @@ -nameOverride: bakdata-producer-app-job +fullnameOverride: bakdata-producer-app-cleanup image: producerApp imageTag: latest diff --git a/charts/producer-app/README.md b/charts/producer-app/README.md index 91e5c59b..b9b7f7e3 100644 --- a/charts/producer-app/README.md +++ b/charts/producer-app/README.md @@ -11,8 +11,9 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Job | Parameter | Description | Default | -| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | -| `nameOverride` | The name of the Kubernetes deployment. | `bakdata-producer-app` | +|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------| +| `fullnameOverride` | Overrides name of the Kubernetes deployment. | `bakdata-producer-app` | +| `nameOverride` | Uses `Helm-release-name + nameOverride` for Kubernetes deployment name. | `bakdata-producer-app` | | `resources` | See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | see [values.yaml](values.yaml) for details | | `annotations` | Map of custom annotations to attach to the pod spec. | `{}` | | `labels` | Map of custom labels to attach to the pod spec. | `{}` | @@ -36,7 +37,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Image | Parameter | Description | Default | -| ------------------ | ------------------------------------------- | ------------- | +|--------------------|---------------------------------------------|---------------| | `image` | Docker image of the Kafka producer app. | `producerApp` | | `imageTag` | Docker image tag of the Kafka producer app. | `latest` | | `imagePullPolicy` | Docker image pull policy. | `Always` | @@ -45,7 +46,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Streams | Parameter | Description | Default | -| --------------------------- | ---------------------------------------------------------------------------------------------------------- | ------- | +|-----------------------------|------------------------------------------------------------------------------------------------------------|---------| | `streams.brokers` | Comma separated list of Kafka brokers to connect to. | | | `streams.schemaRegistryUrl` | URL of Schema Registry to connect to. | `null` | | `streams.config` | Configurations for your [Kafka producer app](https://kafka.apache.org/documentation/#producerconfigs). | `{}` | @@ -55,7 +56,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Other | Parameter | Description | Default | -| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| | `configurationEnvPrefix` | Prefix for environment variables to use that should be parsed as command line arguments. | `APP` | | `commandLine` | Map of command line arguments passed to the producer app. | `{}` | | `debug` | Configure logging to debug | `false` | @@ -67,14 +68,14 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### JVM | Parameter | Description | Default | -| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|---------| | `javaOptions.maxRAMPercentage` | https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#:~:text=is%20set%20ergonomically.-,%2DXX%3AMaxRAMPercentage,-%3Dpercent | `true` | | `javaOptions.others` | List of Java VM options passed to the producer app. | `[]` | ### Service | Parameter | Description | Default | -| ----------------- | ---------------------------------------------------------------------------------------------- | ----------- | +|-------------------|------------------------------------------------------------------------------------------------|-------------| | `service.enabled` | Whether to create a service. This requires the definition of at least one `ports.servicePort`. | `false` | | `service.labels` | Additional service labels. | `{}` | | `service.type` | Service type. | `ClusterIP` | diff --git a/charts/producer-app/values.yaml b/charts/producer-app/values.yaml index 3f2c088f..24637bf0 100644 --- a/charts/producer-app/values.yaml +++ b/charts/producer-app/values.yaml @@ -1,4 +1,4 @@ -nameOverride: bakdata-producer-app +fullnameOverride: bakdata-producer-app image: producerApp imageTag: latest diff --git a/charts/streams-app-cleanup-job/templates/_helpers.tpl b/charts/streams-app-cleanup-job/templates/_helpers.tpl index dfdee15a..e66cf612 100644 --- a/charts/streams-app-cleanup-job/templates/_helpers.tpl +++ b/charts/streams-app-cleanup-job/templates/_helpers.tpl @@ -16,8 +16,11 @@ If release name contains chart name it will be used as a full name. {{- if .Values.fullnameOverride -}} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- else -}} -{{- $name := default .Values.nameOverride -}} -{{- printf "%s-clean" $name | trunc 63 | trimSuffix "-" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} diff --git a/charts/streams-app-cleanup-job/values.yaml b/charts/streams-app-cleanup-job/values.yaml index 9fa76774..3ecbf0c6 100644 --- a/charts/streams-app-cleanup-job/values.yaml +++ b/charts/streams-app-cleanup-job/values.yaml @@ -1,4 +1,4 @@ -nameOverride: bakdata-streams-app-job +fullnameOverride: bakdata-streams-app-cleanup image: streamsApp imageTag: latest diff --git a/charts/streams-app/README.md b/charts/streams-app/README.md index fbbf1739..74018b25 100644 --- a/charts/streams-app/README.md +++ b/charts/streams-app/README.md @@ -11,8 +11,9 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Deployment | Parameter | Description | Default | -| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | -| `nameOverride` | The name of the Kubernetes deployment. | `bakdata-streams-app` | +|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------| +| `fullnameOverride` | The name of the Kubernetes deployment. | `bakdata-streams-app` | +| `nameOverride` | Uses `Helm-release-name + nameOverride` for Kubernetes deployment name. | `bakdata-producer-app` | | `replicaCount` | The number of Kafka Streams replicas. | `1` | | `resources` | See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | see [values.yaml](values.yaml) for details | | `annotations` | Map of custom annotations to attach to the pod spec. | `{}` | @@ -32,7 +33,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Storage | Parameter | Description | Default | -| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------- | +|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------| | `persistence.enabled` | Use a [persistent volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) to store the state of the streams app. | `false` | | `persistence.size` | Size of the persistent volume. | `1Gi` | | `persistence.storageClass` | Storage class to use for the persistent volume. | | @@ -40,7 +41,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Image | Parameter | Description | Default | -| ------------------ | ------------------------------------------ | ------------ | +|--------------------|--------------------------------------------|--------------| | `image` | Docker image of the Kafka Streams app. | `streamsApp` | | `imageTag` | Docker image tag of the Kafka Streams app. | `latest` | | `imagePullPolicy` | Docker image pull policy. | `Always` | @@ -49,7 +50,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Streams | Parameter | Description | Default | -| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| | `streams.brokers` | Comma separated list of Kafka brokers to connect to. | | | `streams.schemaRegistryUrl` | URL of Schema Registry to connect to. | `null` | | `streams.staticMembership` | Whether to use [Kafka Static Group Membership](https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances). | `false` | @@ -67,7 +68,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Other | Parameter | Description | Default | -| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| | `configurationEnvPrefix` | Prefix for environment variables to use that should be parsed as command line arguments. | `APP` | | `commandLine` | Map of command line arguments passed to the streams app. | `{}` | | `debug` | Configure logging to debug | `false` | @@ -80,14 +81,14 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### JMX Configuration | Parameter | Description | Default | -| ----------------- | ------------------------------------------------- | -------- | +|-------------------|---------------------------------------------------|----------| | `jmx.port` | The jmx port which JMX style metrics are exposed. | `5555` | | `jmx.metricRules` | List of JMX metric rules. | `[".*"]` | ### Prometheus JMX Exporter Configuration | Parameter | Description | Default | -| -------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | +|----------------------------------|----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------| | `prometheus.jmx.enabled` | Whether or not to install Prometheus JMX Exporter as a sidecar container and expose JMX metrics to Prometheus. | `true` | | `prometheus.jmx.image` | Docker Image for Prometheus JMX Exporter container. | `solsson/kafka-prometheus-jmx-exporter@sha256` | | `prometheus.jmx.imageTag` | Docker Image Tag for Prometheus JMX Exporter container. | `6f82e2b0464f50da8104acd7363fb9b995001ddff77d248379f8788e78946143` | @@ -98,7 +99,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### Auto-Scaling | Parameter | Description | Default | -| -------------------------------- | -------------------------------------------------------------------------------------------------------- | ---------- | +|----------------------------------|----------------------------------------------------------------------------------------------------------|------------| | `autoscaling.enabled` | Whether to enable auto-scaling using [KEDA](https://keda.sh/docs/latest/scalers/apache-kafka/). | `false` | | `autoscaling.consumerGroup` | Name of the consumer group used for checking the offset on the topic and processing the related lag. | | | `autoscaling.lagThreshold` | Average target value to trigger scaling actions. | | @@ -114,14 +115,14 @@ Alternatively, a YAML file that specifies the values for the parameters can be p ### JVM | Parameter | Description | Default | -| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|---------| | `javaOptions.maxRAMPercentage` | https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#:~:text=is%20set%20ergonomically.-,%2DXX%3AMaxRAMPercentage,-%3Dpercent | `true` | | `javaOptions.others` | List of Java VM options passed to the streams app. | `[]` | ### Service | Parameter | Description | Default | -| ----------------- | ---------------------------------------------------------------------------------------------- | ----------- | +|-------------------|------------------------------------------------------------------------------------------------|-------------| | `service.enabled` | Whether to create a service. This requires the definition of at least one `ports.servicePort`. | `false` | | `service.labels` | Additional service labels. | `{}` | | `service.type` | Service type. | `ClusterIP` | diff --git a/charts/streams-app/templates/_helpers.tpl b/charts/streams-app/templates/_helpers.tpl index 4944f922..487032f7 100644 --- a/charts/streams-app/templates/_helpers.tpl +++ b/charts/streams-app/templates/_helpers.tpl @@ -16,8 +16,12 @@ If release name contains chart name it will be used as a full name. {{- if .Values.fullnameOverride -}} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- else -}} -{{- $name := default .Values.nameOverride -}} -{{- printf "%s" $name | trunc 63 | trimSuffix "-" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} {{- end -}} {{- end -}} diff --git a/charts/streams-app/values.yaml b/charts/streams-app/values.yaml index 0309adb6..67b9911d 100644 --- a/charts/streams-app/values.yaml +++ b/charts/streams-app/values.yaml @@ -1,4 +1,4 @@ -nameOverride: bakdata-streams-app +fullnameOverride: bakdata-streams-app replicaCount: 1