Skip to content

Commit

Permalink
Merge pull request #105 from Xartos/priviledged-role
Browse files Browse the repository at this point in the history
Added possibility to use priviledged PSP
  • Loading branch information
tvories authored May 10, 2021
2 parents 89506d7 + a7f9605 commit dd44084
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 2.6.1
version: 2.6.2
appVersion: 19.0.3
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
3 changes: 3 additions & 0 deletions charts/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ The following table lists the configurable parameters of the nextcloud chart and
| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` |
| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` |
| `resources` | CPU/Memory resource requests/limits | `{}` |
| `rbac.enabled` | Enable Role and rolebinding for priveledged PSP | `false` |
| `rbac.serviceaccount.create` | Wether to create a serviceaccount or use an existing one (requires rbac) | `true` |
| `rbac.serviceaccount.name` | The name of the sevice account that the deployment will use (requires rbac) | `nextcloud-serviceaccount` |
| `livenessProbe.enabled` | Turn on and off liveness probe | `true` |
| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `10` |
| `livenessProbe.periodSeconds` | How often to perform the probe | `10` |
Expand Down
3 changes: 3 additions & 0 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,6 @@ spec:
securityContext:
fsGroup: 33
{{- end }}
{{- if .Values.rbac.enabled }}
serviceAccountName: {{ .Values.rbac.serviceaccount.name }}
{{- end }}
30 changes: 30 additions & 0 deletions charts/nextcloud/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- if .Values.rbac.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "nextcloud.fullname" . }}-privileged
namespace: {{ .Release.namespace }}
rules:
- apiGroups:
- extensions
resourceNames:
- privileged
resources:
- podsecuritypolicies
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "nextcloud.fullname" . }}-privileged
namespace: {{ .Release.namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "nextcloud.fullname" . }}-privileged
subjects:
- kind: ServiceAccount
name: {{ .Values.rbac.serviceaccount.name }}
namespace: {{ .Release.namespace }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/nextcloud/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- if and .Values.rbac.enabled .Values.rbac.serviceaccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.rbac.serviceaccount.name }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,9 @@ metrics:
prometheus.io/scrape: "true"
prometheus.io/port: "9205"
labels: {}

rbac:
enabled: false
serviceaccount:
create: true
name: nextcloud-serviceaccount

0 comments on commit dd44084

Please sign in to comment.