diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index ea2286b5..edada936 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: oauth2-proxy -version: 10.7.0 +version: 11.0.0 apiVersion: v2 appVersion: 7.15.3 home: https://oauth2-proxy.github.io/oauth2-proxy/ @@ -30,13 +30,8 @@ maintainers: kubeVersion: ">=1.16.0-0" annotations: artifacthub.io/changes: | - - kind: added - description: Add alpha-config.source and alpha-config.name helpers for centralized alpha config resolution + - kind: changed + description: Removed the `gatewayRef` field in favor of `parentRefs` for Gateway API configuration. links: - name: GitHub PR - url: https://github.com/oauth2-proxy/manifests/pull/405 - - kind: added - description: Add deprecation guards for invalid alphaConfig combinations - links: - - name: GitHub PR - url: https://github.com/oauth2-proxy/manifests/pull/405 + url: https://github.com/oauth2-proxy/manifests/pull/421 diff --git a/helm/oauth2-proxy/README.md b/helm/oauth2-proxy/README.md index 1d023f33..fe0eec9a 100644 --- a/helm/oauth2-proxy/README.md +++ b/helm/oauth2-proxy/README.md @@ -143,6 +143,51 @@ redis-ha: With above new chart version won't add extra `-ha` suffix to all redis resources. +### To 11.0.0 + +Version 11.0.0 use `gatewayAPI.parentRefs` instead of `gatewayAPI.gatewayRef`. + +**Breaking Change**: If you were previously using the gatewayAPI options, you must now use `gatewayAPI.parentRefs` instead of `gatewayAPI.gatewayRef` to configure the HTTPRoute's parent. It can be a `Gateway` or/and one or several `ListenerSet`. + +Before: + +```yaml +gatewayApi: + enabled: true + gatewayRef: + name: gateway + namespace: gateway-system + sectionName: my-gateway-https-listener-name + # ... other gatewayApi configuration +``` + +After (Gateway version): + +```yaml +gatewayApi: + enabled: true + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: gateway + namespace: gateway-system + sectionName: my-gateway-https-listener-name + # ... other gatewayApi configuration +``` + +After (listernerSet version): + +```yaml +gatewayApi: + enabled: true + parentRefs: + - group: gateway.networking.k8s.io + kind: ListenerSet + name: oauth2-proxy + namespace: my-namespace + # ... other gatewayApi configuration +``` + ## Configuration The following table lists the configurable parameters of the oauth2-proxy chart and their default values. @@ -203,7 +248,7 @@ The following table lists the configurable parameters of the oauth2-proxy chart | `extraVolumes` | list of extra volumes | `[]` | | `gatewayApi.annotations` | Additional annotations to add to the HTTPRoute | `{}` | | `gatewayApi.enabled` | Enable Gateway API HTTPRoute | `false` | -| `gatewayApi.gatewayRef` | The ParentRef of the HTTPRoute according to: https://gateway-api.sigs.k8s.io/reference/spec/#parentreference | `{}` | +| `gatewayApi.parentRefs` | The ParentRefs of the HTTPRoute according to: https://gateway-api.sigs.k8s.io/reference/api-spec/main/spec/#parentreference and https://gateway-api.sigs.k8s.io/reference/api-types/listenerset/#route-attachment | `{}` | | `gatewayApi.hostnames` | Hostnames to match in the HTTPRoute | `[]` | | `gatewayApi.labels` | Additional labels to add to the HTTPRoute | `{}` | | `gatewayApi.rules` | HTTPRoute rule configuration. If not specified, a default rule with PathPrefix `/` will be created | `[]` | @@ -335,15 +380,16 @@ This chart supports using [Kubernetes Gateway API](https://gateway-api.sigs.k8s. 1. Ensure the Gateway API CRDs are installed in your cluster 2. Create a Gateway resource (or use an existing one) -3. Configure the chart to create an HTTPRoute +3. (Optionnal) Create a ListenerSet resource (or use an existing one) +4. Configure the chart to create an HTTPRoute ### Basic Gateway API Configuration ```yaml gatewayApi: enabled: true - gatewayRef: - name: my-gateway + parentRefs: + - name: my-gateway namespace: gateway-system hostnames: - oauth.example.com @@ -354,8 +400,8 @@ gatewayApi: ```yaml gatewayApi: enabled: true - gatewayRef: - name: my-gateway + parentRefs: + - name: my-gateway namespace: gateway-system sectionName: my-gateway-https-listener-name hostnames: diff --git a/helm/oauth2-proxy/ci/gateway-api-listenerset.yaml b/helm/oauth2-proxy/ci/gateway-api-listenerset.yaml new file mode 100644 index 00000000..aa53f5dc --- /dev/null +++ b/helm/oauth2-proxy/ci/gateway-api-listenerset.yaml @@ -0,0 +1,19 @@ +# Test values for Gateway API HTTPRoute configuration with ListenerSet +gatewayApi: + enabled: true + parentRefs: + - group: gateway.networking.k8s.io + kind: ListenerSet + name: oauth2-proxy + namespace: my-namespace + hostnames: + - oauth.example.com + rules: + - matches: + - path: + type: PathPrefix + value: /oauth2 + annotations: + example.com/annotation: "value" + labels: + example.com/label: "value" diff --git a/helm/oauth2-proxy/ci/gateway-api-minimal-listenerset.yaml b/helm/oauth2-proxy/ci/gateway-api-minimal-listenerset.yaml new file mode 100644 index 00000000..e8ec1f6c --- /dev/null +++ b/helm/oauth2-proxy/ci/gateway-api-minimal-listenerset.yaml @@ -0,0 +1,9 @@ +# Minimal Gateway API configuration with default rule with ListenerSet +gatewayApi: + enabled: true + parentRefs: + - kind: ListenerSet + name: oauth2-proxy + namespace: my-namespace + hostnames: + - minimal.example.com diff --git a/helm/oauth2-proxy/ci/gateway-api-minimal.yaml b/helm/oauth2-proxy/ci/gateway-api-minimal.yaml index e5a6a4fa..29b8aa18 100644 --- a/helm/oauth2-proxy/ci/gateway-api-minimal.yaml +++ b/helm/oauth2-proxy/ci/gateway-api-minimal.yaml @@ -1,7 +1,8 @@ # Minimal Gateway API configuration with default rule gatewayApi: enabled: true - gatewayRef: + parentRefs: + - kind: Gateway name: minimal-gateway hostnames: - minimal.example.com diff --git a/helm/oauth2-proxy/ci/gateway-api-name-listenerset.yaml b/helm/oauth2-proxy/ci/gateway-api-name-listenerset.yaml new file mode 100644 index 00000000..f994263a --- /dev/null +++ b/helm/oauth2-proxy/ci/gateway-api-name-listenerset.yaml @@ -0,0 +1,18 @@ +# Gateway API configuration with rule name with ListenerSet +gatewayApi: + enabled: true + parentRefs: + - kind: ListenerSet + name: oauth2-proxy + namespace: my-namespace + rules: + - name: service + matches: + - path: + type: PathPrefix + value: / + - name: metrics + matches: + - path: + type: PathPrefix + value: /metrics diff --git a/helm/oauth2-proxy/ci/gateway-api-name.yaml b/helm/oauth2-proxy/ci/gateway-api-name.yaml index 9d04c05d..7aee6b67 100644 --- a/helm/oauth2-proxy/ci/gateway-api-name.yaml +++ b/helm/oauth2-proxy/ci/gateway-api-name.yaml @@ -1,7 +1,8 @@ # Gateway API configuration with rule name gatewayApi: enabled: true - gatewayRef: + parentRefs: + - kind: Gateway name: test-gateway rules: - name: service diff --git a/helm/oauth2-proxy/ci/gateway-api.yaml b/helm/oauth2-proxy/ci/gateway-api.yaml index 51c81425..b455a559 100644 --- a/helm/oauth2-proxy/ci/gateway-api.yaml +++ b/helm/oauth2-proxy/ci/gateway-api.yaml @@ -1,7 +1,8 @@ # Test values for Gateway API HTTPRoute configuration gatewayApi: enabled: true - gatewayRef: + parentRefs: + - kind: Gateway name: example-gateway namespace: gateway-system hostnames: diff --git a/helm/oauth2-proxy/templates/httproute.yaml b/helm/oauth2-proxy/templates/httproute.yaml index 35f1f875..10a00c54 100644 --- a/helm/oauth2-proxy/templates/httproute.yaml +++ b/helm/oauth2-proxy/templates/httproute.yaml @@ -17,9 +17,9 @@ metadata: {{ tpl ( toYaml . ) $ | indent 4 }} {{- end }} spec: - {{- with .Values.gatewayApi.gatewayRef }} + {{- with .Values.gatewayApi.parentRefs }} parentRefs: - - {{ toYaml . | nindent 4 | trim }} + {{- toYaml . | nindent 2 }} {{- end }} {{- if .Values.gatewayApi.hostnames }} hostnames: diff --git a/helm/oauth2-proxy/values.yaml b/helm/oauth2-proxy/values.yaml index 5521eb02..cec18fa2 100644 --- a/helm/oauth2-proxy/values.yaml +++ b/helm/oauth2-proxy/values.yaml @@ -365,18 +365,30 @@ ingress: # - chart-example.local # Gateway API HTTPRoute configuration -# Ref: https://gateway-api.sigs.k8s.io/api-types/httproute/ +# Ref: https://gateway-api.sigs.k8s.io/reference/api-types/httproute/ gatewayApi: enabled: false - # The name of the Gateway resource to attach the HTTPRoute to - # Example: - # gatewayRef: + # The list of the parentRef resources to attach the HTTPRoute to + # Can either be a Gateway or one or several ListenerSet + # Example : + # Gateway version + # parentRefs: + # - group: gateway.networking.k8s.io + # kind: Gateway # name: gateway # namespace: gateway-system # sectionName: my-gateway-https-listener-name # - # https://gateway-api.sigs.k8s.io/reference/spec/#parentreference - gatewayRef: {} + # ListenerSet version + # parentRefs: + # - group: gateway.networking.k8s.io + # kind: ListenerSet + # name: oauth2-proxy + # namespace: my-namespace + # + # https://gateway-api.sigs.k8s.io/reference/api-spec/main/spec/#parentreference + # https://gateway-api.sigs.k8s.io/reference/api-types/listenerset/#route-attachment + parentRefs: [] # HTTPRoute rule configuration # rules: # - name: service # optional: enables targeting by sectionName in policies