Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/kube2iam]: add rbac support #1286

Merged
merged 3 commits into from
Jul 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/kube2iam/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: kube2iam
version: 0.3.0
version: 0.3.1
description: Provide IAM credentials to pods based on annotations.
keywords:
- kube2iam
Expand Down
1 change: 1 addition & 0 deletions stable/kube2iam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Parameter | Description | Default
`podAnnotations` | annotations to be added to pods | `{}`
`resources` | pod resource requests & limits | `{}`
`verbose` | Enable verbose output | `false`
`rbac.enabled` | Enable role and serviceaccount creation | `false`
`updateStrategy` | The strategy for daemon set updates, e.g. `RollingUpdate` (requires Kubernetes 1.6+) | not set

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
Expand Down
5 changes: 5 additions & 0 deletions stable/kube2iam/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ spec:
app: {{ template "name" . }}
release: {{ .Release.Name }}
spec:
{{- if .Values.rbac.enabled }}
serviceAccountName: {{ template "fullname" . }}
{{- else }}
serviceAccountName: default
{{- end }}
containers:
- name: kube2iam
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down
19 changes: 19 additions & 0 deletions stable/kube2iam/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.rbac.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "fullname" . }}
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- watch
- list
{{- end -}}
19 changes: 19 additions & 0 deletions stable/kube2iam/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.rbac.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
11 changes: 11 additions & 0 deletions stable/kube2iam/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.rbac.enabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "fullname" . }}
{{- end -}}
3 changes: 3 additions & 0 deletions stable/kube2iam/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ resources: {}
# memory: 16Mi

verbose: false

rbac:
enabled: false