Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of Red Hat Build of Keycloak #202

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,16 @@ jobs:
# wait for a while to be sure CRDs are installed
sleep 1
kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.25.0/olm.yaml
kubectl create --kustomize keycloak/operator/overlay/kind
oc create namespace keycloak-system --dry-run=client -o yaml | oc apply -f-
Copy link
Member

Choose a reason for hiding this comment

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

Just curious - what is the benefit of --dry-run and then piping it through oc apply?

helm upgrade -i -n keycloak-system charts/keycloak-operator -f kind/values/values-keycloak-operator.yaml
until [ ! -z "$(kubectl get pod -l name=keycloak-operator -n keycloak-system 2>/dev/null)" ]
do
echo "Waiting for keycloak operator. Pods in keycloak-system namespace:"
kubectl get pods -n keycloak-system
sleep 10
done
kubectl create --kustomize keycloak/resources/overlay/kind
until [[ $( oc get keycloak keycloak -o jsonpath='{.status.ready}' -n keycloak-system 2>/dev/null) == "true" ]]
helm upgrade -i -n keycloak-system charts/keycloak -f kind/values/values-keycloak.yaml
until [[ $( oc get keycloak keycloak -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' -n keycloak-system 2>/dev/null) == "True" ]]
do
printf "Waiting for keycloak deployment. \n Keycloak ready: %s\n" $(oc get keycloak keycloak -o jsonpath='{.status.ready}' -n keycloak-system)
sleep 10
Expand Down
23 changes: 23 additions & 0 deletions charts/keycloak-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
27 changes: 27 additions & 0 deletions charts/keycloak-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
annotations:
artifacthub.io/category: integration-delivery
artifacthub.io/license: Apache-2.0
artifacthub.io/links: |
- name: support
url: https://github.com/securesign/sigstore-ocp/issues
- name: Chart Source
url: https://github.com/securesign/sigstore-ocp
- name: Default Image Source
url: ""
charts.openshift.io/name: KeycloakOperator
charts.openshift.io/provider: TrustedArtifactSigner
charts.openshift.io/supportURL: https://github.com/securesign/sigstore-ocp/issues
apiVersion: v2
name: keycloak-operator
description: A Helm chart for deploying the Keycloak Operator Using the Operator Lifecycle Manager (OLM)
type: application
keywords:
- operator
- keycloak
kubeVersion: ">= 1.19.0-0"
maintainers:
- name: TrustedArtifactSigner
url: ""
sources:
- https://github.com/securesign/sigstore-ocp
version: 0.1.0
59 changes: 59 additions & 0 deletions charts/keycloak-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "keycloak-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "keycloak-operator.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create the chart namespace.
*/}}
{{- define "keycloak-operator.namespace" -}}
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "keycloak-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "keycloak-operator.labels" -}}
helm.sh/chart: {{ include "keycloak-operator.chart" . }}
{{ include "keycloak-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "keycloak-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "keycloak-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/keycloak-operator/templates/operatorgroup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.operatorgroup.create }}
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: {{ include "keycloak-operator.fullname" . }}
generateName: {{ include "keycloak-operator.fullname" . }}-
namespace: {{ include "keycloak-operator.namespace" . }}
labels:
{{- include "keycloak-operator.labels" . | nindent 4 }}
{{- if .Values.operatorgroup.annotations }}
annotations:
{{- tpl (toYaml .Values.operatorgroup.annotations) $ | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.operatorgroup.allNamespaces }}
targetNamespaces:
{{ tpl (toYaml (list (include "keycloak-operator.namespace" .))) $ }}
{{- end }}
upgradeStrategy: {{ tpl .Values.operatorgroup.upgradeStrategy $ }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/keycloak-operator/templates/subscription.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: {{ include "keycloak-operator.fullname" . }}
namespace: {{ default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }}
labels:
{{- include "keycloak-operator.labels" . | nindent 4 }}
{{- if .Values.subscription.annotations }}
annotations:
{{- tpl (toYaml .Values.subscription.annotations) $ | nindent 4 }}
{{- end }}
spec:
channel: {{ required "Operator channel is required!" .Values.subscription.channel }}
installPlanApproval: {{ default "Automatic" .Values.subscription.installPlanApproval }}
name: {{ required "Operator name is required!" .Values.subscription.name }}
source: {{ required "Operator source is required!" .Values.subscription.source }}
sourceNamespace: {{ required "Operator source namespace is required!" .Values.subscription.sourceNamespace }}
{{- if .Values.subscription.config }}
config:
{{- tpl (toYaml .Values.subscription.config) $ | nindent 4 }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/keycloak-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

subscription:
channel: "stable-v22"
installPlanApproval: Automatic
name: "rhbk-operator"
source: "redhat-operators"
sourceNamespace: "openshift-marketplace"
config: {}

operatorgroup:
create: true
allNamespaces: false
upgradeStrategy: Default

namespaceOverride: ""
23 changes: 23 additions & 0 deletions charts/keycloak/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
28 changes: 28 additions & 0 deletions charts/keycloak/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
annotations:
artifacthub.io/category: integration-delivery
artifacthub.io/license: Apache-2.0
artifacthub.io/links: |
- name: support
url: https://github.com/securesign/sigstore-ocp/issues
- name: Chart Source
url: https://github.com/securesign/sigstore-ocp
- name: Default Image Source
url: ""
charts.openshift.io/name: Keycloak
charts.openshift.io/provider: TrustedArtifactSigner
charts.openshift.io/supportURL: https://github.com/securesign/sigstore-ocp/issues
apiVersion: v2
name: keycloak
description: A Helm chart for deploying the Keycloak
type: application
keywords:
- sso
- keycloak
- identity
kubeVersion: ">= 1.19.0-0"
maintainers:
- name: TrustedArtifactSigner
url: ""
sources:
- https://github.com/securesign/sigstore-ocp
version: 0.1.0
5 changes: 5 additions & 0 deletions charts/keycloak/ci/ct-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

keycloak:
ingress:
host: foo
Loading
Loading