Skip to content

Commit

Permalink
Release 1.0
Browse files Browse the repository at this point in the history
Attempt at supporting new image parameters
  • Loading branch information
asaf400 committed Oct 14, 2024
1 parent 6da82f9 commit edc6db6
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 12 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 2 additions & 2 deletions charts/console/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: A Helm chart for Kubernetes
type: application

# This is the chart version.
version: 0.6.0
version: 1.0.0

# This is the version number of the application being deployed.
appVersion: "4.11.0" # https://access.redhat.com/support/policy/updates/openshift # paragraph "OpenShift Support Matrix"
appVersion: "4.16.0" # https://access.redhat.com/support/policy/updates/openshift # paragraph "OpenShift Support Matrix"
28 changes: 28 additions & 0 deletions charts/console/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,34 @@ app.kubernetes.io/name: {{ include "openshift-console.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "openshift-console.authnKey" -}}
{{- $existing := lookup "v1" "Secret" .Release.Namespace (include "openshift-console.fullname" . ) -}}
{{- $authnKey := default (randAlphaNum 32 | b64enc) .Values.secrets.oidcCookiesEncryption.authnKey -}}
{{- if $existing.data -}}
{{- if $existing.data.authnKey -}}
{{ " " $existing.data.authnKey }}
{{- else -}}
{{- $authnKey | indent 1 }}
{{- end }}
{{- else -}}
{{- $authnKey | indent 1 }}
{{- end }}
{{- end }}

{{- define "openshift-console.encryptKey" -}}
{{- $existing := lookup "v1" "Secret" .Release.Namespace (include "openshift-console.fullname" . ) -}}
{{- $encryptKey := default (randAlphaNum 32 | b64enc) .Values.secrets.oidcCookiesEncryption.encryptKey -}}
{{- if $existing.data -}}
{{- if $existing.data.encryptKey -}}
{{- $existing.data.encryptKey }}
{{- else -}}
{{- $encryptKey | indent 1 }}
{{- end }}
{{- else -}}
{{- $encryptKey | indent 1 }}
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
Expand Down
22 changes: 21 additions & 1 deletion charts/console/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: oidc-cookie-encryption
mountPath: /etc/bridge/oidc-authnKey
subPath: authnKey
- name: oidc-cookie-encryption
mountPath: /etc/bridge/oidc-encryptKey
subPath: encryptKey
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down Expand Up @@ -63,12 +70,18 @@ spec:
- name: BRIDGE_USER_AUTH_OIDC_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.secret.secretName }}
name: {{ .Values.secrets.idpSecret.secretName }}
key: clientSecret
- name: BRIDGE_USER_AUTH_OIDC_ISSUER_URL
value: {{ .Values.bridgeEnvironmentVariables.BRIDGE_USER_AUTH_OIDC_ISSUER_URL }}
- name: BRIDGE_V
value: {{ .Values.verbosity | quote }}
{{- if eq .Values.bridgeEnvironmentVariables.BRIDGE_USER_AUTH "oidc" }}
- name: BRIDGE_COOKIE_ENCRYPTION_KEY_FILE
value: "/etc/bridge/oidc-encryptKey"
- name: BRIDGE_COOKIE_AUTHENTICATION_KEY_FILE
value: "/etc/bridge/oidc-authnKey"
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -81,3 +94,10 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if eq .Values.bridgeEnvironmentVariables.BRIDGE_USER_AUTH "oidc" }}
volumes:
- name: oidc-cookie-encryption
secret:
secretName: {{ .Values.secrets.oidcCookiesEncryption.secretName }}
{{- end }}

7 changes: 4 additions & 3 deletions charts/console/templates/idp-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.secret.create -}}
{{- if .Values.secrets.idpSecret.create -}}

apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.secret.secretName }}
name: {{ .Values.secrets.idpSecret.secretName }}
namespace: default
type: Opaque
data:
clientSecret: {{ .Values.secret.clientSecret }}
clientSecret: {{ .Values.secrets.idpSecret.clientSecret }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/console/templates/oidc-cookies-encryption-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.secrets.oidcCookiesEncryption.create -}}

apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.secrets.oidcCookiesEncryption.secretName }}
namespace: default
type: Opaque
data:
authnKey: {{- include "openshift-console.authnKey" . }}
encryptKey: {{- include "openshift-console.encryptKey" . }}
{{- end }}
19 changes: 13 additions & 6 deletions charts/console/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:
repository: quay.io/openshift/origin-console
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "4.11.0" # 4.11.0 introduces 'dark mode' by default.
tag: ""

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -36,10 +36,17 @@ securityContext: {}
# runAsNonRoot: true
# runAsUser: 1000

secret:
secretName: idp-secret
create: true
clientSecret:
secrets:
idpSecret:
secretName: idp-secret
create: true
clientSecret:
oidcCookiesEncryption:
secretName: oidc-cookies-encryption
create: true
# base64 encoded string
# authnKey:
# encryptKey:
oidcIdentityProvider: ""

# only modify the string elements, not the claim keys
Expand All @@ -59,7 +66,7 @@ bridgeEnvironmentVariables:
BRIDGE_BASE_ADDRESS: # "https://my-console.cluster.example.com"
BRIDGE_USER_AUTH_OIDC_CLIENT_ID: # BRIDGE_USER_AUTH_OIDC_CLIENT_ID
BRIDGE_USER_AUTH_OIDC_ISSUER_URL: # https://my-oidc-prodiver.okta.jumpcloud.example.com
# BRIDGE_USER_AUTH_OIDC_CLIENT_SECRET defaults to consuming vaule from values.secret.secretName
# BRIDGE_USER_AUTH_OIDC_CLIENT_SECRET defaults to consuming vaule from values.secrets.idpSecret.secretName

extraEnv: ""
# - name: BRIDGE_INACTIVITY_TIMEOUT
Expand Down

0 comments on commit edc6db6

Please sign in to comment.