From af29cb29625cd8540872ef0f8bcd0e4a60817716 Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Wed, 22 Sep 2021 13:05:56 +0200 Subject: [PATCH] Introduce ephemeral-storage quotas. Set limits to values in KB article --- class/defaults.yml | 16 ++++++++++++++-- .../11_generate_quota_limit_range_in_ns.yaml | 9 ++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/class/defaults.yml b/class/defaults.yml index bdad48ae..7ef8ffc3 100644 --- a/class/defaults.yml +++ b/class/defaults.yml @@ -43,13 +43,18 @@ parameters: requests.memory: 3Gi limits.cpu: 4000m limits.memory: 6Gi - requests.storage: 50Gi - persistentvolumeclaims: "50" count/configmaps: "150" count/secrets: "150" count/services: "20" openshift.io/imagestreams: "20" openshift.io/imagestreamtags: "50" + + requests.storage: 50Gi + persistentvolumeclaims: "10" + localblock-storage.storageclass.storage.k8s.io/persistentvolumeclaims: "0" + requests.ephemeral-storage: "250Mi" + limits.ephemeral-storage: "500Mi" + scopes: [] scopeSelector: @@ -61,12 +66,19 @@ parameters: max: cpu: "1" memory: "4G" + # limits.ephemeral-storage + ephemeral-storage: "500Mi" min: cpu: "10m" memory: "4Mi" + ephemeral-storage: "100Ki" default: cpu: "200m" memory: "200Mi" + # 500Mi (limits.ephemeral-storage) / 45 (count/pods) = ~10Mi + ephemeral-storage: "10Mi" defaultRequest: cpu: "100m" memory: "100Mi" + # 250Mi (requests.ephemeral-storage) / 45 (count/pods) = ~5Mi + ephemeral-storage: "5Mi" diff --git a/tests/golden/defaults/appuio-cloud/appuio-cloud/11_generate_quota_limit_range_in_ns.yaml b/tests/golden/defaults/appuio-cloud/appuio-cloud/11_generate_quota_limit_range_in_ns.yaml index 32772875..e7461070 100644 --- a/tests/golden/defaults/appuio-cloud/appuio-cloud/11_generate_quota_limit_range_in_ns.yaml +++ b/tests/golden/defaults/appuio-cloud/appuio-cloud/11_generate_quota_limit_range_in_ns.yaml @@ -16,15 +16,19 @@ spec: limits: - default: cpu: 200m + ephemeral-storage: 10Mi memory: 200Mi defaultRequest: cpu: 100m + ephemeral-storage: 5Mi memory: 100Mi max: cpu: '1' + ephemeral-storage: 500Mi memory: 4G min: cpu: 10m + ephemeral-storage: 100Ki memory: 4Mi type: Container kind: LimitRange @@ -49,11 +53,14 @@ spec: count/secrets: '150' count/services: '20' limits.cpu: 4000m + limits.ephemeral-storage: 500Mi limits.memory: 6Gi + localblock-storage.storageclass.storage.k8s.io/persistentvolumeclaims: '0' openshift.io/imagestreams: '20' openshift.io/imagestreamtags: '50' - persistentvolumeclaims: '50' + persistentvolumeclaims: '10' requests.cpu: 2000m + requests.ephemeral-storage: 250Mi requests.memory: 3Gi requests.storage: 50Gi scopeSelector: null