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

Cleanup and improve Infinispan template #1065

Open
wants to merge 1 commit 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
36 changes: 34 additions & 2 deletions doc/kubernetes/collector/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ helm template --debug ${STARTDIR}/../../../provision/infinispan/ispn-helm \
--set cacheDefaults.crossSiteMode=SYNC \
--set cacheDefaults.stateTransferMode=AUTO \
--set cacheDefaults.xsiteFailurePolicy=FAIL \
--set cacheDefaults.txMode=NON_XA \
--set cacheDefaults.txMode=NON_DURABLE_XA \
--set cacheDefaults.txLockMode=PESSIMISTIC \
--set image= \
--set fd.interval=2000 \
Expand Down Expand Up @@ -126,7 +126,7 @@ helm template --debug ${STARTDIR}/../../../provision/infinispan/ispn-helm \
--set cacheDefaults.crossSiteMode=SYNC \
--set cacheDefaults.stateTransferMode=AUTO \
--set cacheDefaults.xsiteFailurePolicy=FAIL \
--set cacheDefaults.txMode=NON_XA \
--set cacheDefaults.txMode=NON_DURABLE_XA \
--set cacheDefaults.txLockMode=PESSIMISTIC \
--set image= \
--set fd.interval=2000 \
Expand All @@ -137,3 +137,35 @@ helm template --debug ${STARTDIR}/../../../provision/infinispan/ispn-helm \
--set alertmanager.webhook.username=keycloak \
--set alertmanager.webhook.password=changme \
> ${BUILDDIR}/helm/ispn-site-b.yaml

# Infinispan volatile sessions
helm template --debug ${STARTDIR}/../../../provision/infinispan/ispn-helm \
--set namespace=keycloak \
--set replicas=3 \
--set crossdc.enabled=true \
--set crossdc.local.name=site-1 \
--set crossdc.local.gossipRouterEnabled=true \
--set crossdc.remote.name=site-b \
--set crossdc.remote.gossipRouterEnabled=true \
--set crossdc.remote.namespace=keycloak \
--set crossdc.remote.url=openshift://api.site-b \
--set crossdc.remote.secret=xsite-token-secret \
--set crossdc.route.enabled=true \
--set crossdc.route.tls.keystore.secret=xsite-keystore-secret \
--set crossdc.route.tls.truststore.secret=xsite-truststore-secret \
--set metrics.histograms=false \
--set hotrodPassword="strong-password" \
--set cacheDefaults.crossSiteMode=SYNC \
--set cacheDefaults.stateTransferMode=AUTO \
--set cacheDefaults.xsiteFailurePolicy=FAIL \
--set cacheDefaults.txMode=NON_DURABLE_XA \
--set cacheDefaults.txLockMode=PESSIMISTIC \
--set image= \
--set fd.interval=2000 \
--set fd.timeout=10000 \
--set createSessionsCaches=true \
--set acceleratorDNS=a3da6a6cbd4e27b02.awsglobalaccelerator.com \
--set alertmanager.webhook.url=https://tjqr2vgc664b6noj6vugprakoq0oausj.lambda-url.eu-west-1.on.aws/ \
--set alertmanager.webhook.username=keycloak \
--set alertmanager.webhook.password=changme \
> ${BUILDDIR}/helm/ispn-volatile.yaml
32 changes: 18 additions & 14 deletions provision/infinispan/ispn-helm/templates/infinispan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,13 @@ metadata:
name: crossdc-push-state-status
namespace: {{ $namespace }}
data:
batch: |
site push-site-status --cache=actionTokens
site push-site-status --cache=authenticationSessions
site push-site-status --cache=loginFailures
site push-site-status --cache=work
batch: |-
{{- range $cache, $config := .Values.caches -}}
{{- if and (not $.Values.createSessionsCaches) (eq $cache "sessions" "offlineSessions" "clientSessions" "offlineClientSessions") }}
{{- continue}}
{{- end}}
site push-site-status --cache={{ $cache }}
{{- end }}
# end::infinispan-crossdc-push-state-status[]
---
# tag::infinispan-crossdc-reset-push-state-status[]
Expand All @@ -243,11 +245,13 @@ metadata:
name: crossdc-reset-push-state-status
namespace: {{ $namespace }}
data:
batch: |
site clear-push-site-status --cache=actionTokens
site clear-push-site-status --cache=authenticationSessions
site clear-push-site-status --cache=loginFailures
site clear-push-site-status --cache=work
batch: |-
{{- range $cache, $config := .Values.caches -}}
{{- if and (not $.Values.createSessionsCaches) (eq $cache "sessions" "offlineSessions" "clientSessions" "offlineClientSessions") }}
{{- continue}}
{{- end}}
site clear-push-site-status --cache={{ $cache }}
{{- end }}
# end::infinispan-crossdc-reset-push-state-status[]
---
# tag::infinispan-crossdc-clear-caches[]
Expand All @@ -257,12 +261,12 @@ metadata:
name: crossdc-clear-caches
namespace: {{ $namespace }}
data:
batch: |+
{{range $cache, $config := .Values.caches -}}
batch: |-
{{- range $cache, $config := .Values.caches -}}
{{- if and (not $.Values.createSessionsCaches) (eq $cache "sessions" "offlineSessions" "clientSessions" "offlineClientSessions") }}
{{continue}}
{{- continue}}
{{- end}}
clearcache {{ $cache }}
{{ end }}
{{- end }}
# end::infinispan-crossdc-clear-caches[]
{{ end }}
8 changes: 6 additions & 2 deletions provision/infinispan/ispn-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ cacheDefaults:
lockTimeout: 4000
# WARN|FAIL|IGNORE. ASYNC only works with WARN|IGNORE
xsiteFailurePolicy: FAIL
# NONE|NON_XA
txMode: NON_XA
# NONE|NON_XA|NON_DURABLE_XA|FULL_XA
txMode: NON_DURABLE_XA
# OPTIMISTIC|PESSIMISTIC
txLockMode: PESSIMISTIC
caches:
actionTokens: {}
authenticationSessions:
mergePolicy: ALWAYS_REMOVE
indexing:
enabled: true
indexed-entities:
- keycloak.RootAuthenticationSessionEntity
sessions:
mergePolicy: ALWAYS_REMOVE
indexing:
Expand Down