Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate resource requests and autoscaling for xxs, xs and s cluster profiles #38

Merged
merged 12 commits into from
Mar 16, 2020
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ 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

- 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
- 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.

## [v1.6.2] 2020-03-12

### Changed
Expand Down
2 changes: 1 addition & 1 deletion helm/nginx-ingress-controller-app/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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`
`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`
`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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,16 @@ spec:
path: /healthz
port: {{ .Values.controller.metrics.port }}
scheme: HTTP
{{- if (gt (.Values.cluster.profile | int) 1) }}
{{- if .Values.cluster.profile }}
{{- if gt (.Values.cluster.profile | int) 2 }}
resources:
{{- if eq (.Values.cluster.profile | quote) "3" }}
{{ toYaml .Values.controller.profile.small.resources | indent 10 }}
{{- else }}
{{ toYaml .Values.controller.resources | indent 10 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: /healthz
Expand Down
10 changes: 9 additions & 1 deletion helm/nginx-ingress-controller-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ provider: kvm
# cluster.profile is a dynamic value, it comes from the cluster values configmap
# applies only to Giant Swarm clusters
cluster:
profile: 2
profile: 4
# ingressController is dynamic environment value, which comes from application catalog configuration
# applies only to Giant Swarm clusters
ingressController:
Expand Down Expand Up @@ -74,9 +74,17 @@ controller:
servicePort: 9913

resources:
# these are default resource requests when cluster profile is not known/determined or when cluster is larger than small
requests:
cpu: 2
memory: 2.5Gi
profile:
# extra small (1) cluster profile - 1 worker node only - resource requests are not being set
#small (2) cluster profile - 2-3 worker nodes, max CPU < 4
sslavic marked this conversation as resolved.
Show resolved Hide resolved
small:
resources:
cpu: 500m
memory: 600Mi

# optional hpa settings
autoscaling:
Expand Down