Skip to content

Commit

Permalink
Adding a multisite feature
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
  • Loading branch information
ahus1 committed Aug 8, 2024
1 parent d29de69 commit c895404
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/actions/keycloak-create-deployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ inputs:
enableExternalInfinispanFeature:
description: 'To enable the external Infinispan feature. It disables the embedded caches and only uses the remote caches.'
default: 'false'
enableMultiSiteFeature:
description: 'To enable the external Infinispan feature. It disables the embedded caches and only uses the remote caches.'
default: 'false'
image:
description: 'Keycloak Image'
podMemoryRequests:
Expand Down Expand Up @@ -57,6 +60,7 @@ runs:
KC_DISABLE_STICKY_SESSION: ${{ inputs.disableStickySessions }}
KC_KC25_MODE: ${{ inputs.enableKc25Mode }}
KC_EXTERNAL_INFINISPAN: ${{ inputs.enableExternalInfinispanFeature }}
KC_MULTI_SITE: ${{ inputs.enableMultiSiteFeature }}
KC_CONTAINER_IMAGE: ${{ inputs.image }}
KC_MEMORY_REQUESTS_MB: ${{ inputs.podMemoryRequests }}
KC_MEMORY_LIMITS_MB: ${{ inputs.podMemoryLimit }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
clusterPrefix: gh-keycloak # ${{ env.CLUSTER_PREFIX }} -- unfortunately 'env.' doesn't work here
activeActive: true
enableExternalInfinispanFeature: true
enableMultiSiteFeature: true
secrets: inherit

run-functional-tests-active-active-with-external-infinispan:
Expand Down Expand Up @@ -56,8 +57,9 @@ jobs:
uses: ./.github/workflows/rosa-multi-az-cluster-create.yml
with:
clusterPrefix: gh-keycloak # ${{ env.CLUSTER_PREFIX }} -- unfortunately 'env.' doesn't work here
enablePersistentSessions: true
enablePersistentSessionsFeature: true
enableExternalInfinispanFeature: true
enableMultiSiteFeature: true
createCluster: false
activeActive: true
secrets: inherit
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/rosa-multi-az-cluster-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ on:
description: 'When true deploy an Active/Active Keycloak deployment'
type: boolean
default: false
enablePersistentSessions:
enableKc25Mode:
description: 'Set to true when version older than 26 is deployed'
type: boolean
default: false
enablePersistentSessionsFeature:
description: 'To enable Persistent user and client sessions to the DB'
type: boolean
default: false
enableExternalInfinispanFeature:
description: 'To enable the external Infinispan feature. It disables the embedded caches and only uses the remote caches.'
type: boolean
default: false
default: true
enableMultiSiteFeature:
description: 'To enable the Multi Site Feature'
type: boolean
default: true
keycloakBranch:
description: 'The branch to deploy Keycloak from. If not set nightly image is used'
type: string
Expand All @@ -54,10 +62,18 @@ on:
description: 'Set to true when version older than 26 is deployed'
type: boolean
default: false
enablePersistentSessionsFeature:
description: 'To enable Persistent user and client sessions to the DB'
type: boolean
default: false
enableExternalInfinispanFeature:
description: 'To enable the external Infinispan feature. It disables the embedded caches and only uses the remote caches.'
type: boolean
default: false
default: true
enableMultiSiteFeature:
description: 'To enable the Multi Site Feature'
type: boolean
default: true
keycloakBranch:
description: 'The branch to deploy Keycloak from. If not set nightly image is used'
type: string
Expand All @@ -67,6 +83,7 @@ env:
REGION: ${{ inputs.region || vars.AWS_DEFAULT_REGION }}
KC_KC25_MODE: ${{ inputs.enableKc25Mode }}
KC_EXTERNAL_INFINISPAN: ${{ inputs.enableExternalInfinispanFeature }}
KC_MULTI_SITE: ${{ inputs.enableMultiSiteFeature }}

jobs:
# Workaround required for passing env variables to reusable workflow declarations as ${{ env.* }} is not available
Expand Down
1 change: 1 addition & 0 deletions provision/keycloak-tasks/Utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ tasks:
--set keycloakAdminPassword="{{.KC_ADMIN_PASSWORD}}"
--set disableIngressStickySession={{ .KC_DISABLE_STICKY_SESSION }}
--set externalInfinispan={{ .KC_EXTERNAL_INFINISPAN }}
--set multiSite={{ .KC_MULTI_SITE }}
--set nodePortsEnabled=false
../minikube/keycloak
preconditions:
Expand Down
2 changes: 2 additions & 0 deletions provision/minikube/keycloak/templates/keycloak.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ spec:
{{ end }}
features:
enabled:
{{- if .Values.multiSite }}
- multi-site # <3>
{{- end }}
{{- if .Values.externalInfinispan }}
- remote-cache
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions provision/minikube/keycloak/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jvmDebug: true
predefinedAdmin: true
persistentSessions: false
externalInfinispan: false
multiSite: false
infinispan:
jgroupsTls: false
customConfig: false
Expand Down
1 change: 1 addition & 0 deletions provision/openshift/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ tasks:
--set keycloakAdminPassword="{{.KC_ADMIN_PASSWORD}}"
--set disableIngressStickySession={{ .KC_DISABLE_STICKY_SESSION }}
--set externalInfinispan={{ .KC_EXTERNAL_INFINISPAN }}
--set externalInfinispan={{ .KC_MULTI_SITE }}
--set nodePortsEnabled=false
../minikube/keycloak
- >
Expand Down

0 comments on commit c895404

Please sign in to comment.