Skip to content

Commit

Permalink
Separating multisite feature for Minikube, fixing dual stack DNS prob…
Browse files Browse the repository at this point in the history
…lems, fixing GitHub Workflow YAML

Signed-off-by: Alexander Schwartz <[email protected]>
  • Loading branch information
ahus1 committed Aug 8, 2024
1 parent bb6c819 commit bac2b28
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 6 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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<properties>
<keycloak.version>999.0.0-SNAPSHOT</keycloak.version>
<infinispan.version>15.0.4.Final</infinispan.version>
<infinispan.version>15.0.7.Final</infinispan.version>
<junit5.version>5.10.1</junit5.version>
<httpclient.version>4.5.14</httpclient.version>
<maven.enforcer.plugin.version>3.4.1</maven.enforcer.plugin.version>
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 }}

This comment has been minimized.

Copy link
@mhajas

mhajas Aug 12, 2024

Contributor

@ahus1 This looks incorrect that we enable externalInfinispan based on KC_MULTI_SITE. Should this be:

--set multiSite={{ .KC_MULTI_SITE }}

This comment has been minimized.

Copy link
@ahus1

ahus1 Aug 12, 2024

Author Contributor

Thanks, fixed in 4131145

cc: @ryanemerson

This comment has been minimized.

Copy link
@ryanemerson

ryanemerson Aug 12, 2024

Contributor

Here's a link to my WIP branch that has a few fixes like this main...ryanemerson:keycloak-benchmark:testsuite_fixes

Let's wait until the meeting today to discuss before merge anything else, as there's a bigger issue with the current deployment that needs to be fixed before the daily run can run as expected.

--set nodePortsEnabled=false
../minikube/keycloak
- >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def handle_site_offline(labels):

acceleratorDNS = labels['accelerator']
accelerator = jmespath.search(f"Accelerators[?DnsName=='{acceleratorDNS}']", a_client.list_accelerators())
if not accelerator:
accelerator = jmespath.search(f"Accelerators[?DualStackDnsName=='{acceleratorDNS}']", a_client.list_accelerators())
if not accelerator:
print(f"Ignoring SiteOffline alert as accelerator with DnsName '{acceleratorDNS}' not found")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static void waitForTheHealthCheckToBeInState(String healthCheckId, StateV
public static Accelerator getAccelerator(GlobalAcceleratorClient gaClient, String acceleratorDns) {
return gaClient.listAccelerators().accelerators()
.stream()
.filter(a -> acceleratorDns.contains(a.dnsName()))
.filter(a -> acceleratorDns.contains(a.dnsName()) || acceleratorDns.contains(a.dualStackDnsName()))
.findFirst()
.orElseThrow();
}
Expand Down

0 comments on commit bac2b28

Please sign in to comment.