From 3eedc8f92e48faaadb4bc80a6f874fb4ba0571a6 Mon Sep 17 00:00:00 2001 From: Hendrik M Halkow Date: Mon, 25 Nov 2019 20:40:08 +0100 Subject: [PATCH] [stable/nginx-ingress] make PDB, autoscaling and GitOps play nice with each other (#19073) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When deploying the NGINX ingress controller including autoscler via Flux, you usually don’set the replicaCount. Flux and the autoscaler interfere with each other as flux would keep changing the number of replicas to the desired values, too. By just not setting the replicaCount, you lose the pod disruption budget. With this change, you can have all three: autoscaler, GitOps deployment and a por disruption budget. Signed-off-by: Hendrik M Halkow --- stable/nginx-ingress/Chart.yaml | 2 +- .../nginx-ingress/templates/controller-poddisruptionbudget.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stable/nginx-ingress/Chart.yaml b/stable/nginx-ingress/Chart.yaml index a1dccec3ba..dc345fee11 100644 --- a/stable/nginx-ingress/Chart.yaml +++ b/stable/nginx-ingress/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: nginx-ingress -version: 1.25.0 +version: 1.25.1 appVersion: 0.26.1 home: https://github.com/kubernetes/ingress-nginx description: An nginx Ingress controller that uses ConfigMap to store the nginx configuration. diff --git a/stable/nginx-ingress/templates/controller-poddisruptionbudget.yaml b/stable/nginx-ingress/templates/controller-poddisruptionbudget.yaml index aca66b4c09..70a59c103f 100644 --- a/stable/nginx-ingress/templates/controller-poddisruptionbudget.yaml +++ b/stable/nginx-ingress/templates/controller-poddisruptionbudget.yaml @@ -1,4 +1,4 @@ -{{- if gt (.Values.controller.replicaCount | int) 1 }} +{{- if or (and .Values.controller.autoscaling.enabled (gt (.Values.controller.autoscaling.minReplicas | int) 1)) (gt (.Values.controller.replicaCount | int) 1) }} apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: