From 8c152fcc1596a7ae6bf8788566441a60c8053477 Mon Sep 17 00:00:00 2001 From: tjwornjs Date: Thu, 7 Jul 2022 13:50:26 +0900 Subject: [PATCH 1/5] labels for schema registry --- .../templates/deployment.yaml | 81 ++++++++++--------- values.yaml | 1 + 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/charts/cp-schema-registry/templates/deployment.yaml b/charts/cp-schema-registry/templates/deployment.yaml index b94995f0..1059dcd5 100644 --- a/charts/cp-schema-registry/templates/deployment.yaml +++ b/charts/cp-schema-registry/templates/deployment.yaml @@ -17,11 +17,17 @@ spec: matchLabels: app: {{ template "cp-schema-registry.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} template: metadata: labels: app: {{ template "cp-schema-registry.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- if or .Values.podAnnotations .Values.prometheus.jmx.enabled }} annotations: {{- range $key, $value := .Values.podAnnotations }} @@ -43,22 +49,22 @@ spec: image: "{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}" imagePullPolicy: "{{ .Values.prometheus.jmx.imagePullPolicy }}" command: - - java - - -XX:+UnlockExperimentalVMOptions - - -XX:+UseCGroupMemoryLimitForHeap - - -XX:MaxRAMFraction=1 - - -XshowSettings:vm - - -jar - - jmx_prometheus_httpserver.jar - - {{ .Values.prometheus.jmx.port | quote }} - - /etc/jmx-schema-registry/jmx-schema-registry-prometheus.yml + - java + - -XX:+UnlockExperimentalVMOptions + - -XX:+UseCGroupMemoryLimitForHeap + - -XX:MaxRAMFraction=1 + - -XshowSettings:vm + - -jar + - jmx_prometheus_httpserver.jar + - {{ .Values.prometheus.jmx.port | quote }} + - /etc/jmx-schema-registry/jmx-schema-registry-prometheus.yml ports: - - containerPort: {{ .Values.prometheus.jmx.port }} + - containerPort: {{ .Values.prometheus.jmx.port }} resources: {{ toYaml .Values.prometheus.jmx.resources | indent 12 }} volumeMounts: - - name: jmx-config - mountPath: /etc/jmx-schema-registry + - name: jmx-config + mountPath: /etc/jmx-schema-registry {{- end }} - name: {{ template "cp-schema-registry.name" . }}-server image: "{{ .Values.image }}:{{ .Values.imageTag }}" @@ -74,35 +80,36 @@ spec: resources: {{ toYaml .Values.resources | indent 12 }} env: - - name: SCHEMA_REGISTRY_HOST_NAME - valueFrom: - fieldRef: - fieldPath: status.podIP - - name: SCHEMA_REGISTRY_LISTENERS - value: http://0.0.0.0:{{ .Values.servicePort }} - - name: SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS - value: {{ template "cp-schema-registry.kafka.bootstrapServers" . }} - - name: SCHEMA_REGISTRY_KAFKASTORE_GROUP_ID - value: {{ template "cp-schema-registry.groupId" . }} - - name: SCHEMA_REGISTRY_MASTER_ELIGIBILITY - value: "true" - - name: SCHEMA_REGISTRY_HEAP_OPTS - value: "{{ .Values.heapOptions }}" + - name: SCHEMA_REGISTRY_HOST_NAME + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: SCHEMA_REGISTRY_LISTENERS + value: + http://0.0.0.0: {{ .Values.servicePort }} + - name: SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS + value: {{ template "cp-schema-registry.kafka.bootstrapServers" . }} + - name: SCHEMA_REGISTRY_KAFKASTORE_GROUP_ID + value: {{ template "cp-schema-registry.groupId" . }} + - name: SCHEMA_REGISTRY_MASTER_ELIGIBILITY + value: "true" + - name: SCHEMA_REGISTRY_HEAP_OPTS + value: "{{ .Values.heapOptions }}" {{ range $configName, $configValue := .Values.configurationOverrides }} - - name: SCHEMA_REGISTRY_{{ $configName | replace "." "_" | upper }} - value: {{ $configValue | quote }} + - name: SCHEMA_REGISTRY_{{ $configName | replace "." "_" | upper }} + value: {{ $configValue | quote }} {{ end }} {{- range $key, $value := .Values.customEnv }} - - name: {{ $key | quote }} - value: {{ $value | quote }} + - name: {{ $key | quote }} + value: {{ $value | quote }} {{- end }} {{- if .Values.schemaRegistryOpts }} - - name: SCHEMA_REGISTRY_OPTS - value: "{{ .Values.schemaRegistryOpts }}" + - name: SCHEMA_REGISTRY_OPTS + value: "{{ .Values.schemaRegistryOpts }}" {{- end }} {{- if .Values.jmx.port }} - - name: JMX_PORT - value: "{{ .Values.jmx.port }}" + - name: JMX_PORT + value: "{{ .Values.jmx.port }}" {{- end }} {{- if .Values.imagePullSecrets }} imagePullSecrets: @@ -110,9 +117,9 @@ spec: {{- end }} volumes: {{- if .Values.prometheus.jmx.enabled }} - - name: jmx-config - configMap: - name: {{ template "cp-schema-registry.fullname" . }}-jmx-configmap + - name: jmx-config + configMap: + name: {{ template "cp-schema-registry.fullname" . }}-jmx-configmap {{- end }} {{- if .Values.nodeSelector }} nodeSelector: diff --git a/values.yaml b/values.yaml index c35748c1..7bff376c 100644 --- a/values.yaml +++ b/values.yaml @@ -88,6 +88,7 @@ cp-schema-registry: # requests: # cpu: 100m # memory: 128Mi + labels: {} ## ------------------------------------------------------ ## REST Proxy From 683105a23d8cbe2facbab63ff93ebdf1cfa17ec3 Mon Sep 17 00:00:00 2001 From: tjwornjs Date: Thu, 7 Jul 2022 13:52:49 +0900 Subject: [PATCH 2/5] labels for zookeeper --- charts/cp-zookeeper/templates/statefulset.yaml | 6 ++++++ values.yaml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/charts/cp-zookeeper/templates/statefulset.yaml b/charts/cp-zookeeper/templates/statefulset.yaml index 4f4103fc..2e0e8751 100644 --- a/charts/cp-zookeeper/templates/statefulset.yaml +++ b/charts/cp-zookeeper/templates/statefulset.yaml @@ -17,6 +17,9 @@ spec: matchLabels: app: {{ template "cp-zookeeper.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- end }} serviceName: {{ template "cp-zookeeper.fullname" . }}-headless podManagementPolicy: {{ .Values.podManagementPolicy }} @@ -28,6 +31,9 @@ spec: labels: app: {{ template "cp-zookeeper.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- if or .Values.podAnnotations .Values.prometheus.jmx.enabled }} annotations: {{- range $key, $value := .Values.podAnnotations }} diff --git a/values.yaml b/values.yaml index 7bff376c..32f46d8c 100644 --- a/values.yaml +++ b/values.yaml @@ -36,6 +36,8 @@ cp-zookeeper: # requests: # cpu: 100m # memory: 128Mi + labels: {} + ## ------------------------------------------------------ ## Kafka From 1141a3edcfb05c13738cad8f2f6ce3049ffe928e Mon Sep 17 00:00:00 2001 From: tjwornjs Date: Thu, 7 Jul 2022 13:54:37 +0900 Subject: [PATCH 3/5] add labels for all components --- values.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/values.yaml b/values.yaml index 32f46d8c..1a0034a1 100644 --- a/values.yaml +++ b/values.yaml @@ -68,6 +68,7 @@ cp-kafka: # memory: 128Mi securityContext: runAsUser: 0 + labels: {} ## ------------------------------------------------------ ## Schema Registry @@ -113,6 +114,7 @@ cp-kafka-rest: # requests: # cpu: 100m # memory: 128Mi + labels: {} ## ------------------------------------------------------ ## Kafka Connect @@ -135,6 +137,7 @@ cp-kafka-connect: # requests: # cpu: 100m # memory: 128Mi + labels: {} ## ------------------------------------------------------ ## KSQL Server @@ -150,6 +153,7 @@ cp-ksql-server: heapOptions: "-Xms512M -Xmx512M" ksql: headless: false + labels: {} ## ------------------------------------------------------ ## Control Center @@ -172,3 +176,5 @@ cp-control-center: # requests: # cpu: 100m # memory: 128Mi + labels: {} + From edd203845d2cc38f01598878a096ed0c6cd45bd9 Mon Sep 17 00:00:00 2001 From: tjwornjs Date: Thu, 7 Jul 2022 13:56:27 +0900 Subject: [PATCH 4/5] add labels for control center, kafka --- charts/cp-control-center/templates/deployment.yaml | 6 ++++++ charts/cp-kafka/templates/statefulset.yaml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/charts/cp-control-center/templates/deployment.yaml b/charts/cp-control-center/templates/deployment.yaml index 4afeaf9b..bf632f7c 100644 --- a/charts/cp-control-center/templates/deployment.yaml +++ b/charts/cp-control-center/templates/deployment.yaml @@ -17,11 +17,17 @@ spec: matchLabels: app: {{ include "cp-control-center.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} template: metadata: labels: app: {{ include "cp-control-center.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- if or .Values.podAnnotations .Values.prometheus.jmx.enabled }} annotations: {{- range $key, $value := .Values.podAnnotations }} diff --git a/charts/cp-kafka/templates/statefulset.yaml b/charts/cp-kafka/templates/statefulset.yaml index 0585f60c..7fae5b48 100644 --- a/charts/cp-kafka/templates/statefulset.yaml +++ b/charts/cp-kafka/templates/statefulset.yaml @@ -17,6 +17,9 @@ spec: matchLabels: app: {{ template "cp-kafka.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- end }} serviceName: {{ template "cp-kafka.fullname" . }}-headless podManagementPolicy: {{ .Values.podManagementPolicy }} @@ -28,6 +31,9 @@ spec: labels: app: {{ template "cp-kafka.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- if or .Values.podAnnotations .Values.prometheus.jmx.enabled }} annotations: {{- range $key, $value := .Values.podAnnotations }} From 4355599663d4a41d3b454a6f402d3e770aaeadc2 Mon Sep 17 00:00:00 2001 From: tjwornjs Date: Thu, 7 Jul 2022 13:57:51 +0900 Subject: [PATCH 5/5] add labels for kafka connect, kafka rest, ksql --- charts/cp-kafka-connect/templates/deployment.yaml | 6 ++++++ charts/cp-kafka-rest/templates/deployment.yaml | 6 ++++++ charts/cp-ksql-server/templates/deployment.yaml | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/charts/cp-kafka-connect/templates/deployment.yaml b/charts/cp-kafka-connect/templates/deployment.yaml index 4582f4ac..1a68e502 100644 --- a/charts/cp-kafka-connect/templates/deployment.yaml +++ b/charts/cp-kafka-connect/templates/deployment.yaml @@ -17,11 +17,17 @@ spec: matchLabels: app: {{ template "cp-kafka-connect.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} template: metadata: labels: app: {{ template "cp-kafka-connect.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- if or .Values.podAnnotations .Values.prometheus.jmx.enabled }} annotations: {{- range $key, $value := .Values.podAnnotations }} diff --git a/charts/cp-kafka-rest/templates/deployment.yaml b/charts/cp-kafka-rest/templates/deployment.yaml index 39bca499..bb20cb67 100644 --- a/charts/cp-kafka-rest/templates/deployment.yaml +++ b/charts/cp-kafka-rest/templates/deployment.yaml @@ -17,11 +17,17 @@ spec: matchLabels: app: {{ template "cp-kafka-rest.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} template: metadata: labels: app: {{ template "cp-kafka-rest.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- if or .Values.podAnnotations .Values.prometheus.jmx.enabled }} annotations: {{- range $key, $value := .Values.podAnnotations }} diff --git a/charts/cp-ksql-server/templates/deployment.yaml b/charts/cp-ksql-server/templates/deployment.yaml index b152880c..4b03f352 100644 --- a/charts/cp-ksql-server/templates/deployment.yaml +++ b/charts/cp-ksql-server/templates/deployment.yaml @@ -17,11 +17,17 @@ spec: matchLabels: app: {{ template "cp-ksql-server.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} template: metadata: labels: app: {{ template "cp-ksql-server.name" . }} release: {{ .Release.Name }} + {{- range $key, $val := .Values.labels }} + {{ $key }} : {{ $val | quote }} + {{- end }} {{- if or .Values.podAnnotations .Values.prometheus.jmx.enabled }} annotations: {{- range $key, $value := .Values.podAnnotations }}