From b91c6dc497dd2b4ae6d49bc6de821b25266376ef Mon Sep 17 00:00:00 2001 From: micrOsman <44233103+micrOsman@users.noreply.github.com> Date: Mon, 26 Jun 2023 09:22:15 +0000 Subject: [PATCH 1/5] Add support for PDB and TopologySpreadConstraints --- charts/kafka-ui/templates/deployment.yaml | 8 ++++++++ charts/kafka-ui/templates/pdb.yaml | 18 ++++++++++++++++++ charts/kafka-ui/values.yaml | 18 ++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 charts/kafka-ui/templates/pdb.yaml diff --git a/charts/kafka-ui/templates/deployment.yaml b/charts/kafka-ui/templates/deployment.yaml index 3e4ac2b4..f28d351c 100644 --- a/charts/kafka-ui/templates/deployment.yaml +++ b/charts/kafka-ui/templates/deployment.yaml @@ -41,6 +41,10 @@ spec: serviceAccountName: {{ include "kafka-ui.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- with .Values.priorityClassName }} + priorityClassName: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: @@ -148,3 +152,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/kafka-ui/templates/pdb.yaml b/charts/kafka-ui/templates/pdb.yaml new file mode 100644 index 00000000..123c57fa --- /dev/null +++ b/charts/kafka-ui/templates/pdb.yaml @@ -0,0 +1,18 @@ +{{- if .Values.podDisruptionBudget.enabled -}} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "kafka-ui.fullname" . }} + labels: + {{- include "kafka-ui.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "kafka-ui.selectorLabels" . | nindent 6 }} +{{- end -}} diff --git a/charts/kafka-ui/values.yaml b/charts/kafka-ui/values.yaml index 72038e9b..9726f909 100644 --- a/charts/kafka-ui/values.yaml +++ b/charts/kafka-ui/values.yaml @@ -91,6 +91,17 @@ securityContext: # runAsNonRoot: true # runAsUser: 1000 +## Set Pod Priority Class - importance of Pod relatives to other pods +## +priorityClassName: system-cluster-critical + +## Set Pod Disruption Budget to limit the number of concurrent disruptions +## Ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ +podDisruptionBudget: + enabled: false + minAvailable: "" + maxUnavailable: "" + service: type: ClusterIP port: 80 @@ -161,3 +172,10 @@ initContainers: {} volumeMounts: {} volumes: {} + +## Set custom TopologySpreadConstraints to manage the distribution of Pods across cluster’s failure-domains +## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ +topologySpreadConstraints: [] + # - maxSkew: 1 + # topologyKey: kubernetes.io/hostname + # whenUnsatisfiable: DoNotSchedule From 2182083bdd76b8456104e8cdd205d5705b92b649 Mon Sep 17 00:00:00 2001 From: micrOsman <44233103+micrOsman@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:28:22 +0200 Subject: [PATCH 2/5] Change priorityClassName value --- charts/kafka-ui/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kafka-ui/values.yaml b/charts/kafka-ui/values.yaml index 9726f909..fb24666d 100644 --- a/charts/kafka-ui/values.yaml +++ b/charts/kafka-ui/values.yaml @@ -93,7 +93,7 @@ securityContext: ## Set Pod Priority Class - importance of Pod relatives to other pods ## -priorityClassName: system-cluster-critical +priorityClassName: default ## Set Pod Disruption Budget to limit the number of concurrent disruptions ## Ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ From d1a1729f86d661c8462c70a50cbcf263cb67e8d1 Mon Sep 17 00:00:00 2001 From: micrOsman <44233103+micrOsman@users.noreply.github.com> Date: Mon, 31 Jul 2023 14:59:25 +0200 Subject: [PATCH 3/5] Version update --- charts/kafka-ui/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kafka-ui/Chart.yaml b/charts/kafka-ui/Chart.yaml index f3f2501d..789021fb 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.7.1 -appVersion: v0.7.0 +version: 0.7.3 +appVersion: v0.7.1 icon: https://github.com/provectus/kafka-ui/raw/master/documentation/images/kafka-ui-logo.png From 2962fae4c1d2377d91406bd86de321d2031723f9 Mon Sep 17 00:00:00 2001 From: micrOsman <44233103+micrOsman@users.noreply.github.com> Date: Thu, 17 Aug 2023 14:39:28 +0000 Subject: [PATCH 4/5] PDB: add logic for correct apiVersion --- charts/kafka-ui/templates/pdb.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/kafka-ui/templates/pdb.yaml b/charts/kafka-ui/templates/pdb.yaml index 123c57fa..3710c489 100644 --- a/charts/kafka-ui/templates/pdb.yaml +++ b/charts/kafka-ui/templates/pdb.yaml @@ -1,5 +1,11 @@ {{- if .Values.podDisruptionBudget.enabled -}} +{{- $kubeCapabilityVersion := semver .Capabilities.KubeVersion.Version -}} +{{- $isHigher1p21 := ge (semver "1.21" | $kubeCapabilityVersion.Compare) 0 -}} +{{- if $isHigher1p21 -}} apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 +{{- end }} kind: PodDisruptionBudget metadata: name: {{ include "kafka-ui.fullname" . }} From 1582768cd9353195f0095692a74bddb7ed6c134d Mon Sep 17 00:00:00 2001 From: Narekmat <47845266+Narekmat@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:51:13 +0400 Subject: [PATCH 5/5] Update Chart.yaml --- charts/kafka-ui/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kafka-ui/Chart.yaml b/charts/kafka-ui/Chart.yaml index a7f0cf2e..a296f4f7 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.7.4 +version: 0.7.5 appVersion: v0.7.1 icon: https://github.com/provectus/kafka-ui/raw/master/documentation/images/kafka-ui-logo.png