From ec6ef50b896cb88541b62bf93be1ee301b1c24a4 Mon Sep 17 00:00:00 2001 From: Guilherme Oki Date: Wed, 24 Jul 2019 18:50:21 -0300 Subject: [PATCH] Add support to set resources for controller pods --- deployments/helm-chart/README.md | 1 + .../helm-chart/templates/controller-daemonset.yaml | 2 ++ .../helm-chart/templates/controller-deployment.yaml | 2 ++ deployments/helm-chart/values.yaml | 9 +++++++++ 4 files changed, 14 insertions(+) diff --git a/deployments/helm-chart/README.md b/deployments/helm-chart/README.md index 5bc6d39012..c36edf7eb2 100644 --- a/deployments/helm-chart/README.md +++ b/deployments/helm-chart/README.md @@ -79,6 +79,7 @@ Parameter | Description | Default `controller.terminationGracePeriodSeconds` | The termination grace period of the Ingress controller pod. | 30 `controller.tolerations` | The tolerations of the Ingress controller pods. | [] `controller.affinity` | The affinity of the Ingress controller pods. | {} +`controller.resources` | The resources of the Ingress controller pods. | {} `controller.replicaCount` | The number of replicas of the Ingress controller deployment. | 1 `controller.ingressClass` | A class of the Ingress controller. The Ingress controller only processes Ingress resources that belong to its class - i.e. have the annotation `"kubernetes.io/ingress.class"` equal to the class. Additionally, the Ingress controller processes Ingress resources that do not have that annotation which can be disabled by setting the "-use-ingress-class-only" flag. | nginx `controller.useIngressClassOnly` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. | false diff --git a/deployments/helm-chart/templates/controller-daemonset.yaml b/deployments/helm-chart/templates/controller-daemonset.yaml index 2b6be3bdf3..afdc2e2e8e 100644 --- a/deployments/helm-chart/templates/controller-daemonset.yaml +++ b/deployments/helm-chart/templates/controller-daemonset.yaml @@ -67,6 +67,8 @@ spec: valueFrom: fieldRef: fieldPath: metadata.name + resources: +{{ toYaml .Values.controller.resources | indent 10 }} args: - -nginx-plus={{ .Values.controller.nginxplus }} - -nginx-configmaps=$(POD_NAMESPACE)/{{ include "nginx-ingress.configName" . }} diff --git a/deployments/helm-chart/templates/controller-deployment.yaml b/deployments/helm-chart/templates/controller-deployment.yaml index 45cf0d607e..892b3cbb4a 100644 --- a/deployments/helm-chart/templates/controller-deployment.yaml +++ b/deployments/helm-chart/templates/controller-deployment.yaml @@ -56,6 +56,8 @@ spec: - name: prometheus containerPort: {{ .Values.prometheus.port }} {{- end }} + resources: +{{ toYaml .Values.controller.resources | indent 10 }} env: - name: POD_NAMESPACE valueFrom: diff --git a/deployments/helm-chart/values.yaml b/deployments/helm-chart/values.yaml index d04953074e..20e8c645e2 100644 --- a/deployments/helm-chart/values.yaml +++ b/deployments/helm-chart/values.yaml @@ -74,6 +74,15 @@ controller: ## The termination grace period of the Ingress controller pod. terminationGracePeriodSeconds: 30 + ## The resources of the Ingress controller pods. + resources: {} + # limits: + # cpu: 100m + # memory: 64Mi + # requests: + # cpu: 100m + # memory: 64Mi + ## The tolerations of the Ingress controller pods. tolerations: []