From c89540493d3cc3e93923a1e9e565a0d1290faf9a Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Thu, 8 Aug 2024 09:19:34 +0200 Subject: [PATCH] Adding a multisite feature Signed-off-by: Alexander Schwartz --- .../keycloak-create-deployment/action.yml | 4 ++++ ...osa-cluster-auto-provision-on-schedule.yml | 4 +++- .../rosa-multi-az-cluster-create.yml | 23 ++++++++++++++++--- provision/keycloak-tasks/Utils.yaml | 1 + .../minikube/keycloak/templates/keycloak.yaml | 2 ++ provision/minikube/keycloak/values.yaml | 1 + provision/openshift/Taskfile.yaml | 1 + 7 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/actions/keycloak-create-deployment/action.yml b/.github/actions/keycloak-create-deployment/action.yml index dc43bc18d..fd9ca25b7 100644 --- a/.github/actions/keycloak-create-deployment/action.yml +++ b/.github/actions/keycloak-create-deployment/action.yml @@ -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: @@ -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 }} diff --git a/.github/workflows/rosa-cluster-auto-provision-on-schedule.yml b/.github/workflows/rosa-cluster-auto-provision-on-schedule.yml index 6a85314ea..f78e33210 100644 --- a/.github/workflows/rosa-cluster-auto-provision-on-schedule.yml +++ b/.github/workflows/rosa-cluster-auto-provision-on-schedule.yml @@ -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: @@ -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 diff --git a/.github/workflows/rosa-multi-az-cluster-create.yml b/.github/workflows/rosa-multi-az-cluster-create.yml index 2fad061ea..a373a1f06 100644 --- a/.github/workflows/rosa-multi-az-cluster-create.yml +++ b/.github/workflows/rosa-multi-az-cluster-create.yml @@ -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 @@ -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 @@ -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 diff --git a/provision/keycloak-tasks/Utils.yaml b/provision/keycloak-tasks/Utils.yaml index 763c3e819..8e4838cf5 100644 --- a/provision/keycloak-tasks/Utils.yaml +++ b/provision/keycloak-tasks/Utils.yaml @@ -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: diff --git a/provision/minikube/keycloak/templates/keycloak.yaml b/provision/minikube/keycloak/templates/keycloak.yaml index 9339e178a..b139a1ea5 100644 --- a/provision/minikube/keycloak/templates/keycloak.yaml +++ b/provision/minikube/keycloak/templates/keycloak.yaml @@ -56,7 +56,9 @@ spec: {{ end }} features: enabled: +{{- if .Values.multiSite }} - multi-site # <3> +{{- end }} {{- if .Values.externalInfinispan }} - remote-cache {{- end }} diff --git a/provision/minikube/keycloak/values.yaml b/provision/minikube/keycloak/values.yaml index 937692a19..5d12cffd5 100644 --- a/provision/minikube/keycloak/values.yaml +++ b/provision/minikube/keycloak/values.yaml @@ -42,6 +42,7 @@ jvmDebug: true predefinedAdmin: true persistentSessions: false externalInfinispan: false +multiSite: false infinispan: jgroupsTls: false customConfig: false diff --git a/provision/openshift/Taskfile.yaml b/provision/openshift/Taskfile.yaml index 29a10c92c..9ede1f2ad 100644 --- a/provision/openshift/Taskfile.yaml +++ b/provision/openshift/Taskfile.yaml @@ -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 - >