diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index d75ef77a..21d01d05 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: oauth2-proxy -version: 7.8.3 +version: 7.9.0 apiVersion: v2 appVersion: 7.7.1 home: https://oauth2-proxy.github.io/oauth2-proxy/ @@ -35,7 +35,7 @@ kubeVersion: ">=1.16.0-0" annotations: artifacthub.io/changes: | - kind: added - description: allow templates in annotations + description: allow requests to be directed to sidecar first links: - name: Github PR - url: https://github.com/oauth2-proxy/manifests/pull/256 + url: https://github.com/oauth2-proxy/manifests/pull/270 diff --git a/helm/oauth2-proxy/README.md b/helm/oauth2-proxy/README.md index 8a767862..a601af42 100644 --- a/helm/oauth2-proxy/README.md +++ b/helm/oauth2-proxy/README.md @@ -196,6 +196,7 @@ The following table lists the configurable parameters of the oauth2-proxy chart | `service.loadBalancerIP` | ip of load balancer | `nil` | | `service.loadBalancerSourceRanges` | allowed source ranges in load balancer | `nil` | | `service.nodePort` | external port number for the service when service.type is `NodePort` | `nil` | +| `service.targetPort` | (optional) a numeric port number (e.g., 80) or a port name defined in the pod's container(s) (e.g., http) | `""` | `serviceAccount.enabled` | create a service account | `true` | | `serviceAccount.name` | the service account name | `` | | `serviceAccount.annotations` | (optional) annotations for the service account | `{}` | @@ -357,3 +358,6 @@ config: whitelist_domains = [ ".domain.com", ".example.io"] provider = "google" ``` + +## Route requests to sidecar container +You can route requests to a sidecar container first by setting the `service.targetPort` variable. The possible values for the targetPort field of a Kubernetes Service can be either a port number or the name of a port defined in the pod. By default, the service's `targetPort` value equals to `httpSchema`'s. \ No newline at end of file diff --git a/helm/oauth2-proxy/templates/service.yaml b/helm/oauth2-proxy/templates/service.yaml index e8d02aeb..ab63c0da 100644 --- a/helm/oauth2-proxy/templates/service.yaml +++ b/helm/oauth2-proxy/templates/service.yaml @@ -36,7 +36,7 @@ spec: {{- end }} ports: - port: {{ .Values.service.portNumber }} - targetPort: {{ .Values.httpScheme }} + targetPort: {{ .Values.service.targetPort | default .Values.httpScheme }} {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} nodePort: {{ .Values.service.nodePort }} {{- end }} diff --git a/helm/oauth2-proxy/values.yaml b/helm/oauth2-proxy/values.yaml index c9ef103e..1487ae85 100644 --- a/helm/oauth2-proxy/values.yaml +++ b/helm/oauth2-proxy/values.yaml @@ -153,6 +153,8 @@ service: externalTrafficPolicy: "" # configure internalTrafficPolicy internalTrafficPolicy: "" + # configure service target port + targetPort: "" ## Create or use ServiceAccount serviceAccount: