[bitnami/nginx-ingress-controller] fix default backend status code (#6012)

* fix(nginx-ingress-controller): defaultBackend status code

* fix issues

* fix livenessProbe and readinessProbe

* Add new value entry to README.md

* Bump patch version

* Update bitnami/nginx-ingress-controller/Chart.yaml

Co-authored-by: Alejandro Moreno <alemorcuq@gmail.com>

* Use `common.tplvalues.render` instead of `toYaml`

* Fix description

Co-authored-by: Alejandro Moreno <amorenoc@vmware.com>
This commit is contained in:
Nuno Rodrigues
2021-04-12 16:10:10 +01:00
committed by GitHub
parent 4d46c37608
commit 647c5aea61
5 changed files with 49 additions and 3 deletions

View File

@@ -26,4 +26,4 @@ name: nginx-ingress-controller
sources:
- https://github.com/bitnami/bitnami-docker-nginx-ingress-controller
- https://github.com/kubernetes/ingress-nginx
version: 7.5.1
version: 7.6.0

View File

@@ -157,6 +157,7 @@ The following tables lists the configurable parameters of the Nginx Ingress Cont
| `defaultBackend.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `defaultBackend.extraArgs` | Additional command line arguments to pass to NGINX container | `{}` |
| `defaultBackend.containerPort` | HTTP container port number | `8080` |
| `defaultBackend.serverBlockConfig` | NGINX backend default server block configuration | Check `values.yaml` file |
| `defaultBackend.replicaCount` | Desired number of default backend pods | `1` |
| `defaultBackend.podSecurityContext` | Default backend pods' Security Context | Check `values.yaml` file |
| `defaultBackend.containerSecurityContext` | Default backend containers' Security Context | Check `values.yaml` file |

View File

@@ -0,0 +1,18 @@
{{- if and (.Values.defaultBackend.enabled) (.Values.defaultBackend.serverBlockConfig) -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nginx-ingress-controller.defaultBackend.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: default-backend
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
defaultBackend.conf: |-
{{- include "common.tplvalues.render" (dict "value" .Values.defaultBackend.serverBlockConfig "context" $) | nindent 4 }}
{{- end }}

View File

@@ -86,4 +86,19 @@ spec:
{{- if .Values.defaultBackend.resources }}
resources: {{- toYaml .Values.defaultBackend.resources | nindent 12 }}
{{- end }}
{{- if .Values.defaultBackend.serverBlockConfig }}
volumeMounts:
- name: nginx-config-volume
mountPath: /opt/bitnami/nginx/conf/bitnami/
readOnly: true
{{- end }}
{{- if .Values.defaultBackend.serverBlockConfig }}
volumes:
- name: nginx-config-volume
configMap:
name: {{ template "nginx-ingress-controller.defaultBackend.fullname" . }}
items:
- key: defaultBackend.conf
path: defaultBackend.conf
{{- end }}
{{- end }}

View File

@@ -558,6 +558,18 @@ defaultBackend:
extraArgs: {}
containerPort: 8080
## NGINX backend default server block configuration
## Should be compliant with: https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/
##
serverBlockConfig: |-
location /healthz {
return 200;
}
location / {
return 404;
}
## Number of replicas
##
replicaCount: 1
@@ -597,7 +609,7 @@ defaultBackend:
livenessProbe:
enabled: true
httpGet:
path: /
path: /healthz
port: http
scheme: HTTP
failureThreshold: 3
@@ -608,7 +620,7 @@ defaultBackend:
readinessProbe:
enabled: true
httpGet:
path: /
path: /healthz
port: http
scheme: HTTP
failureThreshold: 6