From b02f76ba43897e6a270d9d6b2d3c014a4b9bf140 Mon Sep 17 00:00:00 2001 From: Krishnakumar R <29471693+kkmsft@users.noreply.github.com> Date: Thu, 5 Sep 2019 10:21:49 -0700 Subject: [PATCH] Add resource limits and requests (#372) * Add resource limits and requests * Add the limits and requests to no azure.json deployments --- deploy/infra/deployment-rbac.yaml | 14 ++++++++++++++ deploy/infra/deployment.yaml | 14 ++++++++++++++ deploy/infra/noazurejson/deployment-rbac.yaml | 14 ++++++++++++++ deploy/infra/noazurejson/deployment.yaml | 14 ++++++++++++++ deploy/infra/rc/deployment-rbac.yaml | 14 ++++++++++++++ deploy/infra/rc/deployment.yaml | 14 ++++++++++++++ test/e2e/template/deployment-rbac.yaml | 14 ++++++++++++++ 7 files changed, 98 insertions(+) diff --git a/deploy/infra/deployment-rbac.yaml b/deploy/infra/deployment-rbac.yaml index 5fe52a3a1..ab8c07707 100644 --- a/deploy/infra/deployment-rbac.yaml +++ b/deploy/infra/deployment-rbac.yaml @@ -132,6 +132,13 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi securityContext: privileged: true capabilities: @@ -218,6 +225,13 @@ spec: args: - "--cloudconfig=/etc/kubernetes/azure.json" - "--logtostderr" + resources: + limits: + cpu: 200m + memory: 1024Mi + requests: + cpu: 100m + memory: 256Mi volumeMounts: - name: k8s-azure-file mountPath: /etc/kubernetes/azure.json diff --git a/deploy/infra/deployment.yaml b/deploy/infra/deployment.yaml index bf1bf51d9..1c9079d5c 100644 --- a/deploy/infra/deployment.yaml +++ b/deploy/infra/deployment.yaml @@ -93,6 +93,13 @@ spec: capabilities: add: - NET_ADMIN + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi volumeMounts: - mountPath: /run/xtables.lock name: iptableslock @@ -127,6 +134,13 @@ spec: - "--kubeconfig=/etc/kubernetes/kubeconfig/kubeconfig" - "--cloudconfig=/etc/kubernetes/azure.json" - "--logtostderr" + resources: + limits: + cpu: 200m + memory: 1024Mi + requests: + cpu: 100m + memory: 256Mi volumeMounts: - name: kubeconfig mountPath: /etc/kubernetes/kubeconfig diff --git a/deploy/infra/noazurejson/deployment-rbac.yaml b/deploy/infra/noazurejson/deployment-rbac.yaml index f846e7738..ec8a8ddca 100644 --- a/deploy/infra/noazurejson/deployment-rbac.yaml +++ b/deploy/infra/noazurejson/deployment-rbac.yaml @@ -130,6 +130,13 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi securityContext: privileged: true capabilities: @@ -264,6 +271,13 @@ spec: secretKeyRef: key: ClientSecret name: aadpodidentity-admin-secret + resources: + limits: + cpu: 200m + memory: 1024Mi + requests: + cpu: 100m + memory: 256Mi livenessProbe: httpGet: path: /healthz diff --git a/deploy/infra/noazurejson/deployment.yaml b/deploy/infra/noazurejson/deployment.yaml index 34fca8df5..b031fee04 100644 --- a/deploy/infra/noazurejson/deployment.yaml +++ b/deploy/infra/noazurejson/deployment.yaml @@ -86,6 +86,13 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi securityContext: privileged: true capabilities: @@ -174,6 +181,13 @@ spec: secretKeyRef: key: ClientSecret name: aadpodidentity-admin-secret + resources: + limits: + cpu: 200m + memory: 1024Mi + requests: + cpu: 100m + memory: 256Mi volumeMounts: - name: kubeconfig mountPath: /etc/kubernetes/kubeconfig diff --git a/deploy/infra/rc/deployment-rbac.yaml b/deploy/infra/rc/deployment-rbac.yaml index 206060721..c40f39e2c 100644 --- a/deploy/infra/rc/deployment-rbac.yaml +++ b/deploy/infra/rc/deployment-rbac.yaml @@ -132,6 +132,13 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi securityContext: privileged: true capabilities: @@ -218,6 +225,13 @@ spec: args: - "--cloudconfig=/etc/kubernetes/azure.json" - "--logtostderr" + resources: + limits: + cpu: 200m + memory: 1024Mi + requests: + cpu: 100m + memory: 256Mi volumeMounts: - name: k8s-azure-file mountPath: /etc/kubernetes/azure.json diff --git a/deploy/infra/rc/deployment.yaml b/deploy/infra/rc/deployment.yaml index 522248bd3..8c66e14ab 100644 --- a/deploy/infra/rc/deployment.yaml +++ b/deploy/infra/rc/deployment.yaml @@ -88,6 +88,13 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi securityContext: privileged: true capabilities: @@ -127,6 +134,13 @@ spec: - "--kubeconfig=/etc/kubernetes/kubeconfig/kubeconfig" - "--cloudconfig=/etc/kubernetes/azure.json" - "--logtostderr" + resources: + limits: + cpu: 200m + memory: 1024Mi + requests: + cpu: 100m + memory: 256Mi volumeMounts: - name: kubeconfig mountPath: /etc/kubernetes/kubeconfig diff --git a/test/e2e/template/deployment-rbac.yaml b/test/e2e/template/deployment-rbac.yaml index 387aa6b98..7109b1339 100644 --- a/test/e2e/template/deployment-rbac.yaml +++ b/test/e2e/template/deployment-rbac.yaml @@ -125,6 +125,13 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi securityContext: privileged: true capabilities: @@ -208,6 +215,13 @@ spec: {{if .MICArg}}- mic {{ end }} - "--cloudconfig=/etc/kubernetes/azure.json" - "--logtostderr" + resources: + limits: + cpu: 200m + memory: 1024Mi + requests: + cpu: 100m + memory: 256Mi volumeMounts: - name: k8s-azure-file mountPath: /etc/kubernetes/azure.json