Skip to content

Commit

Permalink
[stable/minio] Add serviceAccount option for deployed pods (helm#14917)
Browse files Browse the repository at this point in the history
* Add serviceAccount option for deployed pods

Signed-off-by: Tyler Camp <[email protected]>

* Bump minio chart version

Signed-off-by: Tyler Camp <[email protected]>

* Add trailing newline to values.yaml

Signed-off-by: Tyler Camp <[email protected]>
  • Loading branch information
tylercamp authored and davidkarlsen committed Jul 3, 2019
1 parent 82c3981 commit 7bf88ad
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/minio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: MinIO is a high performance distributed object storage server, designed for large-scale private cloud infrastructure.
name: minio
version: 2.4.16
version: 2.4.17
appVersion: RELEASE.2019-05-14T23-57-45Z
keywords:
- storage
Expand Down
2 changes: 2 additions & 0 deletions stable/minio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ The following table lists the configurable parameters of the MinIO chart and the
| `service.port` | Kubernetes port where service is exposed| `9000` |
| `service.externalIPs` | service external IP addresses | `nil` |
| `service.annotations` | Service annotations | `{}` |
| `serviceAccount.create` | Toggle creation of new service account | `true` |
| `serviceAccount.name` | Name of service account to create and/or use | `""` |
| `persistence.enabled` | Use persistent volume to store data | `true` |
| `persistence.size` | Size of persistent volume claim | `10Gi` |
| `persistence.existingClaim`| Use an existing PVC to persist data | `nil` |
Expand Down
11 changes: 11 additions & 0 deletions stable/minio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@ Return the appropriate apiVersion for networkpolicy.
{{- print "networking.k8s.io/v1" -}}
{{- end -}}
{{- end -}}

{{/*
Determine service account name for deployment or statefulset.
*/}}
{{- define "minio.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{- default (include "minio.fullname" .) .Values.serviceAccount.name | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- default "default" .Values.serviceAccount.name -}}
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions stable/minio/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ spec:
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
serviceAccountName: {{ include "minio.serviceAccountName" . | quote }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down
1 change: 1 addition & 0 deletions stable/minio/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ spec:
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
serviceAccountName: {{ include "minio.serviceAccountName" . | quote }}
containers:
- name: {{ .Chart.Name }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
Expand Down
8 changes: 8 additions & 0 deletions stable/minio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,11 @@ environment:
networkPolicy:
enabled: false
allowExternal: true

## Specify the service account to use for the Minio pods. If 'create' is set to 'false'
## and 'name' is left unspecified, the account 'default' will be used.
serviceAccount:
create: true
## The name of the service account to use. If 'create' is 'true', a service account with that name
## will be created. Otherwise, a name will be auto-generated.
name:

0 comments on commit 7bf88ad

Please sign in to comment.