From 9cb44815c45270b827f6931deeb422a0495da222 Mon Sep 17 00:00:00 2001 From: Marcus Rodan Date: Thu, 10 Dec 2020 09:51:04 +0100 Subject: [PATCH 1/2] Add pdb resource --- charts/flagger/templates/pdb.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 charts/flagger/templates/pdb.yaml diff --git a/charts/flagger/templates/pdb.yaml b/charts/flagger/templates/pdb.yaml new file mode 100644 index 000000000..248f1d919 --- /dev/null +++ b/charts/flagger/templates/pdb.yaml @@ -0,0 +1,11 @@ +{{- if .Values.podDisruptionBudget }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ template "flagger.name" . }} +spec: + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + selector: + matchLabels: + app.kubernetes.io/name: {{ template "flagger.name" . }} +{{- end }} From 54266acfb1aa2bb1bbf7ff1d2972c9345b574f5c Mon Sep 17 00:00:00 2001 From: Marcus Rodan Date: Thu, 10 Dec 2020 12:11:19 +0100 Subject: [PATCH 2/2] Added entry to README and added default values --- charts/flagger/README.md | 10 +++++----- charts/flagger/templates/pdb.yaml | 2 +- charts/flagger/values.yaml | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/charts/flagger/README.md b/charts/flagger/README.md index 19dbba6a5..b417ecb7a 100644 --- a/charts/flagger/README.md +++ b/charts/flagger/README.md @@ -1,6 +1,6 @@ # Flagger -[Flagger](https://github.com/weaveworks/flagger) is an operator that automates the release process of applications on Kubernetes. +[Flagger](https://github.com/weaveworks/flagger) is an operator that automates the release process of applications on Kubernetes. Flagger can run automated application analysis, testing, promotion and rollback for the following deployment strategies: * Canary Release (progressive traffic shifting) @@ -125,8 +125,8 @@ Parameter | Description | Default `slack.user` | Slack username | `flagger` `msteams.url` | Microsoft Teams incoming webhook | None `podMonitor.enabled` | If `true`, create a PodMonitor for [monitoring the metrics](https://docs.flagger.app/usage/monitoring#metrics) | `false` -`podMonitor.namespace` | Namespace where the PodMonitor is created | the same namespace -`podMonitor.interval` | Interval at which metrics should be scraped | `15s` +`podMonitor.namespace` | Namespace where the PodMonitor is created | the same namespace +`podMonitor.interval` | Interval at which metrics should be scraped | `15s` `podMonitor.podMonitor` | Additional labels to add to the PodMonitor | `{}` `leaderElection.enabled` | If `true`, Flagger will run in HA mode | `false` `leaderElection.replicaCount` | Number of replicas | `1` @@ -151,6 +151,8 @@ Parameter | Description | Default `ingressAnnotationsPrefix` | Annotations prefix for NGINX ingresses | None `ingressClass` | Ingress class used for annotating HTTPProxy objects, e.g. `contour` | None `podPriorityClassName` | PriorityClass name for pod priority configuration | "" +`podDisruptionBudget.enabled` | A PodDisruptionBudget will be created if `true` | `false` +`podDisruptionBudget.minAvailable` | The minimal number of available replicas that will be set in the PodDisruptionBudget | `1` Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade`. For example, @@ -170,5 +172,3 @@ $ helm upgrade -i flagger flagger/flagger \ ``` > **Tip**: You can use the default [values.yaml](values.yaml) - - diff --git a/charts/flagger/templates/pdb.yaml b/charts/flagger/templates/pdb.yaml index 248f1d919..24cf4231b 100644 --- a/charts/flagger/templates/pdb.yaml +++ b/charts/flagger/templates/pdb.yaml @@ -1,4 +1,4 @@ -{{- if .Values.podDisruptionBudget }} +{{- if .Values.podDisruptionBudget.enabled }} apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: diff --git a/charts/flagger/values.yaml b/charts/flagger/values.yaml index a6fb846a3..d25f85dfc 100644 --- a/charts/flagger/values.yaml +++ b/charts/flagger/values.yaml @@ -138,3 +138,7 @@ istio: secretName: "" # istio.kubeconfig.key: The name of secret data key that contains the Istio control plane kubeconfig key: "kubeconfig" + +podDisruptionBudget: + enabled: false + minAvailable: 1