From 0a45e3c6553928bffd0cf9385afa69db6a7fcf66 Mon Sep 17 00:00:00 2001 From: Anton Wolkov <7001904+phntom@users.noreply.github.com> Date: Mon, 31 Aug 2020 22:46:43 +0300 Subject: [PATCH 1/3] Misc fixes for nginx-ingress chart for better keel and prometheus-operator integration --- charts/ingress-nginx/Chart.yaml | 2 +- .../templates/controller-daemonset.yaml | 1 + .../templates/controller-deployment.yaml | 1 + charts/ingress-nginx/values.yaml | 34 ++++++++++++++++--- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/charts/ingress-nginx/Chart.yaml b/charts/ingress-nginx/Chart.yaml index 5cb80fe285..dd7b55fed1 100644 --- a/charts/ingress-nginx/Chart.yaml +++ b/charts/ingress-nginx/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: ingress-nginx -version: 2.13.0 +version: 2.13.1 appVersion: 0.35.0 home: https://github.com/kubernetes/ingress-nginx description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer diff --git a/charts/ingress-nginx/templates/controller-daemonset.yaml b/charts/ingress-nginx/templates/controller-daemonset.yaml index 54e443c360..8765835dc5 100644 --- a/charts/ingress-nginx/templates/controller-daemonset.yaml +++ b/charts/ingress-nginx/templates/controller-daemonset.yaml @@ -6,6 +6,7 @@ metadata: labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: controller + {{- toYaml .Values.controller.labels | nindent 4 }} name: {{ include "ingress-nginx.controller.fullname" . }} {{- if .Values.controller.annotations }} annotations: {{ toYaml .Values.controller.annotations | nindent 4 }} diff --git a/charts/ingress-nginx/templates/controller-deployment.yaml b/charts/ingress-nginx/templates/controller-deployment.yaml index a18fc38c6a..c63d51fb95 100644 --- a/charts/ingress-nginx/templates/controller-deployment.yaml +++ b/charts/ingress-nginx/templates/controller-deployment.yaml @@ -6,6 +6,7 @@ metadata: labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: controller + {{- toYaml .Values.controller.labels | nindent 4 }} name: {{ include "ingress-nginx.controller.fullname" . }} {{- if .Values.controller.annotations }} annotations: {{ toYaml .Values.controller.annotations | nindent 4 }} diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index a82ca0698b..8452388d3f 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -135,6 +135,14 @@ controller: ## Annotations to be added to the controller Deployment or DaemonSet ## annotations: {} + # keel.sh/pollSchedule: "@every 60m" + + ## Labels to be added to the controller Deployment or DaemonSet + ## + labels: {} + # keel.sh/policy: patch + # keel.sh/trigger: poll + # The update strategy to apply to the Deployment or DaemonSet ## @@ -451,19 +459,35 @@ controller: # namespace: "" rules: [] # # These are just examples rules, please adapt them to your needs - # - alert: TooMany500s + # - alert: NGINXConfigFailed + # expr: count(nginx_ingress_controller_config_last_reload_successful == 0) > 0 + # for: 1s + # labels: + # severity: critical + # annotations: + # description: bad ingress config - nginx config test failed + # summary: uninstall the latest ingress changes to allow config reloads to resume + # - alert: NGINXCertificateExpiry + # expr: (avg(nginx_ingress_controller_ssl_expire_time_seconds) by (host) - time()) < 604800 + # for: 1s + # labels: + # severity: critical + # annotations: + # description: ssl certificate(s) will expire in less then a week + # summary: renew expiring certificates to avoid downtime + # - alert: NGINXTooMany500s # expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"5.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 # for: 1m # labels: - # severity: critical + # severity: warning # annotations: # description: Too many 5XXs # summary: More than 5% of the all requests did return 5XX, this require your attention - # - alert: TooMany400s + # - alert: NGINXTooMany400s # expr: 100 * ( sum( nginx_ingress_controller_requests{status=~"4.+"} ) / sum(nginx_ingress_controller_requests) ) > 5 # for: 1m # labels: - # severity: critical + # severity: warning # annotations: # description: Too many 4XXs # summary: More than 5% of the all requests did return 4XX, this require your attention @@ -472,7 +496,7 @@ controller: ## With this new hook, we increased the default terminationGracePeriodSeconds from 30 seconds ## to 300, allowing the draining of connections up to five minutes. ## If the active connections end before that, the pod will terminate gracefully at that time. - ## To efectively take advantage of this feature, the Configmap feature + ## To effectively take advantage of this feature, the Configmap feature ## worker-shutdown-timeout new value is 240s instead of 10s. ## lifecycle: From fcbc3659b805247685558b84a33ff98d51c2a13b Mon Sep 17 00:00:00 2001 From: Anton Wolkov <7001904+phntom@users.noreply.github.com> Date: Mon, 31 Aug 2020 23:14:44 +0300 Subject: [PATCH 2/3] Misc fixes for nginx-ingress chart for better keel and prometheus-operator integration Update: allow values.yaml without labels to pass --- charts/ingress-nginx/templates/controller-daemonset.yaml | 4 +++- charts/ingress-nginx/templates/controller-deployment.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/ingress-nginx/templates/controller-daemonset.yaml b/charts/ingress-nginx/templates/controller-daemonset.yaml index 8765835dc5..3eac1f8b0a 100644 --- a/charts/ingress-nginx/templates/controller-daemonset.yaml +++ b/charts/ingress-nginx/templates/controller-daemonset.yaml @@ -6,7 +6,9 @@ metadata: labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: controller - {{- toYaml .Values.controller.labels | nindent 4 }} + {{- with .Values.controller.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} name: {{ include "ingress-nginx.controller.fullname" . }} {{- if .Values.controller.annotations }} annotations: {{ toYaml .Values.controller.annotations | nindent 4 }} diff --git a/charts/ingress-nginx/templates/controller-deployment.yaml b/charts/ingress-nginx/templates/controller-deployment.yaml index c63d51fb95..cec2ab8f48 100644 --- a/charts/ingress-nginx/templates/controller-deployment.yaml +++ b/charts/ingress-nginx/templates/controller-deployment.yaml @@ -6,7 +6,9 @@ metadata: labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: controller - {{- toYaml .Values.controller.labels | nindent 4 }} + {{- with .Values.controller.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} name: {{ include "ingress-nginx.controller.fullname" . }} {{- if .Values.controller.annotations }} annotations: {{ toYaml .Values.controller.annotations | nindent 4 }} From ae77b6f5067fae1d2c15de51a740e7354286b12e Mon Sep 17 00:00:00 2001 From: Anton Wolkov <7001904+phntom@users.noreply.github.com> Date: Tue, 1 Sep 2020 17:36:48 +0300 Subject: [PATCH 3/3] bumping minor version due to new functionality (.Values.Controller.labels) --- charts/ingress-nginx/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ingress-nginx/Chart.yaml b/charts/ingress-nginx/Chart.yaml index dd7b55fed1..46a56e3dc4 100644 --- a/charts/ingress-nginx/Chart.yaml +++ b/charts/ingress-nginx/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: ingress-nginx -version: 2.13.1 +version: 2.14.0 appVersion: 0.35.0 home: https://github.com/kubernetes/ingress-nginx description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer