diff --git a/stable/oauth2-proxy/Chart.yaml b/stable/oauth2-proxy/Chart.yaml index 2157bd9c98..6e387432df 100644 --- a/stable/oauth2-proxy/Chart.yaml +++ b/stable/oauth2-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: oauth2-proxy -version: 2.4.1 +version: 3.0.0 apiVersion: v1 appVersion: 5.1.0 home: https://pusher.github.io/oauth2_proxy/ diff --git a/stable/oauth2-proxy/README.md b/stable/oauth2-proxy/README.md index 94d6ad7b01..3c26a06261 100644 --- a/stable/oauth2-proxy/README.md +++ b/stable/oauth2-proxy/README.md @@ -47,6 +47,10 @@ Version 2.0.0 of this chart introduces support for Kubernetes v1.16.x by way of Due to [this issue](https://github.com/helm/helm/issues/6583) there may be errors performing a `helm upgrade`of this chart from versions earlier than 2.0.0. +### To 3.0.0 + +Version 3.0.0 introduces support for [EKS IAM roles for service accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) by adding a managed service account to the chart. This is a breaking change since the service account is enabled by default. To disable this behaviour set `serviceAccount.enabled` to `false` + ## Configuration The following table lists the configurable parameters of the oauth2-proxy chart and their default values. @@ -104,6 +108,9 @@ Parameter | Description | Default `service.clusterIP` | cluster ip address | `nil` `service.loadBalancerIP` | ip of load balancer | `nil` `service.loadBalancerSourceRanges` | allowed source ranges in load balancer | `nil` +`serviceAccount.enabled` | create a service account | `true` +`serviceAccount.name` | the service account name | `` +`serviceAccount.annotations` | (optional) annotations for the service account | `{}` `tolerations` | list of node taints to tolerate | `[]` `securityContext.enabled` | enable Kubernetes security context | `false` `securityContext.runAsNonRoot` | make sure that the container runs as a non-root user | `true` diff --git a/stable/oauth2-proxy/templates/_helpers.tpl b/stable/oauth2-proxy/templates/_helpers.tpl index c263df0a80..e17bd44cc0 100644 --- a/stable/oauth2-proxy/templates/_helpers.tpl +++ b/stable/oauth2-proxy/templates/_helpers.tpl @@ -41,3 +41,14 @@ Get the secret name. {{- printf "%s" (include "oauth2-proxy.fullname" .) -}} {{- end -}} {{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "oauth2-proxy.serviceAccountName" -}} +{{- if .Values.serviceAccount.enabled -}} + {{ default (include "oauth2-proxy.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/stable/oauth2-proxy/templates/deployment.yaml b/stable/oauth2-proxy/templates/deployment.yaml index b3ae2fad20..32c148ee3e 100644 --- a/stable/oauth2-proxy/templates/deployment.yaml +++ b/stable/oauth2-proxy/templates/deployment.yaml @@ -36,6 +36,7 @@ spec: {{- if .Values.priorityClassName }} priorityClassName: "{{ .Values.priorityClassName }}" {{- end }} + serviceAccountName: {{ template "oauth2-proxy.serviceAccountName" . }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/stable/oauth2-proxy/templates/serviceaccount.yaml b/stable/oauth2-proxy/templates/serviceaccount.yaml new file mode 100644 index 0000000000..d3afa68bf9 --- /dev/null +++ b/stable/oauth2-proxy/templates/serviceaccount.yaml @@ -0,0 +1,15 @@ +{{- if or .Values.serviceAccount.enabled -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + app: {{ template "oauth2-proxy.name" . }} + chart: {{ template "oauth2-proxy.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "oauth2-proxy.fullname" . }} +{{- end -}} diff --git a/stable/oauth2-proxy/values.yaml b/stable/oauth2-proxy/values.yaml index f6688f517f..a834711ead 100644 --- a/stable/oauth2-proxy/values.yaml +++ b/stable/oauth2-proxy/values.yaml @@ -70,6 +70,15 @@ service: annotations: {} # foo.io/bar: "true" +## Create or use ServiceAccount +serviceAccount: + ## Specifies whether a ServiceAccount should be created + enabled: true + ## The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the fullname template + name: + annotations: {} + ingress: enabled: false path: /