Skip to content

Commit 3500132

Browse files
Merge pull request #127 from kvanzuijlen/workload-identity-support
Added support for using Workload Identity to the Helm chart
2 parents 2f2f385 + c09d01b commit 3500132

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 6.7.3
2+
version: 6.8.0
33
apiVersion: v2
44
appVersion: 7.4.0
55
home: https://oauth2-proxy.github.io/oauth2-proxy/

helm/oauth2-proxy/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ Parameter | Description | Default
110110
`alphaConfig.existingConfig` | existing Kubernetes configmap to use for the alpha configuration file. See [config template](https://github.com/oauth2-proxy/manifests/blob/master/helm/oauth2-proxy/templates/configmap-alpha.yaml) for the required values | `nil`
111111
`customLabels` | Custom labels to add into metadata | `{}` |
112112
`config.google.adminEmail` | user impersonated by the google service account | `""`
113+
`config.google.useApplicationDefaultCredentials` | use the application-default credentials (i.e. Workload Identity on GKE) instead of providing a service account json | `false`
114+
`config.google.targetPrincipal` | service account to use/impersonate | `""`
113115
`config.google.serviceAccountJson` | google service account json contents | `""`
114116
`config.google.existingConfig` | existing Kubernetes configmap to use for the service account file. See [google secret template](https://github.com/oauth2-proxy/manifests/blob/master/helm/oauth2-proxy/templates/google-secret.yaml) for the required values | `nil`
115117
`config.google.groups` | restrict logins to members of these google groups | `[]`

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,17 @@ spec:
9595
{{- end }}
9696
{{- end }}
9797
{{- with .Values.config.google }}
98-
{{- if and .adminEmail (or .serviceAccountJson .existingSecret) }}
98+
{{- if and .adminEmail (or .serviceAccountJson .existingSecret .useApplicationDefaultCredentials) }}
9999
- --google-admin-email={{ .adminEmail }}
100+
{{- if .useApplicationDefaultCredentials }}
101+
- --google-use-application-default-credentials=true
102+
{{- else }}
100103
- --google-service-account-json=/google/service-account.json
101104
{{- end }}
105+
{{- if .targetPrincipal }}
106+
- --google-target-principal={{ .targetPrincipal }}
107+
{{- end }}
108+
{{- end }}
102109
{{- if .groups }}
103110
{{- range $group := .groups }}
104111
- --google-group={{ $group }}

helm/oauth2-proxy/templates/google-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.config.google (not .Values.config.google.existingSecret) }}
1+
{{- if and .Values.config.google (and (not .Values.config.google.existingSecret) (not .Values.config.google.useApplicationDefaultCredentials)) }}
22
apiVersion: v1
33
kind: Secret
44
metadata:

helm/oauth2-proxy/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ config:
2222
cookieName: ""
2323
google: {}
2424
# adminEmail: xxxx
25+
# useApplicationDefaultCredentials: true
26+
# targetPrincipal: xxxx
2527
# serviceAccountJson: xxxx
2628
# Alternatively, use an existing secret (see google-secret.yaml for required fields)
2729
# Example:

0 commit comments

Comments
 (0)