Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

add custom labels to kafka components #613

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/cp-control-center/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/cp-kafka-connect/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/cp-kafka-rest/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/cp-kafka/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/cp-ksql-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
81 changes: 44 additions & 37 deletions charts/cp-schema-registry/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}"
Expand All @@ -74,45 +80,46 @@ 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:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- 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:
Expand Down
6 changes: 6 additions & 0 deletions charts/cp-zookeeper/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
9 changes: 9 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ cp-zookeeper:
# requests:
# cpu: 100m
# memory: 128Mi
labels: {}


## ------------------------------------------------------
## Kafka
Expand Down Expand Up @@ -66,6 +68,7 @@ cp-kafka:
# memory: 128Mi
securityContext:
runAsUser: 0
labels: {}

## ------------------------------------------------------
## Schema Registry
Expand All @@ -88,6 +91,7 @@ cp-schema-registry:
# requests:
# cpu: 100m
# memory: 128Mi
labels: {}

## ------------------------------------------------------
## REST Proxy
Expand All @@ -110,6 +114,7 @@ cp-kafka-rest:
# requests:
# cpu: 100m
# memory: 128Mi
labels: {}

## ------------------------------------------------------
## Kafka Connect
Expand All @@ -132,6 +137,7 @@ cp-kafka-connect:
# requests:
# cpu: 100m
# memory: 128Mi
labels: {}

## ------------------------------------------------------
## KSQL Server
Expand All @@ -147,6 +153,7 @@ cp-ksql-server:
heapOptions: "-Xms512M -Xmx512M"
ksql:
headless: false
labels: {}

## ------------------------------------------------------
## Control Center
Expand All @@ -169,3 +176,5 @@ cp-control-center:
# requests:
# cpu: 100m
# memory: 128Mi
labels: {}