forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RBAC and secret/env injection to helm chart
- Loading branch information
1 parent
abd63fb
commit aaabe41
Showing
10 changed files
with
186 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,9 @@ venv.bak/ | |
dmypy.json | ||
MANIFEST | ||
|
||
# IDEs | ||
.vscode/ | ||
|
||
# Added by mp-maker | ||
**/build | ||
/config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: extensions/v1beta1 | ||
kind: PodSecurityPolicy | ||
metadata: | ||
name: {{ include "datahub.fullname" . }} | ||
labels: | ||
{{- include "datahub.labels" . | nindent 4 }} | ||
spec: | ||
readOnlyRootFilesystem: false | ||
privileged: false | ||
allowPrivilegeEscalation: false | ||
runAsUser: | ||
rule: 'RunAsAny' | ||
supplementalGroups: | ||
rule: 'MustRunAs' | ||
ranges: | ||
- min: 1 | ||
max: 65535 | ||
fsGroup: | ||
rule: 'MustRunAs' | ||
ranges: | ||
- min: 1 | ||
max: 65535 | ||
seLinux: | ||
rule: 'RunAsAny' | ||
volumes: | ||
- configMap | ||
- downwardAPI | ||
- emptyDir | ||
- persistentVolumeClaim | ||
- secret | ||
- projected | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: datahub | ||
rules: | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- delete | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- pods/log | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- policy | ||
resourceNames: | ||
- {{ include "datahub.fullname" . }} | ||
resources: | ||
- podsecuritypolicies | ||
verbs: | ||
- use | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "datahub.fullname" . }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ include "datahub.fullname" . }} | ||
subjects: | ||
{{- /* Create a unique list (set) of all the subchart serviceAccountNames */ -}} | ||
{{- $serviceAccounts := list (include "datahub.serviceAccountName" .) (include "call-nested" (list . "datahub-frontend" "datahub-frontend.serviceAccountName")) (include "call-nested" (list . "datahub-gms" "datahub-gms.serviceAccountName")) (include "call-nested" (list . "datahub-mae-consumer" "datahub-mae-consumer.serviceAccountName")) (include "call-nested" (list . "datahub-mce-consumer" "datahub-mce-consumer.serviceAccountName")) | uniq -}} | ||
{{- $namespace := .Release.Namespace -}} | ||
{{- range $i, $accountName := $serviceAccounts }} | ||
- kind: ServiceAccount | ||
namespace: {{ $namespace }} | ||
name: {{ $accountName }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters