Skip to content

Commit

Permalink
[stable/kibana] add ServiceAccount creation support (helm#8371)
Browse files Browse the repository at this point in the history
* [kibana] add ServiceAccount creation support

Signed-off-by: Ludovic Cavajani <[email protected]>

* bum chart version and not the app version

Signed-off-by: Ludovic Cavajani <[email protected]>

* fix missing dash in if/else condition

Signed-off-by: Ludovic Cavajani <[email protected]>

* bump version

Signed-off-by: David J. M. Karlsen <[email protected]>
  • Loading branch information
spiarh authored and k8s-ci-robot committed Oct 13, 2018
1 parent 5114585 commit 0e492f2
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 7 deletions.
2 changes: 1 addition & 1 deletion stable/kibana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: kibana
version: 0.14.8
version: 0.15.0
appVersion: 6.4.2
description: Kibana is an open source data visualization plugin for Elasticsearch
icon: https://raw.githubusercontent.com/elastic/kibana/master/src/ui/public/icons/kibana-color.svg
Expand Down
4 changes: 3 additions & 1 deletion stable/kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ The following table lists the configurable parameters of the kibana chart and th
| `podAnnotations` | annotations to add to each pod | `{}` |
| `replicaCount` | desired number of pods | `1` |
| `revisionHistoryLimit` | revisionHistoryLimit | `3` |
| `serviceAccountName` | serviceAccount that will run the pod | `nil` |
| `serviceAccountName` | DEPRECATED: use serviceAccount.name | `nil` |
| `serviceAccount.create` | create a serviceAccount to run the pod | `false` |
| `serviceAccount.name` | name of the serviceAccount to create | `kibana.fullname` |
| `authProxyEnabled` | enables authproxy. Create container in extracontainers | `false` |
| `extraContainers` | Sidecar containers to add to the kibana pod| `{}` |
| `resources` | pod resource requests & limits | `{}` |
Expand Down
15 changes: 15 additions & 0 deletions stable/kibana/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,18 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "kibana.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "kibana.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{- if .Values.serviceAccountName -}}
{{- .Values.serviceAccountName }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{- end -}}
4 changes: 1 addition & 3 deletions stable/kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ spec:
app: {{ template "kibana.name" . }}
release: "{{ .Release.Name }}"
spec:
{{- if .Values.serviceAccountName }}
serviceAccountName: {{ .Values.serviceAccountName }}
{{- end }}
serviceAccountName: {{ template "kibana.serviceAccountName" . }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
Expand Down
11 changes: 11 additions & 0 deletions stable/kibana/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "kibana.serviceAccountName" . }}
labels:
app: {{ template "kibana.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- end -}}
9 changes: 7 additions & 2 deletions stable/kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ ingress:
# hosts:
# - chart-example.local

# service account that will run the pod. Leave commented to use the default service account.
# serviceAccountName: kibana
serviceAccount:
# Specifies whether a service account should be created
create: false
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
# If set and create is false, the service account must be existing
name:

livenessProbe:
enabled: false
Expand Down

0 comments on commit 0e492f2

Please sign in to comment.