Skip to content

Commit

Permalink
Disable HPA and clear resource requests for XS clusters (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevo Slavić authored Mar 10, 2020
1 parent e10381f commit 70aadc7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, PDB and clear resource requests for extra small clusters. ([#34](https://github.com/giantswarm/nginx-ingress-controller-app/pull/34))

## [v1.6.0] 2020-02-28

### Changed
Expand Down
3 changes: 2 additions & 1 deletion helm/nginx-ingress-controller-app/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +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 small, and currently any value higher than 1 when actual cluster profile is unknown. HPA and PDB are disabled, and resource requests unset for extra small clusters. | `2`
`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.error-log-level` | Configures the logging level of errors. | "error"
`configmap.hsts` | Enables or disables the HTTP Strict Transport Security (HSTS) header in servers running SSL. | "false"
Expand All @@ -19,7 +20,7 @@ Parameter | Description | Default
`configmap.use-forwarded-headers` | If true, NGINX passes the incoming `X-Forwarded-*` headers to upstreams. | "true"
`controller.annotationsPrefix` | Prefix of the Ingress annotations specific to the NGINX controller. | `nginx.ingress.kubernetes.io`
`controller.autoscaling.enabled` | Enables or disables Horizontal Pod Autoscaler (HPA) for NGINX Ingress Controller Deployment. | `true`
`controller.autoscaling.minReplicas` | Configures HPA min replicas. | `1`
`controller.autoscaling.minReplicas` | Configures HPA min replicas. | `2`
`controller.autoscaling.maxReplicas` | Configures HPA max replicas. | `20`
`controller.autoscaling.targetCPUUtilizationPercentage` | Configures HPA target CPU utilization percentage. | `50`
`controller.autoscaling.targetMemoryUtilizationPercentage` | Configures HPA target memory utilization percentage. | `50`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ spec:
path: /healthz
port: {{ .Values.controller.metrics.port }}
scheme: HTTP
{{- if (gt (.Values.cluster.profile | int) 1) }}
resources:
{{ toYaml .Values.controller.resources | indent 10 }}
{{- end }}
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if gt (.Values.cluster.profile | int) 1 }}
{{- if .Values.controller.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
Expand Down Expand Up @@ -29,3 +30,4 @@ spec:
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if or (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) 1) (and .Values.controller.autoscaling.enabled (gt (.Values.controller.autoscaling.minReplicas | int) 1))) (gt (.Values.controller.replicaCount | int) 1) }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
Expand Down
6 changes: 5 additions & 1 deletion helm/nginx-ingress-controller-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ clusterID: uun5a
# provider is dynamic environment value, which comes from application catalog configuration
# applies only to Giant Swarm clusters
provider: kvm
# cluster.profile is a dynamic value, it comes from the cluster values configmap
# applies only to Giant Swarm clusters
cluster:
profile: 2
# ingressController is dynamic environment value, which comes from application catalog configuration
# applies only to Giant Swarm clusters
ingressController:
Expand Down Expand Up @@ -77,7 +81,7 @@ controller:
# optional hpa settings
autoscaling:
enabled: true
minReplicas: 1
minReplicas: 2
maxReplicas: 20
targetCPUUtilizationPercentage: 50
targetMemoryUtilizationPercentage: 50
Expand Down

0 comments on commit 70aadc7

Please sign in to comment.