From 5b5c7f2bb20678f65a4f4f86fb92975f95703936 Mon Sep 17 00:00:00 2001 From: Jose Santorum Date: Wed, 15 May 2024 09:54:40 +0200 Subject: [PATCH] feat: add pod-disruption-budget support (#142) --- charts/unleash-edge/Chart.yaml | 10 ++++++++-- charts/unleash-edge/templates/pdb.yaml | 19 +++++++++++++++++++ charts/unleash-edge/values.yaml | 5 +++++ charts/unleash-proxy/Chart.yaml | 10 ++++++++-- charts/unleash-proxy/templates/pdb.yaml | 19 +++++++++++++++++++ charts/unleash-proxy/values.yaml | 5 +++++ charts/unleash/Chart.yaml | 15 +++++++++++---- charts/unleash/templates/pdb.yaml | 19 +++++++++++++++++++ charts/unleash/values.yaml | 5 +++++ 9 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 charts/unleash-edge/templates/pdb.yaml create mode 100644 charts/unleash-proxy/templates/pdb.yaml create mode 100644 charts/unleash/templates/pdb.yaml diff --git a/charts/unleash-edge/Chart.yaml b/charts/unleash-edge/Chart.yaml index 6f13172..c8dc6db 100644 --- a/charts/unleash-edge/Chart.yaml +++ b/charts/unleash-edge/Chart.yaml @@ -1,14 +1,20 @@ ---- apiVersion: v2 name: unleash-edge description: A Helm chart for deploying Unleash Edge to kubernetes icon: https://docs.getunleash.io/img/logo.svg + type: application -version: 2.5.0 + +version: 2.6.0 appVersion: "v19.0.0" + maintainers: - name: chriswk - name: sighphyre - name: nunogois - name: gastonfournier + +sources: + - https://github.com/Unleash/unleash-edge + - https://github.com/Unleash/helm-charts diff --git a/charts/unleash-edge/templates/pdb.yaml b/charts/unleash-edge/templates/pdb.yaml new file mode 100644 index 0000000..13f9bc5 --- /dev/null +++ b/charts/unleash-edge/templates/pdb.yaml @@ -0,0 +1,19 @@ +{{- if .Values.podDisruptionBudget.enabled }} +apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (.Capabilities.APIVersions.Has "policy/v1") }} +kind: PodDisruptionBudget +metadata: + name: {{ template "unleash-edge.fullname" . }} + labels: + {{- include "unleash-edge.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- else if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- else }} + minAvailable: 0 + {{- end }} + selector: + matchLabels: + {{- include "unleash-edge.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/unleash-edge/values.yaml b/charts/unleash-edge/values.yaml index 9db6f46..b3c9c0b 100644 --- a/charts/unleash-edge/values.yaml +++ b/charts/unleash-edge/values.yaml @@ -173,3 +173,8 @@ edge: upstreamUrl: "http://unleash.unleash:4242" logLevel: "warn" logFormat: "json" + +podDisruptionBudget: + enabled: false + minAvailable: + maxUnavailable: 1 diff --git a/charts/unleash-proxy/Chart.yaml b/charts/unleash-proxy/Chart.yaml index 197a75a..cd2ad5b 100644 --- a/charts/unleash-proxy/Chart.yaml +++ b/charts/unleash-proxy/Chart.yaml @@ -1,6 +1,7 @@ apiVersion: v2 name: unleash-proxy -description: A Helm chart for Kubernetes +description: A Helm chart for deploying Unleash Proxy to kubernetes +icon: https://docs.getunleash.io/img/logo.svg # A chart can be either an 'application' or a 'library' chart. # @@ -15,12 +16,17 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.6.3 +version: 0.7.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "v0.17.0" + maintainers: - name: nkz-soft + +sources: + - https://github.com/Unleash/unleash-proxy + - https://github.com/Unleash/helm-charts diff --git a/charts/unleash-proxy/templates/pdb.yaml b/charts/unleash-proxy/templates/pdb.yaml new file mode 100644 index 0000000..ec7cce4 --- /dev/null +++ b/charts/unleash-proxy/templates/pdb.yaml @@ -0,0 +1,19 @@ +{{- if .Values.podDisruptionBudget.enabled }} +apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (.Capabilities.APIVersions.Has "policy/v1") }} +kind: PodDisruptionBudget +metadata: + name: {{ template "unleash-proxy.fullname" . }} + labels: + {{- include "unleash-proxy.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- else if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- else }} + minAvailable: 0 + {{- end }} + selector: + matchLabels: + {{- include "unleash-proxy.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/unleash-proxy/values.yaml b/charts/unleash-proxy/values.yaml index d5a122a..8455efd 100644 --- a/charts/unleash-proxy/values.yaml +++ b/charts/unleash-proxy/values.yaml @@ -134,3 +134,8 @@ proxy: enabled: false name: unleash-proxy-secret key: clientKeys + +podDisruptionBudget: + enabled: false + minAvailable: + maxUnavailable: 1 diff --git a/charts/unleash/Chart.yaml b/charts/unleash/Chart.yaml index f30ee7e..b91577b 100644 --- a/charts/unleash/Chart.yaml +++ b/charts/unleash/Chart.yaml @@ -1,18 +1,25 @@ apiVersion: v2 +name: unleash +description: Unleash is a open source feature flag & toggle system, that gives you a great overview over all feature toggles across all your applications and services. +icon: https://docs.getunleash.io/img/logo.svg + +type: application + +version: 4.2.0 + appVersion: "5.12.2" + dependencies: - name: postgresql repository: https://charts.bitnami.com/bitnami version: 12.1.6 condition: postgresql.enabled -description: Unleash is a open source feature flag & toggle system, that gives you a great overview over all feature toggles across all your applications and services. + maintainers: - name: evanstucker-hates-2fa - name: ivarconr email: ivarconr@gmail.com -name: unleash + sources: - https://github.com/Unleash/unleash - https://github.com/Unleash/helm-charts -type: application -version: 4.1.1 diff --git a/charts/unleash/templates/pdb.yaml b/charts/unleash/templates/pdb.yaml new file mode 100644 index 0000000..684bd72 --- /dev/null +++ b/charts/unleash/templates/pdb.yaml @@ -0,0 +1,19 @@ +{{- if .Values.podDisruptionBudget.enabled }} +apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (.Capabilities.APIVersions.Has "policy/v1") }} +kind: PodDisruptionBudget +metadata: + name: {{ template "unleash.fullname" . }} + labels: + {{- include "unleash.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- else if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- else }} + minAvailable: 0 + {{- end }} + selector: + matchLabels: + {{- include "unleash.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/unleash/values.yaml b/charts/unleash/values.yaml index 0a47db6..b644e26 100644 --- a/charts/unleash/values.yaml +++ b/charts/unleash/values.yaml @@ -312,3 +312,8 @@ cloudsql: # memory: 256Mi # Additional flags to pass to cloudsql flags: [] + +podDisruptionBudget: + enabled: false + minAvailable: + maxUnavailable: 1