Skip to content

feat: add oidcProxy support to Helm chart - #560

Merged
KhizerJaan merged 3 commits into
masterfrom
feat/oidc-proxy
Apr 9, 2026
Merged

KhizerJaan merged 3 commits into
masterfrom
feat/oidc-proxy

Conversation

@KhizerJaan

Copy link
Copy Markdown
Contributor

Summary

  • Add generic OIDC proxy sidecar option (oidcProxy) alongside the existing openshiftOauthProxy
  • Supports configurable issuer URL, client ID, client/cookie secret refs, redirect URL, and scopes
  • Bumps chart version to 1.3.0

Test plan

  • helm template with oidcProxy.enabled=true renders oauth-proxy sidecar with --provider=oidc
  • helm template with openshiftOauthProxy.enabled=true still works as before
  • Both disabled by default — no breaking change

KhizerJaan and others added 2 commits April 8, 2026 18:51
Add a generic OIDC proxy sidecar option that supports configurable
issuer URL, client ID, client secret, cookie secret, redirect URL,
and scopes via Helm values.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new, generic oidcProxy oauth2-proxy sidecar option to the Forecastle Helm chart (in addition to the existing OpenShift OAuth proxy) and bumps the chart version.

Changes:

  • Introduces forecastle.oidcProxy values for configuring an OIDC oauth2-proxy sidecar.
  • Updates the Deployment template to conditionally render the OIDC oauth-proxy container and TLS secret volume.
  • Bumps chart version to 1.3.0.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
deployments/kubernetes/chart/forecastle/values.yaml Adds the oidcProxy configuration block and defaults.
deployments/kubernetes/chart/forecastle/templates/deployment.yaml Renders the OIDC proxy sidecar + TLS volume when enabled.
deployments/kubernetes/chart/forecastle/Chart.yaml Chart version bump to 1.3.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +79 to +96
{{- if .Values.forecastle.oidcProxy.enabled }}
- name: oauth-proxy
image: "{{ .Values.forecastle.oidcProxy.image }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
name: public
args:
- --https-address=:8443
- --provider=oidc
- --oidc-issuer-url={{ .Values.forecastle.oidcProxy.issuerUrl }}
- --client-id={{ .Values.forecastle.oidcProxy.clientId }}
- --redirect-url={{ .Values.forecastle.oidcProxy.redirectUrl }}
- --upstream=http://localhost:3000
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --email-domain=*
- --scope={{ .Values.forecastle.oidcProxy.scopes }}

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oidcProxy adds an oauth2-proxy sidecar listening on 8443, but the chart’s Service template currently switches to port 443/targetPort 8443 only when openshiftOauthProxy.enabled is true. With oidcProxy.enabled=true (and OpenShift proxy disabled), the Service will still route to port 3000, bypassing the proxy / breaking TLS termination. Update templates/service.yaml to treat oidcProxy.enabled the same way (or use a combined condition like or openshiftOauthProxy.enabled oidcProxy.enabled).

Copilot uses AI. Check for mistakes.
Comment on lines 52 to +85
{{- if .Values.forecastle.openshiftOauthProxy.enabled }}
- name: oauth-proxy
image: "{{ default "stakater/oauth-proxy:v0.0.2" .Values.forecastle.openshiftOauthProxy.image }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
name: public
args:
- --https-address=:8443
- --provider=openshift
- --openshift-service-account={{ template "forecastle.name" . }}
- --upstream=http://localhost:3000
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --cookie-secret=SECRET
volumeMounts:
- mountPath: /etc/tls/private
name: openshift-oauth-proxy-tls
{{- with .Values.forecastle.openshiftOauthProxy.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.forecastle.openshiftOauthProxy.resources }}
resources:
{{ toYaml .Values.forecastle.openshiftOauthProxy.resources | indent 10 }}
{{- end }}
{{- end }}
{{- if .Values.forecastle.oidcProxy.enabled }}
- name: oauth-proxy
image: "{{ .Values.forecastle.oidcProxy.image }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
name: public

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both forecastle.openshiftOauthProxy.enabled and forecastle.oidcProxy.enabled can be set to true, which would render two containers with the same name (oauth-proxy) and the same port name (public) in a single Pod—Kubernetes will reject this manifest. Add a chart-level validation/guard to enforce mutual exclusivity (e.g., fail rendering if both are enabled), or rename one container/port to avoid collisions and make the behavior explicit.

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +107
- name: oauth-proxy
image: "{{ .Values.forecastle.oidcProxy.image }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
name: public
args:
- --https-address=:8443
- --provider=oidc
- --oidc-issuer-url={{ .Values.forecastle.oidcProxy.issuerUrl }}
- --client-id={{ .Values.forecastle.oidcProxy.clientId }}
- --redirect-url={{ .Values.forecastle.oidcProxy.redirectUrl }}
- --upstream=http://localhost:3000
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --email-domain=*
- --scope={{ .Values.forecastle.oidcProxy.scopes }}
env:
- name: OAUTH2_PROXY_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.forecastle.oidcProxy.clientSecretRef.name }}
key: {{ .Values.forecastle.oidcProxy.clientSecretRef.key }}
- name: OAUTH2_PROXY_COOKIE_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.forecastle.oidcProxy.cookieSecretRef.name }}
key: {{ .Values.forecastle.oidcProxy.cookieSecretRef.key }}

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When oidcProxy.enabled=true, several required settings can still render as empty/invalid Kubernetes fields (e.g., image: "", secretKeyRef.name/key with empty values, empty --oidc-issuer-url, --client-id, --redirect-url). Consider using Helm required/fail to enforce these values when enabled (and/or provide sensible defaults like the OpenShift proxy does via default). This prevents rendering manifests that will be rejected by the API server or crash-loop immediately.

