Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Commit 077d70e

Browse files
committed
fix(charts): Adding clusterroles for RBAC support
1 parent f338fc8 commit 077d70e

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{/*
2+
Set apiVersion based on Kubernetes version
3+
*/}}
4+
{{- define "rbacAPIVersion" -}}
5+
{{- if (lt (int (.Capabilities.KubeVersion.Minor)) 6) -}}
6+
rbac.authorization.k8s.io/v1alpha1
7+
{{- else if (and (ge (int (.Capabilities.KubeVersion.Minor)) 6) (le (int (.Capabilities.KubeVersion.Minor)) 7)) -}}
8+
rbac.authorization.k8s.io/v1beta1
9+
{{- else -}}
10+
rbac.authorization.k8s.io/v1
11+
{{- end -}}
12+
{{- end -}}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if (.Values.global.use_rbac) -}}
2+
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
3+
kind: ClusterRole
4+
apiVersion: {{ template "rbacAPIVersion" . }}
5+
metadata:
6+
name: deis:deis-workflow-manager
7+
labels:
8+
app: deis-workflow-manager
9+
heritage: deis
10+
rules:
11+
- apiGroups: ["extensions", "apps"]
12+
resources: ["deployments", "daemonsets"]
13+
verbs: ["get", "list"]
14+
- apiGroups: [""]
15+
resources: ["namespaces", "replicationcontrollers"]
16+
verbs: ["get", "list"]
17+
- apiGroups: [""]
18+
resources: ["secrets"]
19+
verbs: ["get", "list", "create", "delete", "update"]
20+
{{- end -}}
21+
{{- end -}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if (.Values.global.use_rbac) -}}
2+
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
3+
kind: ClusterRoleBinding
4+
apiVersion: {{ template "rbacAPIVersion" . }}
5+
metadata:
6+
name: deis:deis-workflow-manager
7+
labels:
8+
app: deis-workflow-manager
9+
heritage: deis
10+
roleRef:
11+
apiGroup: rbac.authorization.k8s.io
12+
kind: ClusterRole
13+
name: deis:deis-workflow-manager
14+
subjects:
15+
- kind: ServiceAccount
16+
name: deis-workflow-manager
17+
namespace: {{ .Release.Namespace }}
18+
{{- end -}}
19+
{{- end -}}

0 commit comments

Comments
 (0)