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

Commit

Permalink
Merge pull request #96 from Bregor/features/rbac
Browse files Browse the repository at this point in the history
RBAC support
  • Loading branch information
vdice authored May 31, 2017
2 parents 5b58337 + acdb852 commit 2229d0c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
10 changes: 10 additions & 0 deletions charts/fluentd/templates/_helpers.tmpl
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 -}}
15 changes: 15 additions & 0 deletions charts/fluentd/templates/logger-fluentd-clusterrole.yaml
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: ClusterRole
apiVersion: {{ template "rbacAPIVersion" . }}
metadata:
name: deis:deis-logger-fluentd
labels:
app: deis-logger-fluentd
heritage: deis
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["list", "get", "watch"]
{{- end -}}
{{- end -}}
19 changes: 19 additions & 0 deletions charts/fluentd/templates/logger-fluentd-clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if (.Values.global.use_rbac) -}}
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
kind: ClusterRoleBinding
apiVersion: {{ template "rbacAPIVersion" . }}
metadata:
name: deis:deis-logger-fluentd
labels:
app: deis-logger-fluentd
heritage: deis
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: deis:deis-logger-fluentd
subjects:
- kind: ServiceAccount
name: deis-logger-fluentd
namespace: {{ .Release.Namespace }}
{{- end -}}
{{- end -}}
6 changes: 5 additions & 1 deletion charts/fluentd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ sources:

output:
disable_deis: false

boot:
install_build_tools: false

# Any custom fluentd environment variables (https://github.com/deis/fluentd#configuration)
# can be specified as key-value pairs under daemon_environment.
daemon_environment:
#<example-env>: <example-value>

# Role-Based Access Control for Kubernetes >= 1.5
global:
use_rbac: false

0 comments on commit 2229d0c

Please sign in to comment.