Copilot uses AI. Check for mistakes.
Comment on lines +79 to 119
{{- if .Values.forecastle.oidcProxy.enabled }}
- name: oauth-proxy
image: "{{ .Values.forecastle.oidcProxy.image }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
name: public
args:
- --https-address=:8443
- --provider=oidc
- --oidc-issuer-url={{ .Values.forecastle.oidcProxy.issuerUrl }}
- --client-id={{ .Values.forecastle.oidcProxy.clientId }}
- --redirect-url={{ .Values.forecastle.oidcProxy.redirectUrl }}
- --upstream=http://localhost:3000
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --email-domain=*
- --scope={{ .Values.forecastle.oidcProxy.scopes }}
env:
- name: OAUTH2_PROXY_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.forecastle.oidcProxy.clientSecretRef.name }}
key: {{ .Values.forecastle.oidcProxy.clientSecretRef.key }}
- name: OAUTH2_PROXY_COOKIE_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.forecastle.oidcProxy.cookieSecretRef.name }}
key: {{ .Values.forecastle.oidcProxy.cookieSecretRef.key }}
volumeMounts:
- mountPath: /etc/tls/private
name: oauth-proxy-tls
{{- with .Values.forecastle.oidcProxy.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.forecastle.oidcProxy.resources }}
resources:
{{ toYaml .Values.forecastle.oidcProxy.resources | indent 10 }}
{{- end }}
{{- end }}

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds new conditional rendering paths for the Deployment (oidcProxy), but the chart has existing helm-unittest coverage in chart/forecastle/tests/deployment_test.yaml and no new tests were added for the new sidecar. Add tests that assert: (1) oidcProxy.enabled=true renders the oauth-proxy container with --provider=oidc and the expected env/volumeMounts, and (2) mutual exclusivity/validation behavior if both proxies are enabled.

Copilot uses AI. Check for mistakes.
Comment on lines +103 to +115
oidcProxy:
enabled: false
image: ""
issuerUrl: ""
clientId: ""
redirectUrl: ""
scopes: "openid email profile"
clientSecretRef:
name: ""
key: ""
cookieSecretRef:
name: ""
key: ""

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oidcProxy defaults (image, issuerUrl, clientId, redirectUrl, and secret refs) are empty strings. If a user sets oidcProxy.enabled=true and forgets to override one of these, the rendered manifests will be invalid or the proxy will fail to start. Consider either providing a sane default image (similar to openshiftOauthProxy.image) and/or adding chart validations (via required/fail) so Helm fails fast with a clear message when required fields are missing.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to 6
version: 1.3.0
appVersion: "v2.0.0"

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chart version is bumped to 1.3.0, but values.yaml still sets forecastle.labels.version: 1.2.0 (used in _helpers.tpl for resource labels). This will make labels inconsistent with the chart release version. Consider updating the default label value to 1.3.0 or deriving it from .Chart.Version to avoid manual drift.

Copilot uses AI. Check for mistakes.
- Add mutual exclusivity guard: fail if both openshiftOauthProxy and
  oidcProxy are enabled
- Add required field validation for image, issuerUrl, clientId,
  redirectUrl, and secret refs when oidcProxy is enabled
- Rename oidcProxy container to 'oidc-proxy' to avoid name collision
- Update service.yaml to route to proxy port when oidcProxy is enabled
- Update label version to 1.3.0 to match chart version
@msafwankarim msafwankarim added the ok-to-test Label for running e2e tests label Apr 9, 2026
@github-actions github-actions Bot removed the ok-to-test Label for running e2e tests label Apr 9, 2026
@KhizerJaan
KhizerJaan merged commit aaceb4a into master Apr 9, 2026
11 checks passed
@KhizerJaan
KhizerJaan deleted the feat/oidc-proxy branch April 9, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants