Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit 12e2709

Browse files
committed
Introduction of Red Hat Build of Keycloak
Signed-off-by: Andrew Block <andy.block@gmail.com>
1 parent 3d7a4ef commit 12e2709

30 files changed

+1067
-33
lines changed

charts/keycloak-operator/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/keycloak-operator/Chart.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
annotations:
2+
artifacthub.io/category: integration-delivery
3+
artifacthub.io/license: Apache-2.0
4+
artifacthub.io/links: |
5+
- name: support
6+
url: https://github.com/securesign/sigstore-ocp/issues
7+
- name: Chart Source
8+
url: https://github.com/securesign/sigstore-ocp
9+
- name: Default Image Source
10+
url: ""
11+
charts.openshift.io/name: KeycloakOperator
12+
charts.openshift.io/provider: TrustedArtifactSigner
13+
charts.openshift.io/supportURL: https://github.com/securesign/sigstore-ocp/issues
14+
apiVersion: v2
15+
name: keycloak-operator
16+
description: A Helm chart for deploying the Keycloak Operator Using the Operator Lifecycle Manager (OLM)
17+
type: application
18+
keywords:
19+
- operator
20+
- keycloak
21+
kubeVersion: ">= 1.19.0-0"
22+
maintainers:
23+
- name: TrustedArtifactSigner
24+
url: ""
25+
sources:
26+
- https://github.com/securesign/sigstore-ocp
27+
version: 0.1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "keycloak-operator.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "keycloak-operator.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create the chart namespace.
28+
*/}}
29+
{{- define "keycloak-operator.namespace" -}}
30+
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
31+
{{- end -}}
32+
33+
34+
{{/*
35+
Create chart name and version as used by the chart label.
36+
*/}}
37+
{{- define "keycloak-operator.chart" -}}
38+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
39+
{{- end }}
40+
41+
{{/*
42+
Common labels
43+
*/}}
44+
{{- define "keycloak-operator.labels" -}}
45+
helm.sh/chart: {{ include "keycloak-operator.chart" . }}
46+
{{ include "keycloak-operator.selectorLabels" . }}
47+
{{- if .Chart.AppVersion }}
48+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
49+
{{- end }}
50+
app.kubernetes.io/managed-by: {{ .Release.Service }}
51+
{{- end }}
52+
53+
{{/*
54+
Selector labels
55+
*/}}
56+
{{- define "keycloak-operator.selectorLabels" -}}
57+
app.kubernetes.io/name: {{ include "keycloak-operator.name" . }}
58+
app.kubernetes.io/instance: {{ .Release.Name }}
59+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- if .Values.operatorgroup.create }}
2+
apiVersion: operators.coreos.com/v1
3+
kind: OperatorGroup
4+
metadata:
5+
name: {{ include "keycloak-operator.fullname" . }}
6+
generateName: {{ include "keycloak-operator.fullname" . }}-
7+
namespace: {{ include "keycloak-operator.namespace" . }}
8+
labels:
9+
{{- include "keycloak-operator.labels" . | nindent 4 }}
10+
{{- if .Values.operatorgroup.annotations }}
11+
annotations:
12+
{{- tpl (toYaml .Values.operatorgroup.annotations) $ | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- if not .Values.operatorgroup.allNamespaces }}
16+
targetNamespaces:
17+
{{ tpl (toYaml (list (include "keycloak-operator.namespace" .))) $ }}
18+
{{- end }}
19+
upgradeStrategy: {{ tpl .Values.operatorgroup.upgradeStrategy $ }}
20+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: operators.coreos.com/v1alpha1
2+
kind: Subscription
3+
metadata:
4+
name: {{ include "keycloak-operator.fullname" . }}
5+
namespace: {{ default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }}
6+
labels:
7+
{{- include "keycloak-operator.labels" . | nindent 4 }}
8+
{{- if .Values.subscription.annotations }}
9+
annotations:
10+
{{- tpl (toYaml .Values.subscription.annotations) $ | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
channel: {{ required "Operator channel is required!" .Values.subscription.channel }}
14+
installPlanApproval: {{ default "Automatic" .Values.subscription.installPlanApproval }}
15+
name: {{ required "Operator name is required!" .Values.subscription.name }}
16+
source: {{ required "Operator source is required!" .Values.subscription.source }}
17+
sourceNamespace: {{ required "Operator source namespace is required!" .Values.subscription.sourceNamespace }}
18+
{{- if .Values.subscription.config }}
19+
config:
20+
{{- tpl (toYaml .Values.subscription.config) $ | nindent 4 }}
21+
{{- end }}

charts/keycloak-operator/values.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
3+
subscription:
4+
channel: "stable-v22"
5+
installPlanApproval: Automatic
6+
name: "rhbk-operator"
7+
source: "redhat-operators"
8+
sourceNamespace: "openshift-marketplace"
9+
config: {}
10+
11+
operatorgroup:
12+
create: true
13+
allNamespaces: false
14+
upgradeStrategy: Default
15+
16+
namespaceOverride: ""

charts/keycloak/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/keycloak/Chart.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
annotations:
2+
artifacthub.io/category: integration-delivery
3+
artifacthub.io/license: Apache-2.0
4+
artifacthub.io/links: |
5+
- name: support
6+
url: https://github.com/securesign/sigstore-ocp/issues
7+
- name: Chart Source
8+
url: https://github.com/securesign/sigstore-ocp
9+
- name: Default Image Source
10+
url: ""
11+
charts.openshift.io/name: Keycloak
12+
charts.openshift.io/provider: TrustedArtifactSigner
13+
charts.openshift.io/supportURL: https://github.com/securesign/sigstore-ocp/issues
14+
apiVersion: v2
15+
name: keycloak
16+
description: A Helm chart for deploying the Keycloak
17+
type: application
18+
keywords:
19+
- sso
20+
- keycloak
21+
- identity
22+
kubeVersion: ">= 1.19.0-0"
23+
maintainers:
24+
- name: TrustedArtifactSigner
25+
url: ""
26+
sources:
27+
- https://github.com/securesign/sigstore-ocp
28+
version: 0.1.0
+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "keycloak.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "keycloak.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create the chart namespace.
28+
*/}}
29+
{{- define "keycloak.namespace" -}}
30+
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
31+
{{- end -}}
32+
33+
34+
{{/*
35+
Create chart name and version as used by the chart label.
36+
*/}}
37+
{{- define "keycloak.chart" -}}
38+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
39+
{{- end }}
40+
41+
{{/*
42+
Common labels
43+
*/}}
44+
{{- define "keycloak.labels" -}}
45+
helm.sh/chart: {{ include "keycloak.chart" . }}
46+
{{ include "keycloak.selectorLabels" . }}
47+
{{- if .Chart.AppVersion }}
48+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
49+
{{- end }}
50+
app.kubernetes.io/managed-by: {{ .Release.Service }}
51+
{{- end }}
52+
53+
{{/*
54+
Common PostgreSQL labels
55+
*/}}
56+
{{- define "keycloak.postgresql.labels" -}}
57+
helm.sh/chart: {{ include "keycloak.chart" . }}
58+
{{ include "keycloak.postgresql.selectorLabels" . }}
59+
{{- if .Chart.AppVersion }}
60+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
61+
{{- end }}
62+
app.kubernetes.io/managed-by: {{ .Release.Service }}
63+
{{- end }}
64+
65+
{{/*
66+
Selector labels
67+
*/}}
68+
{{- define "keycloak.selectorLabels" -}}
69+
app.kubernetes.io/name: {{ include "keycloak.name" . }}
70+
app.kubernetes.io/instance: {{ .Release.Name }}
71+
{{- end }}
72+
73+
{{/*
74+
Selector labels
75+
*/}}
76+
{{- define "keycloak.postgresql.selectorLabels" -}}
77+
app.kubernetes.io/name: {{ include "keycloak.postgresql.name" . }}
78+
app.kubernetes.io/instance: {{ .Release.Name }}
79+
{{- end }}
80+
81+
{{/*
82+
Create the name of the service account to use
83+
*/}}
84+
{{- define "keycloak.serviceAccountName" -}}
85+
{{- if .serviceAccount.create }}
86+
{{- default .name .serviceAccount.name }}
87+
{{- else }}
88+
{{- default "default" .serviceAccount.name }}
89+
{{- end }}
90+
{{- end }}
91+
92+
{{/*
93+
Create the image path for the passed in image field
94+
*/}}
95+
{{- define "keycloak.image" -}}
96+
{{- if eq (substr 0 7 .version) "sha256:" -}}
97+
{{- printf "%s/%s@%s" .registry .repository .version -}}
98+
{{- else -}}
99+
{{- printf "%s/%s:%s" .registry .repository .version -}}
100+
{{- end -}}
101+
{{- end -}}
102+
103+
{{/*
104+
Name of the PostgreSQL instance
105+
*/}}
106+
{{- define "keycloak.postgresql.name" -}}
107+
{{- (printf "%s-%s" (include "keycloak.name" $) "postgresql") | trunc 63 | trimSuffix "-" -}}
108+
{{- end }}
109+
110+
{{/*
111+
Full Name of the PostgreSQL instance
112+
*/}}
113+
{{- define "keycloak.postgresql.fullname" -}}
114+
{{- (printf "%s-%s" (include "keycloak.fullname" $) "postgresql") | trunc 63 | trimSuffix "-" -}}
115+
{{- end }}
116+
117+
{{/*
118+
Name of the PostgreSQL Secret
119+
*/}}
120+
{{- define "keycloak.postgresql.secret.name" -}}
121+
{{ default (include "keycloak.postgresql.fullname" .) (.Values.postgresql.secret.existingSecret) }}
122+
{{- end }}
123+
124+
{{/*
125+
Name of the Keycloak Service
126+
*/}}
127+
{{- define "keycloak.service.name" -}}
128+
{{ .Values.openshift | ternary (printf "%s-trusted" (include "keycloak.fullname" .)) (include "keycloak.fullname" .) }}
129+
{{- end }}
130+
131+
{{/*
132+
Name of the TLS Secret
133+
*/}}
134+
{{- define "keycloak.tls.secret.name" -}}
135+
{{- $defaultTls := printf "%s-tls" (include "keycloak.fullname" .) }}
136+
{{- if .Values.openshift -}}
137+
{{- default $defaultTls .Values.keycloak.tls.secret -}}
138+
{{- else -}}
139+
{{ len .Values.keycloak.tls.secret }}
140+
{{- end }}
141+
{{- end }}

0 commit comments

Comments
 (0)