Resource Quotas, global setting and per namespace
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{{- range .Values.namespaces }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: LimitRange
|
||||
metadata:
|
||||
name: resource-limits
|
||||
spec:
|
||||
limits:
|
||||
- type: Container
|
||||
max:
|
||||
cpu: "4"
|
||||
memory: "8Gi"
|
||||
min:
|
||||
cpu: "100m"
|
||||
memory: "50Mi"
|
||||
default:
|
||||
cpu: "300m"
|
||||
memory: "200Mi"
|
||||
defaultRequest:
|
||||
cpu: "200m"
|
||||
memory: "200Mi"
|
||||
maxLimitRequestRatio:
|
||||
cpu: "10"
|
||||
memory: "1"
|
||||
{{- end }}
|
||||
@@ -4,4 +4,8 @@ apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .name }}
|
||||
annotations:
|
||||
{{- if .annotations }}
|
||||
{{- toYaml .annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{{- range .Values.namespaces }}
|
||||
{{- $budget := $.Values.budget }}
|
||||
{{- if .budget }}
|
||||
{{- $budget = .budget }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: {{ .name }}
|
||||
spec:
|
||||
hard:
|
||||
limits.cpu: {{ $budget.cpu | mul $.Values.overcommit.cpu }}
|
||||
limits.memory: {{ $budget.memory | regexFind "[1-9]+" | mul $.Values.overcommit.memory }}{{ $budget.memory | regexFind "[a-zA-Z]+" }}
|
||||
requests.cpu: {{ $budget.cpu }}
|
||||
requests.memory: {{ $budget.memory }}
|
||||
requests.storage: {{ $budget.storage }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,15 @@
|
||||
suite: test deployment
|
||||
templates:
|
||||
- namespace.yaml
|
||||
tests:
|
||||
- it: Should place annotations
|
||||
set:
|
||||
namespaces:
|
||||
- name: staging
|
||||
annotations:
|
||||
linkerd.io/inject: enabled
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
linkerd.io/inject: enabled
|
||||
@@ -0,0 +1,46 @@
|
||||
suite: test deployment
|
||||
templates:
|
||||
- resource-quota.yaml
|
||||
tests:
|
||||
- it: Should set default quota values
|
||||
set:
|
||||
budget:
|
||||
cpu: 32
|
||||
memory: "64Gi"
|
||||
storage: "500Gi"
|
||||
overcommit:
|
||||
cpu: 2
|
||||
memory: 1
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.hard
|
||||
value:
|
||||
limits.cpu: 64
|
||||
limits.memory: "64Gi"
|
||||
requests.cpu: 32
|
||||
requests.memory: "64Gi"
|
||||
requests.storage: "500Gi"
|
||||
- it: Should set namespace specific quotas
|
||||
set:
|
||||
namespaces:
|
||||
- name: staging
|
||||
budget:
|
||||
cpu: 8
|
||||
memory: "16Gi"
|
||||
storage: "100Gi"
|
||||
budget:
|
||||
cpu: 32
|
||||
memory: "64Gi"
|
||||
storage: "500Gi"
|
||||
overcommit:
|
||||
cpu: 2
|
||||
memory: 1
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.hard
|
||||
value:
|
||||
limits.cpu: 16
|
||||
limits.memory: "16Gi"
|
||||
requests.cpu: 8
|
||||
requests.memory: "16Gi"
|
||||
requests.storage: "100Gi"
|
||||
@@ -1,2 +1,15 @@
|
||||
namespaces:
|
||||
- name: staging
|
||||
|
||||
budget:
|
||||
cpu: 32
|
||||
memory: "64Gi"
|
||||
storage: "500Gi"
|
||||
|
||||
overcommit:
|
||||
cpu: 2
|
||||
memory: 1
|
||||
|
||||
podOvercommit:
|
||||
cpu: 10
|
||||
memory: 2
|
||||
|
||||
Binary file not shown.
+22
-22
@@ -2,17 +2,17 @@ apiVersion: v1
|
||||
entries:
|
||||
cron-job:
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.790295161+01:00"
|
||||
created: "2020-11-03T11:55:21.304402199+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: 28735c68d458a840610d1550c703bb3044cae8dcc70c0cb7bf09c3a9cd33d44d
|
||||
digest: dc733bf1d136a6db248cdfafefe75fe2e7caabddd6230c1940f005868b732a01
|
||||
name: cron-job
|
||||
type: application
|
||||
urls:
|
||||
- https://chart.onechart.dev/cron-job-0.1.2.tgz
|
||||
version: 0.1.2
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.789951721+01:00"
|
||||
created: "2020-11-03T11:55:21.304138101+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: afab9ba533a4686827b54b0dad64f5bbf76f7fbc075e35fb1034689db9ab9dda
|
||||
@@ -22,7 +22,7 @@ entries:
|
||||
- https://chart.onechart.dev/cron-job-0.1.1.tgz
|
||||
version: 0.1.1
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.78967665+01:00"
|
||||
created: "2020-11-03T11:55:21.303740199+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: 01f9fa40c1c4085d7688474ab00c9e9d21bd1d0793db6b75f2edda0e18456282
|
||||
@@ -33,9 +33,9 @@ entries:
|
||||
version: 0.1.0
|
||||
namespaces:
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.790485508+01:00"
|
||||
created: "2020-11-03T11:55:21.304875434+01:00"
|
||||
description: Chart to create namespaces and their defaults
|
||||
digest: 4fde09fb3fb0d5d7575c25c3e33b0b7c12e6836166a9b421f7f096789f6938de
|
||||
digest: 88b06d78a9d1bda6f2ee15b1fad7f25399ac25c2320fb9a8dfa1a4fd14afdf6e
|
||||
name: namespaces
|
||||
type: application
|
||||
urls:
|
||||
@@ -43,17 +43,17 @@ entries:
|
||||
version: 0.1.0
|
||||
onechart:
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.795821549+01:00"
|
||||
created: "2020-11-03T11:55:21.310524127+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: db8354b30748f8785ba45afcac15b4e69d2adda69168e2b37d33f221a8636b09
|
||||
digest: 4b997a4af439f7999a5490fd54aa4ec8b45e2e84bc92ce6741d99a406367a254
|
||||
name: onechart
|
||||
type: application
|
||||
urls:
|
||||
- https://chart.onechart.dev/onechart-0.7.1.tgz
|
||||
version: 0.7.1
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.795248796+01:00"
|
||||
created: "2020-11-03T11:55:21.310142507+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: 4bf90835f287917671ec40b5b395da9332cf18e70f248d250f8d5a72360dcb4e
|
||||
@@ -63,7 +63,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.7.0.tgz
|
||||
version: 0.7.0
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.794775255+01:00"
|
||||
created: "2020-11-03T11:55:21.309709577+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: 0cade489fc74a040f5e7f71d01c6fa00d3f68b4752a4d8234ccf2c1504b4c0a1
|
||||
@@ -73,7 +73,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.6.1.tgz
|
||||
version: 0.6.1
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.79439208+01:00"
|
||||
created: "2020-11-03T11:55:21.309343229+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: d607820a7e104eaaa88c153c1f2f7f409ef4c612ad747caeb3a671cf3fce03d4
|
||||
@@ -83,7 +83,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.6.0.tgz
|
||||
version: 0.6.0
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.794113702+01:00"
|
||||
created: "2020-11-03T11:55:21.308980383+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: ddf7cf87402095d62855898744b805115fdf86c4b295e0a4def0c50408fd9138
|
||||
@@ -93,7 +93,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.5.1.tgz
|
||||
version: 0.5.1
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.793836394+01:00"
|
||||
created: "2020-11-03T11:55:21.308615988+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: adf3c2cf3a27e58ec75620599e0e1c2031a7410a061a590317beeff6d8a9ad69
|
||||
@@ -103,7 +103,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.5.0.tgz
|
||||
version: 0.5.0
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.793578335+01:00"
|
||||
created: "2020-11-03T11:55:21.308260874+01:00"
|
||||
description: One chart to rule them all. A generic Helm chart for your application
|
||||
deployments. Because no-one can remember the Kubernetes yaml syntax.
|
||||
digest: 8dab33263c4e632aeb4656c666871440b589497b70e76a1d6c3a5e3db1a30bba
|
||||
@@ -113,7 +113,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.4.0.tgz
|
||||
version: 0.4.0
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.793253157+01:00"
|
||||
created: "2020-11-03T11:55:21.307836329+01:00"
|
||||
description: A generic Helm chart for your application deployments
|
||||
digest: fbaf6139e0ef8ad9a87cc1e41a97c7d25fdcf7ea17fa6364952f1a851a87480a
|
||||
name: onechart
|
||||
@@ -122,7 +122,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.3.2.tgz
|
||||
version: 0.3.2
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.792896988+01:00"
|
||||
created: "2020-11-03T11:55:21.307507987+01:00"
|
||||
description: A generic Helm chart for your application deployments
|
||||
digest: bd6f5b1865ab9b05fc6925c163ab8045235bd2723dba31f09d5083d24322d1f8
|
||||
name: onechart
|
||||
@@ -131,7 +131,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.3.1.tgz
|
||||
version: 0.3.1
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.792305454+01:00"
|
||||
created: "2020-11-03T11:55:21.307183326+01:00"
|
||||
description: A generic Helm chart for your application deployments
|
||||
digest: c79cef21eceab948144a289298cdf1e20e77a0782a883d7d65f9e709ccbbc271
|
||||
name: onechart
|
||||
@@ -140,7 +140,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.3.0.tgz
|
||||
version: 0.3.0
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.791566888+01:00"
|
||||
created: "2020-11-03T11:55:21.306851679+01:00"
|
||||
description: A generic Helm chart for your application deployments
|
||||
digest: dd814ac5d08d5e6163a1b769df6803f5cb0f09d906045086dfcc5be522bb1ec3
|
||||
name: onechart
|
||||
@@ -149,7 +149,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.2.0.tgz
|
||||
version: 0.2.0
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.791295368+01:00"
|
||||
created: "2020-11-03T11:55:21.306484052+01:00"
|
||||
description: A generic Helm chart for your application deployments
|
||||
digest: e46062df8053840cbfbba26c0a66a843a79f15a0b43a145ed019327513bd5098
|
||||
name: onechart
|
||||
@@ -158,7 +158,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.1.2.tgz
|
||||
version: 0.1.2
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.791047332+01:00"
|
||||
created: "2020-11-03T11:55:21.306088852+01:00"
|
||||
description: A generic Helm chart for your application deployments
|
||||
digest: a7bbc8b7dcc008e89156cd1830282b7d39c0592e82ccdcefb77a25a42eca2a3d
|
||||
name: onechart
|
||||
@@ -167,7 +167,7 @@ entries:
|
||||
- https://chart.onechart.dev/onechart-0.1.1.tgz
|
||||
version: 0.1.1
|
||||
- apiVersion: v2
|
||||
created: "2020-11-02T15:58:33.790768469+01:00"
|
||||
created: "2020-11-03T11:55:21.305769568+01:00"
|
||||
description: A generic Helm chart for your application deployments
|
||||
digest: 1ed8c0645abdae6c950526e9c5410dc056847a11700dc7def5f1c55eb7de0cd4
|
||||
name: onechart
|
||||
@@ -175,4 +175,4 @@ entries:
|
||||
urls:
|
||||
- https://chart.onechart.dev/onechart-0.1.0.tgz
|
||||
version: 0.1.0
|
||||
generated: "2020-11-02T15:58:33.789308321+01:00"
|
||||
generated: "2020-11-03T11:55:21.303195966+01:00"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
namespaces:
|
||||
- name: staging
|
||||
annotations:
|
||||
linkerd.io/inject: enabled
|
||||
budget:
|
||||
cpu: 8
|
||||
memory: "16Gi"
|
||||
storage: "100Gi"
|
||||
Reference in New Issue
Block a user