Skip to content

Commit

Permalink
Reintroduce prematurely dropped deprecated config properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevo Slavić committed Mar 11, 2020
1 parent b0d8bfa commit ee9fb52
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 10 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ 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

- Reintroduced config properties which should have been just deprecated but got dropped prematurely in v1.4.0 ([#35](https://github.com/giantswarm/nginx-ingress-controller-app/pull/35))
- `configmap.annotations-prefix`
- `configmap.default-ssl-certificate`
- `configmap.hpa-enabled`
- `configmap.hpa-max-replicas`
- `configmap.hpa-min-replicas`
- `configmap.hpa-target-cpu-utilization-percentage`
- `configmap.hpa-target-memory-utilization-percentage`
- `configmap.ingress-class`

## [v1.6.1] 2020-03-10

### Changed
Expand Down
24 changes: 16 additions & 8 deletions helm/nginx-ingress-controller-app/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,29 @@ Parameter | Description | Default
`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.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
`configmap.hpa-enabled` | This configuration property is deprecated and will be removed in the future, please migrate to `controller.autoscaling.enabled`. | not configured by default
`configmap.hpa-max-replicas` | This configuration property is deprecated and will be removed in the future, please migrate to `controller.autoscaling.maxReplicas`. | not configured by default
`configmap.hpa-min-replicas` | This configuration property is deprecated and will be removed in the future, please migrate to `controller.autoscaling.minReplicas`. | not configured by default
`configmap.hpa-target-cpu-utilization-percentage` | This configuration property is deprecated and will be removed in the future, please migrate to `controller.autoscaling.targetCPUUtilizationPercentage`. | not configured by default
`configmap.hpa-target-memory-utilization-percentage` | This configuration property is deprecated and will be removed in the future, please migrate to `controller.autoscaling.targetMemoryUtilizationPercentage`. | not configured by default
`configmap.ingress-class` | This configuration property is deprecated and will be removed in the future, please migrate to `controller.ingressClass`. | not configured by default
`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"
`configmap.server-name-hash-bucket-size` | Sets the size of the bucket for the server names hash tables. | "1024"
`configmap.server-tokens` | Controlls whether to send NGINX Server header in responses and display NGINX version in error pages. | "false"
`configmap.worker-processes` | Sets the number of worker processes. | "1"
`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. | `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`
`controller.defaultSSLCertificate` | The Secret referred to by this flag contains the default certificate to be used when accessing the catch-all server. If this flag is not provided NGINX will use a self-signed certificate. Example value: "default/foo-tls" | ""
`controller.annotationsPrefix` | Prefix of the Ingress annotations specific to the NGINX controller. This is a replacement for deprecated `configmap.annotations-prefix` configuration property; if both are configured, `configmap.annotations-prefix` has precedence. | `nginx.ingress.kubernetes.io`
`controller.autoscaling.enabled` | Enables or disables Horizontal Pod Autoscaler (HPA) for NGINX Ingress Controller Deployment. This is a replacement for deprecated `configmap.hpa-enabled` configuration property; if both are configured, `configmap.hpa-enabled` has precedence. | `true`
`controller.autoscaling.maxReplicas` | Configures HPA max replicas. This is a replacement for deprecated `configmap.hpa-max-replicas` configuration property; if both are configured, `configmap.hpa-max-replicas` has precedence. | `20`
`controller.autoscaling.minReplicas` | Configures HPA min replicas. This is a replacement for deprecated `configmap.hpa-min-replicas` configuration property; if both are configured, `configmap.hpa-min-replicas` has precedence. | `2`
`controller.autoscaling.targetCPUUtilizationPercentage` | Configures HPA target CPU utilization percentage. This is a replacement for deprecated `configmap.hpa-target-cpu-utilization-percentage` configuration property; if both are configured, `configmap.hpa-target-cpu-utilization-percentage` has precedence. | `50`
`controller.autoscaling.targetMemoryUtilizationPercentage` | Configures HPA target memory utilization percentage. This is a replacement for deprecated `configmap.hpa-target-memory-utilization-percentage` configuration property; if both are configured, `configmap.hpa-target-memory-utilization-percentage` has precedence. | `50`
`controller.defaultSSLCertificate` | The Secret referred to by this flag contains the default certificate to be used when accessing the catch-all server. If this flag is not provided NGINX will use a self-signed certificate. Example value: "default/foo-tls". This is a replacement for deprecated `configmap.default-ssl-certificate` configuration property; if both are configured, `configmap.default-ssl-certificate` has precedence. | ""
`controller.ingressController.legacy` | Legacy or node pools cluster. On aws provider node pool clusters LoadBalancer service gets created. Dynamically calculated during cluster creation. | `false`
`controller.ingressClass` | Ingress class, which controller processes | `nginx`
`controller.ingressClass` | Ingress class, which controller handles. This is a replacement for deprecated `configmap.ingress-class` configuration property; if both are configured, `configmap.ingress-class` has precedence. | `nginx`
`controller.metrics.enabled` | If true, create metrics Service for prometheus-operator support. | `false`
`controller.metrics.port` | Configures container metrics port to be exposed. | `10254`
`controller.metrics.service.servicePort` | Configures metrics Service port. | `9913`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,23 @@ spec:
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/{{ .Values.controller.configmap.name }}
{{- if index .Values.configmap "annotations-prefix" }}
- --annotations-prefix={{ index .Values.configmap "annotations-prefix" }}
{{- else if .Values.controller.annotationsPrefix }}
- --annotations-prefix={{ .Values.controller.annotationsPrefix }}
{{- if .Values.controller.defaultSSLCertificate }}
{{- end}}
{{- if index .Values.configmap "default-ssl-certificate" }}
- --default-ssl-certificate={{ index .Values.configmap "default-ssl-certificate" }}
{{- else if .Values.controller.defaultSSLCertificate }}
- --default-ssl-certificate={{ .Values.controller.defaultSSLCertificate }}
{{- end}}
- --enable-ssl-chain-completion=false
- --enable-dynamic-certificates=true
{{- if index .Values.configmap "ingress-class" }}
- --ingress-class={{ index .Values.configmap "ingress-class" }}
{{- else if .Values.controller.ingressClass }}
- --ingress-class={{ .Values.controller.ingressClass }}
{{- end}}
{{- if not .Values.ingressController.legacy }}
- --publish-service={{ .Release.Namespace }}/{{ .Values.controller.name }}
{{- end }}
Expand Down
29 changes: 28 additions & 1 deletion helm/nginx-ingress-controller-app/templates/controller-hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
{{- if gt (.Values.cluster.profile | int) 1 }}
{{- if .Values.controller.autoscaling.enabled }}
{{- if (index .Values.configmap "hpa-enabled") eq "true" }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.controller.name }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Values.controller.name }}
giantswarm.io/service-type: "managed"
k8s-app: {{ .Values.controller.k8sAppLabel }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.controller.name }}
minReplicas: {{ index .Values.configmap "hpa-min-replicas" }}
maxReplicas: {{ index .Values.configmap "hpa-max-replicas" }}
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ index .Values.configmap "hpa-target-cpu-utilization-percentage" }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ index .Values.configmap "hpa-target-memory-utilization-percentage" }}

{{- else if .Values.controller.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
Expand Down
4 changes: 4 additions & 0 deletions helm/nginx-ingress-controller-app/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ rules:
# Here: "<ingress-controller-leader>-<nginx>"
# This has to be adapted if you change either parameter
# when launching the nginx-ingress-controller.
{{- if index .Values.configmap "ingress-class" }}
- "ingress-controller-leader-{{ index .Values.configmap "ingress-class" }}
{{- else if .Values.controller.ingressClass }}
- "ingress-controller-leader-{{ .Values.controller.ingressClass }}"
{{- end}}
verbs:
- get
- update
Expand Down

0 comments on commit ee9fb52

Please sign in to comment.