diff --git a/charts/kafka-ui/Chart.yaml b/charts/kafka-ui/Chart.yaml index 822f089f2b..1177e74887 100644 --- a/charts/kafka-ui/Chart.yaml +++ b/charts/kafka-ui/Chart.yaml @@ -2,6 +2,6 @@ apiVersion: v2 name: kafka-ui description: A Helm chart for kafka-UI type: application -version: 0.0.3 +version: 0.0.4 appVersion: latest icon: https://github.com/provectus/kafka-ui/raw/master/documentation/images/kafka-ui-logo.png diff --git a/charts/kafka-ui/README.md b/charts/kafka-ui/README.md index eac7aa04fd..5d08629dcb 100644 --- a/charts/kafka-ui/README.md +++ b/charts/kafka-ui/README.md @@ -6,16 +6,19 @@ Most of the Helm charts parameters are common, follow table describe unique para ### Kafka-UI parameters -| Parameter| Description| Default| -|---|---|---| -| `existingConfigMap`| Name of the existing ConfigMap with Kafka-UI environment variables | `nil`| -| `existingSecret`| Name of the existing Secret with Kafka-UI environment variables| `nil`| -| `envs.secret`| Set of the sensitive environment variables to pass to Kafka-UI | `{}`| -| `envs.config`| Set of the environment variables to pass to Kafka-UI | `{}`| -| `networkPolicy.enabled` | Enable network policies | `false`| -| `networkPolicy.egressRules.customRules` | Custom network egress policy rules | `[]`| -| `networkPolicy.ingressRules.customRules` | Custom network ingress policy rules | `[]`| -| `podLabels` | Extra labels for Kafka-UI pod | `{}`| +| Parameter | Description | Default | +| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `existingConfigMap` | Name of the existing ConfigMap with Kafka-UI environment variables | `nil` | +| `existingSecret` | Name of the existing Secret with Kafka-UI environment variables | `nil` | +| `envs.secret` | Set of the sensitive environment variables to pass to Kafka-UI | `{}` | +| `envs.config` | Set of the environment variables to pass to Kafka-UI | `{}` | +| `yamlApplicationConfigConfigMap` | Map with name and keyName keys, name refers to the existing ConfigMap, keyName refers to the ConfigMap key with Kafka-UI config in Yaml format | `{}` | +| `yamlApplicationConfig` | Kafka-UI config in Yaml format | `{}` | +| `networkPolicy.enabled` | Enable network policies | `false` | +| `networkPolicy.egressRules.customRules` | Custom network egress policy rules | `[]` | +| `networkPolicy.ingressRules.customRules` | Custom network ingress policy rules | `[]` | +| `podLabels` | Extra labels for Kafka-UI pod | `{}` | + ## Example diff --git a/charts/kafka-ui/templates/configmap.yaml b/charts/kafka-ui/templates/configmap.yaml index c802e57522..22d2a69946 100644 --- a/charts/kafka-ui/templates/configmap.yaml +++ b/charts/kafka-ui/templates/configmap.yaml @@ -1,3 +1,4 @@ +{{- if .Values.envs.config -}} apiVersion: v1 kind: ConfigMap metadata: @@ -5,4 +6,5 @@ metadata: labels: {{- include "kafka-ui.labels" . | nindent 4 }} data: - {{- toYaml .Values.envs.config | nindent 2 }} \ No newline at end of file + {{- toYaml .Values.envs.config | nindent 2 }} +{{- end -}} \ No newline at end of file diff --git a/charts/kafka-ui/templates/configmap_fromValues.yaml b/charts/kafka-ui/templates/configmap_fromValues.yaml new file mode 100644 index 0000000000..55a4e3b328 --- /dev/null +++ b/charts/kafka-ui/templates/configmap_fromValues.yaml @@ -0,0 +1,11 @@ +{{- if .Values.yamlApplicationConfig -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "kafka-ui.fullname" . }}-fromvalues + labels: + {{- include "kafka-ui.labels" . | nindent 4 }} +data: + config.yml: + {{- toYaml .Values.yamlApplicationConfig | nindent 4}} +{{ end }} \ No newline at end of file diff --git a/charts/kafka-ui/templates/deployment.yaml b/charts/kafka-ui/templates/deployment.yaml index 630d93c832..22149bb751 100644 --- a/charts/kafka-ui/templates/deployment.yaml +++ b/charts/kafka-ui/templates/deployment.yaml @@ -42,23 +42,37 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.env }} + {{- if or .Values.env .Values.yamlApplicationConfig .Values.yamlApplicationConfigConfigMap}} env: - {{- toYaml . | nindent 12 }} + {{- with .Values.env }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if or .Values.yamlApplicationConfig .Values.yamlApplicationConfigConfigMap}} + - name: SPRING_CONFIG_LOCATION + {{- if .Values.yamlApplicationConfig }} + value: /kafka-ui/config.yml + {{- else if .Values.yamlApplicationConfigConfigMap }} + value: /kafka-ui/{{ .Values.yamlApplicationConfigConfigMap.keyName | default "config.yml" }} + {{- end }} + {{- end }} {{- end }} envFrom: {{- if .Values.existingConfigMap }} - configMapRef: name: {{ .Values.existingConfigMap }} {{- end }} + {{- if .Values.envs.config }} - configMapRef: name: {{ include "kafka-ui.fullname" . }} + {{- end }} {{- if .Values.existingSecret }} - secretRef: name: {{ .Values.existingSecret }} {{- end }} + {{- if .Values.envs.secret}} - secretRef: name: {{ include "kafka-ui.fullname" . }} + {{- end}} ports: - name: http containerPort: 8080 @@ -81,13 +95,35 @@ spec: timeoutSeconds: 10 resources: {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.volumeMounts }} + {{- if or .Values.yamlApplicationConfig .Values.volumeMounts .Values.yamlApplicationConfigConfigMap}} volumeMounts: - {{- toYaml . | nindent 12 }} + {{- with .Values.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.yamlApplicationConfig }} + - name: kafka-ui-yaml-conf + mountPath: /kafka-ui/ + {{- end }} + {{- if .Values.yamlApplicationConfigConfigMap}} + - name: kafka-ui-yaml-conf-configmap + mountPath: /kafka-ui/ + {{- end }} {{- end }} - {{- with .Values.volumes }} + {{- if or .Values.yamlApplicationConfig .Values.volumes .Values.yamlApplicationConfigConfigMap}} volumes: - {{- toYaml . | nindent 8 }} + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.yamlApplicationConfig }} + - name: kafka-ui-yaml-conf + configMap: + name: {{ include "kafka-ui.fullname" . }}-fromvalues + {{- end }} + {{- if .Values.yamlApplicationConfigConfigMap}} + - name: kafka-ui-yaml-conf-configmap + configMap: + name: {{ .Values.yamlApplicationConfigConfigMap.name }} + {{- end }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: @@ -100,4 +136,4 @@ spec: {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} \ No newline at end of file diff --git a/charts/kafka-ui/values.yaml b/charts/kafka-ui/values.yaml index 33dcfb0b30..904cb4e6cc 100644 --- a/charts/kafka-ui/values.yaml +++ b/charts/kafka-ui/values.yaml @@ -21,6 +21,25 @@ serviceAccount: name: "" existingConfigMap: "" +yamlApplicationConfig: + {} + # kafka: + # clusters: + # - name: yaml + # bootstrapServers: kafka-service:9092 + # spring: + # security: + # oauth2: + # auth: + # type: disabled + # management: + # health: + # ldap: + # enabled: false +yamlApplicationConfigConfigMap: + {} + # keyName: config.yml + # name: configMapName existingSecret: "" envs: secret: {} @@ -50,10 +69,12 @@ networkPolicy: podAnnotations: {} podLabels: {} -podSecurityContext: {} +podSecurityContext: + {} # fsGroup: 2000 -securityContext: {} +securityContext: + {} # capabilities: # drop: # - ALL @@ -97,7 +118,8 @@ ingress: # Http paths to add to the Ingress after the default path succeedingPaths: [] -resources: {} +resources: + {} # limits: # cpu: 200m # memory: 512Mi