Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added role_quotas #159

Merged
merged 7 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions charts/ocis/docs/values-desc-table.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,30 @@ a| [subs=-attributes]
a| [subs=-attributes]
`"userid"`
| Attribute mapping of for the userIDClaim. Set to `userid` if the claim specified in `...oidc.userIDClaim` holds the value of the ldap user attribute specified in `...ldap.user.schema.id`. Set to `mail` if the claim specified in `...oidc.userIDClaim` holds the value of the ldap user attribute specified in `...ldap.user.schema.mail`. Set to `username` if the claim specified in `...oidc.userIDClaim` holds the value of the ldap user attribute specified in `...ldap.user.schema.userName`.
| features.quotas
a| [subs=-attributes]
+object+
a| [subs=-attributes]
`{"default":null,"max":null,"roles":{}}`
| Define quota settings.
| features.quotas.default
a| [subs=-attributes]
+string+
a| [subs=-attributes]
`nil`
| Sets the default quota for spaces
| features.quotas.max
a| [subs=-attributes]
+string+
a| [subs=-attributes]
`nil`
| Sets the maximum quota for spaces
| features.quotas.roles
a| [subs=-attributes]
+object+
a| [subs=-attributes]
`{}`
| Sets specific quotas for roles
| image.pullPolicy
a| [subs=-attributes]
+string+
Expand Down
9 changes: 9 additions & 0 deletions charts/ocis/docs/values.adoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,15 @@ services:
proxy:
# -- Per-service resources configuration. Overrides the default setting from `resources` if set.
resources: {}
# -- Define role_quotas.
role_quotas: {}
# role_quotas:
# # Role 1 2GB
# d7beeea8-8ff4-406b-8fb6-ab2dd81e6b11: 2000000000
# # Role 2 100GB
# 71881883-1768-46bd-a24d-a356a2afdf7f: 100000000000
# # Role 3 100GB
# 2aadd357-682c-406b-8874-293091995fdd: 100000000000

# -- SEARCH service.
# @default -- see detailed service configuration options below
Expand Down
5 changes: 5 additions & 0 deletions charts/ocis/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ spec:
name: {{ .Values.secretRefs.transferSecretSecretRef }}
key: transfer-secret

{{- if .Values.features.quotas.max }}
- name: FRONTEND_MAX_QUOTA
value: {{ .Values.features.quotas.max }}
{{- end }}

livenessProbe:
httpGet:
path: /healthz
Expand Down
5 changes: 5 additions & 0 deletions charts/ocis/templates/graph/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ spec:
name: {{ .Values.secretRefs.jwtSecretRef }}
key: jwt-secret

{{- if .Values.features.quotas.default }}
- name: GRAPH_SPACES_DEFAULT_QUOTA
value: {{ .Values.features.quotas.default }}
{{- end }}

livenessProbe:
httpGet:
path: /healthz
Expand Down
4 changes: 4 additions & 0 deletions charts/ocis/templates/proxy/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ data:
policy_selector:
static:
policy: ocis
{{- with $.Values.features.quotas.roles }}
role_quotas:
{{- toYaml . | nindent 8 }}
{{- end }}
policies:
- name: ocis
routes:
Expand Down
5 changes: 5 additions & 0 deletions charts/ocis/templates/storage-users/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ spec:
secretKeyRef:
name: {{ .Values.secretRefs.transferSecretSecretRef }}
key: transfer-secret

{{- if .Values.features.quotas.max }}
- name: STORAGE_USERS_OCIS_MAX_QUOTA
value: {{ .Values.features.quotas.max }}
{{- end }}

livenessProbe:
httpGet:
Expand Down
15 changes: 15 additions & 0 deletions charts/ocis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,21 @@ features:
filter:
# -- The object class to use for groups in the default group search filter like `groupOfNames`.
objectClass: groupOfNames
# -- Define quota settings.
quotas:
# -- Sets the maximum quota for spaces
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have an example and possible units if applicable (GB, GiB, ..)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in latest commit. Would also be great if we could add a deep link to the existing Dokumentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stable / deep links are not possible yet (as far as I know)

max:
# -- Sets the default quota for spaces
default:
# -- Sets specific quotas for roles
roles: {}
# roles:
# # User Role set to 2GB
d7oc marked this conversation as resolved.
Show resolved Hide resolved
# d7beeea8-8ff4-406b-8fb6-ab2dd81e6b11: 2000000000
# # Administrator Role set to 100GB
# 71881883-1768-46bd-a24d-a356a2afdf7f: 100000000000
# # Space Administrator Role set to 100GB
# 2aadd357-682c-406b-8874-293091995fdd: 100000000000

# Ingress for oCIS.
ingress:
Expand Down