Skip to content

Commit edc6db6

Browse files
committed
Release 1.0
Attempt at supporting new image parameters
1 parent 6da82f9 commit edc6db6

File tree

7 files changed

+81
-12
lines changed

7 files changed

+81
-12
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

charts/console/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: A Helm chart for Kubernetes
55
type: application
66

77
# This is the chart version.
8-
version: 0.6.0
8+
version: 1.0.0
99

1010
# This is the version number of the application being deployed.
11-
appVersion: "4.11.0" # https://access.redhat.com/support/policy/updates/openshift # paragraph "OpenShift Support Matrix"
11+
appVersion: "4.16.0" # https://access.redhat.com/support/policy/updates/openshift # paragraph "OpenShift Support Matrix"

charts/console/templates/_helpers.tpl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,34 @@ app.kubernetes.io/name: {{ include "openshift-console.name" . }}
5050
app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252

53+
{{- define "openshift-console.authnKey" -}}
54+
{{- $existing := lookup "v1" "Secret" .Release.Namespace (include "openshift-console.fullname" . ) -}}
55+
{{- $authnKey := default (randAlphaNum 32 | b64enc) .Values.secrets.oidcCookiesEncryption.authnKey -}}
56+
{{- if $existing.data -}}
57+
{{- if $existing.data.authnKey -}}
58+
{{ " " $existing.data.authnKey }}
59+
{{- else -}}
60+
{{- $authnKey | indent 1 }}
61+
{{- end }}
62+
{{- else -}}
63+
{{- $authnKey | indent 1 }}
64+
{{- end }}
65+
{{- end }}
66+
67+
{{- define "openshift-console.encryptKey" -}}
68+
{{- $existing := lookup "v1" "Secret" .Release.Namespace (include "openshift-console.fullname" . ) -}}
69+
{{- $encryptKey := default (randAlphaNum 32 | b64enc) .Values.secrets.oidcCookiesEncryption.encryptKey -}}
70+
{{- if $existing.data -}}
71+
{{- if $existing.data.encryptKey -}}
72+
{{- $existing.data.encryptKey }}
73+
{{- else -}}
74+
{{- $encryptKey | indent 1 }}
75+
{{- end }}
76+
{{- else -}}
77+
{{- $encryptKey | indent 1 }}
78+
{{- end }}
79+
{{- end }}
80+
5381
{{/*
5482
Create the name of the service account to use
5583
*/}}

charts/console/templates/deployment.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ spec:
3434
{{- toYaml .Values.securityContext | nindent 12 }}
3535
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3636
imagePullPolicy: {{ .Values.image.pullPolicy }}
37+
volumeMounts:
38+
- name: oidc-cookie-encryption
39+
mountPath: /etc/bridge/oidc-authnKey
40+
subPath: authnKey
41+
- name: oidc-cookie-encryption
42+
mountPath: /etc/bridge/oidc-encryptKey
43+
subPath: encryptKey
3744
ports:
3845
- name: http
3946
containerPort: {{ .Values.service.port }}
@@ -63,12 +70,18 @@ spec:
6370
- name: BRIDGE_USER_AUTH_OIDC_CLIENT_SECRET
6471
valueFrom:
6572
secretKeyRef:
66-
name: {{ .Values.secret.secretName }}
73+
name: {{ .Values.secrets.idpSecret.secretName }}
6774
key: clientSecret
6875
- name: BRIDGE_USER_AUTH_OIDC_ISSUER_URL
6976
value: {{ .Values.bridgeEnvironmentVariables.BRIDGE_USER_AUTH_OIDC_ISSUER_URL }}
7077
- name: BRIDGE_V
7178
value: {{ .Values.verbosity | quote }}
79+
{{- if eq .Values.bridgeEnvironmentVariables.BRIDGE_USER_AUTH "oidc" }}
80+
- name: BRIDGE_COOKIE_ENCRYPTION_KEY_FILE
81+
value: "/etc/bridge/oidc-encryptKey"
82+
- name: BRIDGE_COOKIE_AUTHENTICATION_KEY_FILE
83+
value: "/etc/bridge/oidc-authnKey"
84+
{{- end }}
7285
{{- with .Values.nodeSelector }}
7386
nodeSelector:
7487
{{- toYaml . | nindent 8 }}
@@ -81,3 +94,10 @@ spec:
8194
tolerations:
8295
{{- toYaml . | nindent 8 }}
8396
{{- end }}
97+
{{- if eq .Values.bridgeEnvironmentVariables.BRIDGE_USER_AUTH "oidc" }}
98+
volumes:
99+
- name: oidc-cookie-encryption
100+
secret:
101+
secretName: {{ .Values.secrets.oidcCookiesEncryption.secretName }}
102+
{{- end }}
103+
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
{{- if .Values.secret.create -}}
1+
{{- if .Values.secrets.idpSecret.create -}}
2+
23
apiVersion: v1
34
kind: Secret
45
metadata:
5-
name: {{ .Values.secret.secretName }}
6+
name: {{ .Values.secrets.idpSecret.secretName }}
67
namespace: default
78
type: Opaque
89
data:
9-
clientSecret: {{ .Values.secret.clientSecret }}
10+
clientSecret: {{ .Values.secrets.idpSecret.clientSecret }}
1011
{{- end }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.secrets.oidcCookiesEncryption.create -}}
2+
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: {{ .Values.secrets.oidcCookiesEncryption.secretName }}
7+
namespace: default
8+
type: Opaque
9+
data:
10+
authnKey: {{- include "openshift-console.authnKey" . }}
11+
encryptKey: {{- include "openshift-console.encryptKey" . }}
12+
{{- end }}

charts/console/values.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ image:
88
repository: quay.io/openshift/origin-console
99
pullPolicy: IfNotPresent
1010
# Overrides the image tag whose default is the chart appVersion.
11-
tag: "4.11.0" # 4.11.0 introduces 'dark mode' by default.
11+
tag: ""
1212

1313
imagePullSecrets: []
1414
nameOverride: ""
@@ -36,10 +36,17 @@ securityContext: {}
3636
# runAsNonRoot: true
3737
# runAsUser: 1000
3838

39-
secret:
40-
secretName: idp-secret
41-
create: true
42-
clientSecret:
39+
secrets:
40+
idpSecret:
41+
secretName: idp-secret
42+
create: true
43+
clientSecret:
44+
oidcCookiesEncryption:
45+
secretName: oidc-cookies-encryption
46+
create: true
47+
# base64 encoded string
48+
# authnKey:
49+
# encryptKey:
4350
oidcIdentityProvider: ""
4451

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

6471
extraEnv: ""
6572
# - name: BRIDGE_INACTIVITY_TIMEOUT

0 commit comments

Comments
 (0)