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

Commit 2229d0c

Browse files
authored
Merge pull request #96 from Bregor/features/rbac
RBAC support
2 parents 5b58337 + acdb852 commit 2229d0c

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{/*
2+
Set apiVersion based on Kubernetes version
3+
*/}}
4+
{{- define "rbacAPIVersion" -}}
5+
{{- if ge .Capabilities.KubeVersion.Minor "6" -}}
6+
rbac.authorization.k8s.io/v1beta1
7+
{{- else -}}
8+
rbac.authorization.k8s.io/v1alpha1
9+
{{- end -}}
10+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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-logger-fluentd
7+
labels:
8+
app: deis-logger-fluentd
9+
heritage: deis
10+
rules:
11+
- apiGroups: [""]
12+
resources: ["pods"]
13+
verbs: ["list", "get", "watch"]
14+
{{- end -}}
15+
{{- end -}}
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-logger-fluentd
7+
labels:
8+
app: deis-logger-fluentd
9+
heritage: deis
10+
roleRef:
11+
apiGroup: rbac.authorization.k8s.io
12+
kind: ClusterRole
13+
name: deis:deis-logger-fluentd
14+
subjects:
15+
- kind: ServiceAccount
16+
name: deis-logger-fluentd
17+
namespace: {{ .Release.Namespace }}
18+
{{- end -}}
19+
{{- end -}}

charts/fluentd/values.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ sources:
2020

2121
output:
2222
disable_deis: false
23-
23+
2424
boot:
2525
install_build_tools: false
2626

2727
# Any custom fluentd environment variables (https://github.com/deis/fluentd#configuration)
2828
# can be specified as key-value pairs under daemon_environment.
2929
daemon_environment:
3030
#<example-env>: <example-value>
31+
32+
# Role-Based Access Control for Kubernetes >= 1.5
33+
global:
34+
use_rbac: false

0 commit comments

Comments
 (0)