From 367b6bef22a1e3aaaeacf7eae9c3a94bfd8d24d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stevo=20Slavi=C4=87?= Date: Tue, 17 Mar 2020 15:36:44 +0100 Subject: [PATCH 1/4] Enabled HPA and PDB only when resource requests are set --- CHANGELOG.md | 4 ++-- .../templates/controller-hpa.yaml | 2 +- .../templates/controller-poddisruptionbudget.yaml | 2 +- helm/nginx-ingress-controller-app/values.yaml | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e168b037..1b94ff6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,8 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s - Adjust resource requests, HPA and PDB depending on determined cluster profile; supported cluster profiles include xxs, xs, small, and larger than small or unknown. ([#38](https://github.com/giantswarm/nginx-ingress-controller-app/pull/38)) By default, for nginx on: - - xxs clusters - clear resource requests, HPA and PDB are disabled - - xs clusters - clear resource requests, enabled HPA and PDB + - xxs clusters - single replica, resource requests cleared, HPA and PDB are disabled + - xs clusters - single replica, have some resource requests, HPA and PDB are disabled - small clusters - have some resource requests, HPA and PDB are enabled - clusters larger than small or unknown - have decent resource requests i.e. capacity out-of-the-box, and HPA and PDB are enabled. diff --git a/helm/nginx-ingress-controller-app/templates/controller-hpa.yaml b/helm/nginx-ingress-controller-app/templates/controller-hpa.yaml index aed409ad..4d8889ee 100644 --- a/helm/nginx-ingress-controller-app/templates/controller-hpa.yaml +++ b/helm/nginx-ingress-controller-app/templates/controller-hpa.yaml @@ -1,4 +1,4 @@ -{{- if gt (.Values.cluster.profile | int) 1 }} +{{- if gt (.Values.cluster.profile | int) 2 }} {{- if index .Values.configmap "hpa-enabled" }} {{- if eq (index .Values.configmap "hpa-enabled") "true" }} apiVersion: autoscaling/v2beta1 diff --git a/helm/nginx-ingress-controller-app/templates/controller-poddisruptionbudget.yaml b/helm/nginx-ingress-controller-app/templates/controller-poddisruptionbudget.yaml index 112155bd..031ee3c0 100644 --- a/helm/nginx-ingress-controller-app/templates/controller-poddisruptionbudget.yaml +++ b/helm/nginx-ingress-controller-app/templates/controller-poddisruptionbudget.yaml @@ -1,4 +1,4 @@ -{{- if or (and (gt (.Values.cluster.profile | int) 1) (and .Values.controller.autoscaling.enabled (gt (.Values.controller.autoscaling.minReplicas | int) 1))) (gt (.Values.controller.replicaCount | int) 1) }} +{{- if or (and (gt (.Values.cluster.profile | int) 2) (and .Values.controller.autoscaling.enabled (gt (.Values.controller.autoscaling.minReplicas | int) 1))) (gt (.Values.controller.replicaCount | int) 1) }} apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: diff --git a/helm/nginx-ingress-controller-app/values.yaml b/helm/nginx-ingress-controller-app/values.yaml index 77da36b8..f7ca055e 100644 --- a/helm/nginx-ingress-controller-app/values.yaml +++ b/helm/nginx-ingress-controller-app/values.yaml @@ -81,6 +81,7 @@ controller: profile: # xxs (1) cluster profile - 1 worker node only - resource requests are not being set # xs (2) cluster profile - 2-3 worker nodes, max CPU < 4 - resource requests are not being set + # TODO set resource requests same as small once coredns scale and resources are cluster profile adjusted https://github.com/giantswarm/giantswarm/issues/9316 # small (3) cluster profile - > 3 worker nodes, max CPU still < 4 small: resources: From 31f9553c847ea5ccc58d32a7dbc920ac6e52e50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stevo=20Slavi=C4=87?= Date: Tue, 17 Mar 2020 15:38:49 +0100 Subject: [PATCH 2/4] Add changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b94ff6a..8789420e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project's packages adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Disable HPA and PDB for xs clusters since NGINX Deployment resource requests are not set there. ([#40](https://github.com/giantswarm/nginx-ingress-controller-app/pull/40)) + ## [v1.6.3] 2020-03-16 ### Changed From 2af5c9da2fb3863944d7945c842bd5d6a3e896af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stevo=20Slavi=C4=87?= Date: Tue, 17 Mar 2020 15:41:50 +0100 Subject: [PATCH 3/4] Keep 1.6.3 changelog unchanged --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8789420e..690142f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,8 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s - Adjust resource requests, HPA and PDB depending on determined cluster profile; supported cluster profiles include xxs, xs, small, and larger than small or unknown. ([#38](https://github.com/giantswarm/nginx-ingress-controller-app/pull/38)) By default, for nginx on: - - xxs clusters - single replica, resource requests cleared, HPA and PDB are disabled - - xs clusters - single replica, have some resource requests, HPA and PDB are disabled + - xxs clusters - clear resource requests, HPA and PDB are disabled + - xs clusters - clear resource requests, enabled HPA and PDB - small clusters - have some resource requests, HPA and PDB are enabled - clusters larger than small or unknown - have decent resource requests i.e. capacity out-of-the-box, and HPA and PDB are enabled. From 4c017653299f07b4ae1ef7efd88b5d52b9c55d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stevo=20Slavi=C4=87?= Date: Tue, 17 Mar 2020 15:43:00 +0100 Subject: [PATCH 4/4] Adjust configuration docs --- helm/nginx-ingress-controller-app/Configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/nginx-ingress-controller-app/Configuration.md b/helm/nginx-ingress-controller-app/Configuration.md index 7d36a410..5e609fb8 100644 --- a/helm/nginx-ingress-controller-app/Configuration.md +++ b/helm/nginx-ingress-controller-app/Configuration.md @@ -10,7 +10,7 @@ Parameter | Description | Default --- | --- | --- `baseDomain` | Cluster base domain. Dynamically calculated during cluster creation. Manual change doesn't affect this value | 'uun5a.k8s.ginger.eu-central-1.aws.gigantic.io' `clusterID` | Cluster ID. Dynamically calculated during cluster creation. Manual change doesn't affect this value | 'uun5a' -`cluster.profile` | Cluster usage profile. Dynamically calculated during cluster creation. Supported values are `1` for extra extra small, `2` for extra small, `3` for small, and currently any value higher than 3 when actual cluster profile is larger than small or unknown. By default HPA and PDB are disabled, and resource requests unset for extra extra small clusters. On extra small clusters there are still no resource requests, HPA and PDB are enabled by default. On small clusters some small resource requests are made, HPA and PDB are enabled by default. On larger than small clusters HPA and PDB are enabled by default, and non-trivial resource requests set for some out-of-the-box guaranteed capacity. | `4` +`cluster.profile` | Cluster usage profile. Dynamically calculated during cluster creation. Supported values are `1` for extra extra small, `2` for extra small, `3` for small, and currently any value higher than 3 when actual cluster profile is larger than small or unknown. By default HPA and PDB are disabled, and resource requests unset for extra extra small clusters and extra small clusters. On small clusters some small resource requests are made, HPA and PDB are enabled by default. On larger than small clusters HPA and PDB are enabled by default, and non-trivial resource requests set for some out-of-the-box guaranteed capacity. | `4` `configmap` | Sets the nginx configmap configuration overrides. | See official docs for nginx [configmap configuration options](https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/configmap.md#configuration-options) and their defaults. Built-in overrides are covered below. `configmap.annotations-prefix` | This configuration property is deprecated and will be removed in the future, please migrate to `controller.annotationsPrefix`. | not configured by default `configmap.default-ssl-certificate` | This configuration property is deprecated and will be removed in the future, please migrate to `controller.defaultSSLCertificate`. | not configured by default