Helm: add support for external application config in yaml format (#2020)
* support yamlConfigMap * add support of external config map * remove test config * update helm version and readme * pass kafka-ui.yaml directly as helm chart value * fix configmap metadata name * update readme Co-authored-by: Azat Safin <azsafin@provectus.com> Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
This commit is contained in:
parent
e6f3157508
commit
f98c26e4fa
6 changed files with 96 additions and 22 deletions
|
@ -2,6 +2,6 @@ apiVersion: v2
|
||||||
name: kafka-ui
|
name: kafka-ui
|
||||||
description: A Helm chart for kafka-UI
|
description: A Helm chart for kafka-UI
|
||||||
type: application
|
type: application
|
||||||
version: 0.0.3
|
version: 0.0.4
|
||||||
appVersion: latest
|
appVersion: latest
|
||||||
icon: https://github.com/provectus/kafka-ui/raw/master/documentation/images/kafka-ui-logo.png
|
icon: https://github.com/provectus/kafka-ui/raw/master/documentation/images/kafka-ui-logo.png
|
||||||
|
|
|
@ -6,16 +6,19 @@ Most of the Helm charts parameters are common, follow table describe unique para
|
||||||
|
|
||||||
### Kafka-UI parameters
|
### Kafka-UI parameters
|
||||||
|
|
||||||
| Parameter| Description| Default|
|
| Parameter | Description | Default |
|
||||||
|---|---|---|
|
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||||
| `existingConfigMap`| Name of the existing ConfigMap with Kafka-UI environment variables | `nil`|
|
| `existingConfigMap` | Name of the existing ConfigMap with Kafka-UI environment variables | `nil` |
|
||||||
| `existingSecret`| Name of the existing Secret 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.secret` | Set of the sensitive environment variables to pass to Kafka-UI | `{}` |
|
||||||
| `envs.config`| Set of the 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`|
|
| `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 | `{}` |
|
||||||
| `networkPolicy.egressRules.customRules` | Custom network egress policy rules | `[]`|
|
| `yamlApplicationConfig` | Kafka-UI config in Yaml format | `{}` |
|
||||||
| `networkPolicy.ingressRules.customRules` | Custom network ingress policy rules | `[]`|
|
| `networkPolicy.enabled` | Enable network policies | `false` |
|
||||||
| `podLabels` | Extra labels for Kafka-UI pod | `{}`|
|
| `networkPolicy.egressRules.customRules` | Custom network egress policy rules | `[]` |
|
||||||
|
| `networkPolicy.ingressRules.customRules` | Custom network ingress policy rules | `[]` |
|
||||||
|
| `podLabels` | Extra labels for Kafka-UI pod | `{}` |
|
||||||
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{{- if .Values.envs.config -}}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -5,4 +6,5 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
{{- include "kafka-ui.labels" . | nindent 4 }}
|
{{- include "kafka-ui.labels" . | nindent 4 }}
|
||||||
data:
|
data:
|
||||||
{{- toYaml .Values.envs.config | nindent 2 }}
|
{{- toYaml .Values.envs.config | nindent 2 }}
|
||||||
|
{{- end -}}
|
11
charts/kafka-ui/templates/configmap_fromValues.yaml
Normal file
11
charts/kafka-ui/templates/configmap_fromValues.yaml
Normal file
|
@ -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 }}
|
|
@ -42,23 +42,37 @@ spec:
|
||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
{{- with .Values.env }}
|
{{- if or .Values.env .Values.yamlApplicationConfig .Values.yamlApplicationConfigConfigMap}}
|
||||||
env:
|
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 }}
|
{{- end }}
|
||||||
envFrom:
|
envFrom:
|
||||||
{{- if .Values.existingConfigMap }}
|
{{- if .Values.existingConfigMap }}
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: {{ .Values.existingConfigMap }}
|
name: {{ .Values.existingConfigMap }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.envs.config }}
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: {{ include "kafka-ui.fullname" . }}
|
name: {{ include "kafka-ui.fullname" . }}
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.existingSecret }}
|
{{- if .Values.existingSecret }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ .Values.existingSecret }}
|
name: {{ .Values.existingSecret }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.envs.secret}}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ include "kafka-ui.fullname" . }}
|
name: {{ include "kafka-ui.fullname" . }}
|
||||||
|
{{- end}}
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: 8080
|
containerPort: 8080
|
||||||
|
@ -81,13 +95,35 @@ spec:
|
||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
{{- with .Values.volumeMounts }}
|
{{- if or .Values.yamlApplicationConfig .Values.volumeMounts .Values.yamlApplicationConfigConfigMap}}
|
||||||
volumeMounts:
|
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 }}
|
{{- end }}
|
||||||
{{- with .Values.volumes }}
|
{{- if or .Values.yamlApplicationConfig .Values.volumes .Values.yamlApplicationConfigConfigMap}}
|
||||||
volumes:
|
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 }}
|
{{- end }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
|
@ -100,4 +136,4 @@ spec:
|
||||||
{{- with .Values.tolerations }}
|
{{- with .Values.tolerations }}
|
||||||
tolerations:
|
tolerations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -21,6 +21,25 @@ serviceAccount:
|
||||||
name: ""
|
name: ""
|
||||||
|
|
||||||
existingConfigMap: ""
|
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: ""
|
existingSecret: ""
|
||||||
envs:
|
envs:
|
||||||
secret: {}
|
secret: {}
|
||||||
|
@ -50,10 +69,12 @@ networkPolicy:
|
||||||
podAnnotations: {}
|
podAnnotations: {}
|
||||||
podLabels: {}
|
podLabels: {}
|
||||||
|
|
||||||
podSecurityContext: {}
|
podSecurityContext:
|
||||||
|
{}
|
||||||
# fsGroup: 2000
|
# fsGroup: 2000
|
||||||
|
|
||||||
securityContext: {}
|
securityContext:
|
||||||
|
{}
|
||||||
# capabilities:
|
# capabilities:
|
||||||
# drop:
|
# drop:
|
||||||
# - ALL
|
# - ALL
|
||||||
|
@ -97,7 +118,8 @@ ingress:
|
||||||
# Http paths to add to the Ingress after the default path
|
# Http paths to add to the Ingress after the default path
|
||||||
succeedingPaths: []
|
succeedingPaths: []
|
||||||
|
|
||||||
resources: {}
|
resources:
|
||||||
|
{}
|
||||||
# limits:
|
# limits:
|
||||||
# cpu: 200m
|
# cpu: 200m
|
||||||
# memory: 512Mi
|
# memory: 512Mi
|
||||||
|
|
Loading…
Add table
Reference in a new issue