Skip to content

Commit 0ab2270

Browse files
add chart files
1 parent d6ae5a6 commit 0ab2270

17 files changed

+691
-0
lines changed

charts/kafka-ui/.helmignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
example/
25+
README.md

charts/kafka-ui/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
name: kafka-ui
3+
description: A Helm chart for kafka-UI
4+
type: application
5+
version: 0.7.0
6+
appVersion: v0.7.0
7+
icon: https://github.com/provectus/kafka-ui/raw/master/documentation/images/kafka-ui-logo.png

charts/kafka-ui/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please refer to our [documentation](https://docs.kafka-ui.provectus.io/configuration/helm-charts) to get some info on our helm charts.

charts/kafka-ui/index.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
apiVersion: v1
2+
entries: {}
3+
generated: "2021-11-11T12:26:08.479581+03:00"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "kafka-ui.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "kafka-ui.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "kafka-ui.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "kafka-ui.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
echo "Visit http://127.0.0.1:8080 to use your application"
20+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:8080
21+
{{- end }}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "kafka-ui.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
7+
{{- end }}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "kafka-ui.fullname" -}}
15+
{{- if .Values.fullnameOverride }}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
17+
{{- else }}
18+
{{- $name := default .Chart.Name .Values.nameOverride }}
19+
{{- if contains $name .Release.Name }}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
21+
{{- else }}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
23+
{{- end }}
24+
{{- end }}
25+
{{- end }}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "kafka-ui.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
32+
{{- end }}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "kafka-ui.labels" -}}
38+
helm.sh/chart: {{ include "kafka-ui.chart" . }}
39+
{{ include "kafka-ui.selectorLabels" . }}
40+
{{- if .Chart.AppVersion }}
41+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42+
{{- end }}
43+
app.kubernetes.io/managed-by: {{ .Release.Service }}
44+
{{- end }}
45+
46+
{{/*
47+
Selector labels
48+
*/}}
49+
{{- define "kafka-ui.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "kafka-ui.name" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
{{- end }}
53+
54+
{{/*
55+
Create the name of the service account to use
56+
*/}}
57+
{{- define "kafka-ui.serviceAccountName" -}}
58+
{{- if .Values.serviceAccount.create }}
59+
{{- default (include "kafka-ui.fullname" .) .Values.serviceAccount.name }}
60+
{{- else }}
61+
{{- default "default" .Values.serviceAccount.name }}
62+
{{- end }}
63+
{{- end }}
64+
65+
66+
{{/*
67+
This allows us to check if the registry of the image is specified or not.
68+
*/}}
69+
{{- define "kafka-ui.imageName" -}}
70+
{{- $registryName := .Values.image.registry -}}
71+
{{- if .Values.global }}
72+
{{- if .Values.global.imageRegistry }}
73+
{{- $registryName = .Values.global.imageRegistry -}}
74+
{{- end -}}
75+
{{- end -}}
76+
{{- $repository := .Values.image.repository -}}
77+
{{- $tag := .Values.image.tag | default .Chart.AppVersion -}}
78+
{{- if $registryName }}
79+
{{- printf "%s/%s:%s" $registryName $repository $tag -}}
80+
{{- else }}
81+
{{- printf "%s:%s" $repository $tag -}}
82+
{{- end }}
83+
{{- end -}}
84+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if .Values.envs.config -}}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "kafka-ui.fullname" . }}
6+
labels:
7+
{{- include "kafka-ui.labels" . | nindent 4 }}
8+
data:
9+
{{- toYaml .Values.envs.config | nindent 2 }}
10+
{{- end -}}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- if .Values.yamlApplicationConfig -}}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "kafka-ui.fullname" . }}-fromvalues
6+
labels:
7+
{{- include "kafka-ui.labels" . | nindent 4 }}
8+
data:
9+
config.yml: |-
10+
{{- toYaml .Values.yamlApplicationConfig | nindent 4}}
11+
{{ end }}
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "kafka-ui.fullname" . }}
5+
labels:
6+
{{- include "kafka-ui.labels" . | nindent 4 }}
7+
{{- with .Values.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
spec:
12+
{{- if not .Values.autoscaling.enabled }}
13+
replicas: {{ .Values.replicaCount }}
14+
{{- end }}
15+
selector:
16+
matchLabels:
17+
{{- include "kafka-ui.selectorLabels" . | nindent 6 }}
18+
template:
19+
metadata:
20+
annotations:
21+
{{- with .Values.podAnnotations }}
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
24+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
25+
checksum/configFromValues: {{ include (print $.Template.BasePath "/configmap_fromValues.yaml") . | sha256sum }}
26+
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
27+
labels:
28+
{{- include "kafka-ui.selectorLabels" . | nindent 8 }}
29+
{{- if .Values.podLabels }}
30+
{{- toYaml .Values.podLabels | nindent 8 }}
31+
{{- end }}
32+
spec:
33+
{{- with .Values.imagePullSecrets }}
34+
imagePullSecrets:
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
37+
{{- with .Values.initContainers }}
38+
initContainers:
39+
{{- toYaml . | nindent 8 }}
40+
{{- end }}
41+
serviceAccountName: {{ include "kafka-ui.serviceAccountName" . }}
42+
securityContext:
43+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
44+
containers:
45+
- name: {{ .Chart.Name }}
46+
securityContext:
47+
{{- toYaml .Values.securityContext | nindent 12 }}
48+
image: {{ include "kafka-ui.imageName" . }}
49+
imagePullPolicy: {{ .Values.image.pullPolicy }}
50+
{{- if or .Values.env .Values.yamlApplicationConfig .Values.yamlApplicationConfigConfigMap}}
51+
env:
52+
{{- with .Values.env }}
53+
{{- toYaml . | nindent 12 }}
54+
{{- end }}
55+
{{- if or .Values.yamlApplicationConfig .Values.yamlApplicationConfigConfigMap}}
56+
- name: SPRING_CONFIG_ADDITIONAL-LOCATION
57+
{{- if .Values.yamlApplicationConfig }}
58+
value: /kafka-ui/config.yml
59+
{{- else if .Values.yamlApplicationConfigConfigMap }}
60+
value: /kafka-ui/{{ .Values.yamlApplicationConfigConfigMap.keyName | default "config.yml" }}
61+
{{- end }}
62+
{{- end }}
63+
{{- end }}
64+
envFrom:
65+
{{- if .Values.existingConfigMap }}
66+
- configMapRef:
67+
name: {{ .Values.existingConfigMap }}
68+
{{- end }}
69+
{{- if .Values.envs.config }}
70+
- configMapRef:
71+
name: {{ include "kafka-ui.fullname" . }}
72+
{{- end }}
73+
{{- if .Values.existingSecret }}
74+
- secretRef:
75+
name: {{ .Values.existingSecret }}
76+
{{- end }}
77+
{{- if .Values.envs.secret}}
78+
- secretRef:
79+
name: {{ include "kafka-ui.fullname" . }}
80+
{{- end}}
81+
ports:
82+
- name: http
83+
containerPort: 8080
84+
protocol: TCP
85+
livenessProbe:
86+
httpGet:
87+
{{- $contextPath := .Values.envs.config.SERVER_SERVLET_CONTEXT_PATH | default "" | printf "%s/actuator/health" | urlParse }}
88+
path: {{ get $contextPath "path" }}
89+
port: http
90+
{{- if .Values.probes.useHttpsScheme }}
91+
scheme: HTTPS
92+
{{- end }}
93+
initialDelaySeconds: 60
94+
periodSeconds: 30
95+
timeoutSeconds: 10
96+
readinessProbe:
97+
httpGet:
98+
{{- $contextPath := .Values.envs.config.SERVER_SERVLET_CONTEXT_PATH | default "" | printf "%s/actuator/health" | urlParse }}
99+
path: {{ get $contextPath "path" }}
100+
port: http
101+
{{- if .Values.probes.useHttpsScheme }}
102+
scheme: HTTPS
103+
{{- end }}
104+
initialDelaySeconds: 60
105+
periodSeconds: 30
106+
timeoutSeconds: 10
107+
resources:
108+
{{- toYaml .Values.resources | nindent 12 }}
109+
{{- if or .Values.yamlApplicationConfig .Values.volumeMounts .Values.yamlApplicationConfigConfigMap}}
110+
volumeMounts:
111+
{{- with .Values.volumeMounts }}
112+
{{- toYaml . | nindent 12 }}
113+
{{- end }}
114+
{{- if .Values.yamlApplicationConfig }}
115+
- name: kafka-ui-yaml-conf
116+
mountPath: /kafka-ui/
117+
{{- end }}
118+
{{- if .Values.yamlApplicationConfigConfigMap}}
119+
- name: kafka-ui-yaml-conf-configmap
120+
mountPath: /kafka-ui/
121+
{{- end }}
122+
{{- end }}
123+
{{- if or .Values.yamlApplicationConfig .Values.volumes .Values.yamlApplicationConfigConfigMap}}
124+
volumes:
125+
{{- with .Values.volumes }}
126+
{{- toYaml . | nindent 8 }}
127+
{{- end }}
128+
{{- if .Values.yamlApplicationConfig }}
129+
- name: kafka-ui-yaml-conf
130+
configMap:
131+
name: {{ include "kafka-ui.fullname" . }}-fromvalues
132+
{{- end }}
133+
{{- if .Values.yamlApplicationConfigConfigMap}}
134+
- name: kafka-ui-yaml-conf-configmap
135+
configMap:
136+
name: {{ .Values.yamlApplicationConfigConfigMap.name }}
137+
{{- end }}
138+
{{- end }}
139+
{{- with .Values.nodeSelector }}
140+
nodeSelector:
141+
{{- toYaml . | nindent 8 }}
142+
{{- end }}
143+
{{- with .Values.affinity }}
144+
affinity:
145+
{{- toYaml . | nindent 8 }}
146+
{{- end }}
147+
{{- with .Values.tolerations }}
148+
tolerations:
149+
{{- toYaml . | nindent 8 }}
150+
{{- end }}

charts/kafka-ui/templates/hpa.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{{- if .Values.autoscaling.enabled }}
2+
{{- $kubeCapabilityVersion := semver .Capabilities.KubeVersion.Version -}}
3+
{{- $isHigher1p25 := ge (semver "1.25" | $kubeCapabilityVersion.Compare) 0 -}}
4+
{{- if and ($.Capabilities.APIVersions.Has "autoscaling/v2") $isHigher1p25 -}}
5+
apiVersion: autoscaling/v2
6+
{{- else }}
7+
apiVersion: autoscaling/v2beta1
8+
{{- end }}
9+
kind: HorizontalPodAutoscaler
10+
metadata:
11+
name: {{ include "kafka-ui.fullname" . }}
12+
labels:
13+
{{- include "kafka-ui.labels" . | nindent 4 }}
14+
spec:
15+
scaleTargetRef:
16+
apiVersion: apps/v1
17+
kind: Deployment
18+
name: {{ include "kafka-ui.fullname" . }}
19+
minReplicas: {{ .Values.autoscaling.minReplicas }}
20+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
21+
metrics:
22+
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
23+
- type: Resource
24+
resource:
25+
name: cpu
26+
{{- if $isHigher1p25 }}
27+
target:
28+
type: Utilization
29+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
30+
{{- else }}
31+
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
32+
{{- end }}
33+
{{- end }}
34+
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
35+
- type: Resource
36+
resource:
37+
name: memory
38+
{{- if $isHigher1p25 }}
39+
target:
40+
type: Utilization
41+
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
42+
{{- else }}
43+
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
44+
{{- end }}
45+
{{- end }}
46+
{{- end }}

0 commit comments

Comments
 (0)