Skip to content

Commit 491fdd4

Browse files
Merge pull request #400 from treydock/tpl-ingress
Add tpl support for ingress.labels, ingress.extraPaths and nodeSelector
2 parents b2987f8 + ecdb6fd commit 491fdd4

6 files changed

Lines changed: 33 additions & 7 deletions

File tree

helm/oauth2-proxy/Chart.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 10.4.3
2+
version: 10.5.0
33
apiVersion: v2
44
appVersion: 7.15.2
55
home: https://oauth2-proxy.github.io/oauth2-proxy/
@@ -30,8 +30,12 @@ maintainers:
3030
kubeVersion: ">=1.16.0-0"
3131
annotations:
3232
artifacthub.io/changes: |
33-
- kind: changed
34-
description: Bump OAuth2 Proxy image to v7.15.2
33+
- kind: added
34+
description: >
35+
Add deploymentLabels to allow setting deployment specific labels.
36+
Add tpl support for ingress.labels, ingress.extraPaths and nodeSelector. This is a
37+
behavior change: any values containing `{{ ... }}` will now be evaluated as templates.
38+
To keep literal `{{` sequences, escape them (for example, use `{{"{{"}}`).
3539
links:
3640
- name: GitHub PR
37-
url: https://github.com/oauth2-proxy/manifests/pull/406
41+
url: https://github.com/oauth2-proxy/manifests/pull/400

helm/oauth2-proxy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ The following table lists the configurable parameters of the oauth2-proxy chart
190190
| `config.google.useApplicationDefaultCredentials` | use the application-default credentials (i.e. Workload Identity on GKE) instead of providing a service account JSON | `false` |
191191
| `containerPort` | used to customize port on the deployment | `""` |
192192
| `customLabels` | Custom labels to add into metadata | `{}` |
193+
| `deploymentLabels` | labels to add to the deployment | `{}` |
193194
| `deploymentAnnotations` | annotations to add to the deployment | `{}` |
194195
| `enableServiceLinks` | configure deployment enableServiceLinks | `true` |
195196
| `extraArgs` | Extra arguments to give the binary. Either as a map with key:value pairs or as a list type, which allows the same flag to be configured multiple times. (e.g. `["--allowed-role=CLIENT_ID:CLIENT_ROLE_NAME_A", "--allowed-role=CLIENT_ID:CLIENT_ROLE_NAME_B"]`). | `{}` or `[]` |

helm/oauth2-proxy/ci/tpl-values.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ ingress:
1313
- "{{ $.Release.Name }}.local"
1414
annotations:
1515
test-annotations/test: "{{ $.Release.Name }}"
16+
labels:
17+
test-annotations/test: "{{ $.Release.Name }}"
18+
extraPaths:
19+
- path: /ping
20+
pathType: Prefix
21+
backend:
22+
service:
23+
name: '{{ include "oauth2-proxy.fullname" $ }}'
24+
port:
25+
name: '{{ $.Values.httpScheme }}'
1626
oauth2-proxy:
1727
checkDeprecation: false
1828
config:
@@ -47,6 +57,9 @@ config:
4757
test-annotations/test: "{{ $.Release.Name }}"
4858
cookieName: '{{ $.Release.Name }}'
4959

60+
deploymentLabels:
61+
test-deployment-label/test: "{{ $.Release.Name }}"
62+
5063
deploymentAnnotations:
5164
test-annotations/test: "{{ $.Release.Name }}"
5265

@@ -72,3 +85,7 @@ serviceMonitor:
7285

7386
customLabels:
7487
test-labels/test: "{{ $.Release.Name }}"
88+
89+
nodeOS: linux
90+
nodeSelector:
91+
kubernetes.io/os: "{{ .Values.nodeOS }}"

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ metadata:
66
labels:
77
app: {{ template "oauth2-proxy.name" . }}
88
{{- include "oauth2-proxy.labels" . | indent 4 }}
9+
{{- with .Values.deploymentLabels }}
10+
{{ tpl ( toYaml . ) $ | indent 4 }}
11+
{{- end }}
912
{{- with .Values.deploymentAnnotations }}
1013
annotations:
1114
{{ tpl ( toYaml . ) $ | indent 4 }}
@@ -415,7 +418,7 @@ spec:
415418
{{- end }}
416419
{{- with .Values.nodeSelector }}
417420
nodeSelector:
418-
{{- toYaml . | nindent 8 }}
421+
{{- tpl (toYaml .) $ | nindent 8 }}
419422
{{- end }}
420423
{{- with .Values.tolerations }}
421424
tolerations:

helm/oauth2-proxy/templates/ingress.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
app: {{ template "oauth2-proxy.name" . }}
1212
{{- include "oauth2-proxy.labels" . | indent 4 }}
1313
{{- if .Values.ingress.labels }}
14-
{{ toYaml .Values.ingress.labels | indent 4 }}
14+
{{- tpl (toYaml .Values.ingress.labels) $ | nindent 4 }}
1515
{{- end }}
1616
name: {{ template "oauth2-proxy.fullname" . }}
1717
namespace: {{ template "oauth2-proxy.namespace" $ }}
@@ -29,7 +29,7 @@ spec:
2929
http:
3030
paths:
3131
{{- if $extraPaths }}
32-
{{ toYaml $extraPaths | indent 10 }}
32+
{{- tpl (toYaml $extraPaths) $ | nindent 10 }}
3333
{{- end }}
3434
- path: {{ $ingressPath }}
3535
{{- if eq "true" ( include "ingress.supportsPathType" $ ) }}

helm/oauth2-proxy/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ securityContext:
475475
seccompProfile:
476476
type: RuntimeDefault
477477

478+
deploymentLabels: {}
478479
deploymentAnnotations: {}
479480
podAnnotations: {}
480481
podLabels: {}

0 commit comments

Comments
 (0)