-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from Bregor/features/rbac
RBAC support
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
charts/monitor/charts/telegraf/templates/monitor-telegraf-role.yaml
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,15 @@ | ||
{{- if (.Values.global.use_rbac) -}} | ||
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}} | ||
kind: Role | ||
apiVersion: {{ template "rbacAPIVersion" . }} | ||
metadata: | ||
name: deis-monitor-telegraf | ||
labels: | ||
app: deis-monitor-telegraf | ||
heritage: deis | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["get"] | ||
{{- end -}} | ||
{{- end -}} |
18 changes: 18 additions & 0 deletions
18
charts/monitor/charts/telegraf/templates/monitor-telegraf-rolebinding.yaml
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,18 @@ | ||
{{- if (.Values.global.use_rbac) -}} | ||
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}} | ||
kind: RoleBinding | ||
apiVersion: {{ template "rbacAPIVersion" . }} | ||
metadata: | ||
name: deis-monitor-telegraf | ||
labels: | ||
app: deis-monitor-telegraf | ||
heritage: deis | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: deis-monitor-telegraf | ||
subjects: | ||
- kind: ServiceAccount | ||
name: deis-monitor-telegraf | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{/* | ||
Set apiVersion based on Kubernetes version | ||
*/}} | ||
{{- define "rbacAPIVersion" -}} | ||
{{- if ge .Capabilities.KubeVersion.Minor "6" -}} | ||
rbac.authorization.k8s.io/v1beta1 | ||
{{- else -}} | ||
rbac.authorization.k8s.io/v1alpha1 | ||
{{- 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