Skip to content

Commit 2e1a8a6

Browse files
committed
feature/add-quota
1 parent 24fa722 commit 2e1a8a6

6 files changed

Lines changed: 55 additions & 10 deletions

File tree

‎packages/apps/tenant/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ description: Separated tenant namespace
44
icon: /logos/tenant.svg
55

66
type: application
7-
version: 1.7.0
7+
version: 1.8.0

‎packages/apps/tenant/README.md‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ tenant-u1
5050

5151
### Common parameters
5252

53-
| Name | Description | Value |
54-
| ------------ | --------------------------------------------------------------------------------------------------------------------------- | ------- |
55-
| `host` | The hostname used to access tenant services (defaults to using the tenant name as a subdomain for it's parent tenant host). | `""` |
56-
| `etcd` | Deploy own Etcd cluster | `false` |
57-
| `monitoring` | Deploy own Monitoring Stack | `false` |
58-
| `ingress` | Deploy own Ingress Controller | `false` |
59-
| `seaweedfs` | Deploy own SeaweedFS | `false` |
60-
| `isolated` | Enforce tenant namespace with network policies | `false` |
53+
| Name | Description | Value |
54+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------- | ------- |
55+
| `host` | The hostname used to access tenant services (defaults to using the tenant name as a subdomain for it's parent tenant host). | `""` |
56+
| `etcd` | Deploy own Etcd cluster | `false` |
57+
| `monitoring` | Deploy own Monitoring Stack | `false` |
58+
| `ingress` | Deploy own Ingress Controller | `false` |
59+
| `seaweedfs` | Deploy own SeaweedFS | `false` |
60+
| `isolated` | Enforce tenant namespace with network policies | `false` |
61+
| `resourceQuotas` | Define resource quotas for the tenant | `{}` |
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- if .Values.resourceQuotas }}
2+
apiVersion: v1
3+
kind: ResourceQuota
4+
metadata:
5+
name: tenant-quota
6+
namespace: {{ include "tenant.name" . }}
7+
spec:
8+
hard:
9+
{{- if .Values.resourceQuotas.hard}}
10+
{{- if .Values.resourceQuotas.hard.resources.requests }}
11+
{{- if .Values.resourceQuotas.hard.resources.requests.cpu }}
12+
requests.cpu: {{ .Values.resourceQuotas.hard.resources.requests.cpu }}
13+
{{- end }}
14+
{{- if .Values.resourceQuotas.hard.resources.requests.memory }}
15+
requests.memory: {{ .Values.resourceQuotas.hard.resources.requests.memory }}
16+
{{- end }}
17+
{{- end }}
18+
{{- if .Values.resourceQuotas.hard.resources.limits }}
19+
{{- if and .Values.resourceQuotas.hard.resources.limits.cpu }}
20+
limits.cpu: {{ .Values.resourceQuotas.hard.resources.limits.cpu }}
21+
{{- end }}
22+
{{- if .Values.resourceQuotas.hard.resources.limits.memory }}
23+
limits.memory: {{ .Values.resourceQuotas.hard.resources.limits.memory }}
24+
{{- end }}
25+
{{- end }}
26+
{{- end }}
27+
{{- end }}

‎packages/apps/tenant/values.schema.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
"type": "boolean",
3232
"description": "Enforce tenant namespace with network policies",
3333
"default": false
34+
},
35+
"resourceQuotas": {
36+
"type": "object",
37+
"description": "Define resource quotas for the tenant",
38+
"default": {}
3439
}
3540
}
3641
}

‎packages/apps/tenant/values.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,20 @@
66
## @param ingress Deploy own Ingress Controller
77
## @param seaweedfs Deploy own SeaweedFS
88
## @param isolated Enforce tenant namespace with network policies
9+
## @param resourceQuotas Define resource quotas for the tenant
910
host: ""
1011
etcd: false
1112
monitoring: false
1213
ingress: false
1314
seaweedfs: false
1415
isolated: false
16+
resourceQuotas: {}
17+
# resourceQuotas:
18+
# hard:
19+
# resources:
20+
# limits:
21+
# cpu: "2"
22+
# memory: "2Gi"
23+
# requests:
24+
# cpu: "1"
25+
# memory: "1Gi"

‎packages/apps/versions_map‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ tenant 1.6.5 f1e11451
103103
tenant 1.6.6 d4634797
104104
tenant 1.6.7 06afcf27
105105
tenant 1.6.8 4cc48e6f
106-
tenant 1.7.0 HEAD
106+
tenant 1.7.0 6c73e3f3
107+
tenant 1.8.0 HEAD
107108
virtual-machine 0.1.4 f2015d6
108109
virtual-machine 0.1.5 7cd7de7
109110
virtual-machine 0.2.0 5ca8823

0 commit comments

Comments
 (0)