feat(hydra): mise en place du stockage des session redis sur la stack hydra, et correction logout sur hydra-oidc #31
@ -5,6 +5,10 @@ resources:
|
|||||||
- ./resources/hydra-oidc-deployment.yaml
|
- ./resources/hydra-oidc-deployment.yaml
|
||||||
- ./resources/hydra-oidc-service.yaml
|
- ./resources/hydra-oidc-service.yaml
|
||||||
|
|
||||||
|
generatorOptions:
|
||||||
|
labels:
|
||||||
|
com.cadoles.forge.sso-kustom/session: redis
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: hydra-oidc-env
|
- name: hydra-oidc-env
|
||||||
literals:
|
literals:
|
||||||
|
@ -5,6 +5,10 @@ resources:
|
|||||||
- ./resources/hydra-sql-service.yaml
|
- ./resources/hydra-sql-service.yaml
|
||||||
- ./resources/hydra-sql-deployment.yaml
|
- ./resources/hydra-sql-deployment.yaml
|
||||||
|
|
||||||
|
generatorOptions:
|
||||||
|
labels:
|
||||||
|
com.cadoles.forge.sso-kustom/session: redis
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: hydra-sql-env
|
- name: hydra-sql-env
|
||||||
literals:
|
literals:
|
||||||
|
23
components/redis/README.md
Normal file
23
components/redis/README.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Composant `redis`
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
Les applications `hydra-dispatcher`, `hydra-sql` et `hydra-oidc` stockent dorénavant le cache et les sessions utilisateur sur un serveur Redis.
|
||||||
|
Le DSN du serveur est défini dans leur variable d'environnement respective `REDIS_DSN`.
|
||||||
|
Les applications peuvent utiliser le mode `sentinel`` de redis
|
||||||
wpetit marked this conversation as resolved
Outdated
|
|||||||
|
Il est donc nécessaire donc nécessaire de disposer d'un serveur Redis pour utiliser ces applications.
|
||||||
|
|
||||||
|
### Principe général de fonctionnement
|
||||||
|
|
||||||
|
Un `RedisFailOver` crée un cluster redis en mode sentinel avec 3 réplicats chacun.
|
||||||
|
Un patche viens mettre à jour la variable d'environnement `REDIS_DSN` dans les ConfigMap sur toutes les resources `hydra-*`.
|
||||||
wpetit marked this conversation as resolved
Outdated
wpetit
commented
Typo: patch Typo: patch~~e~~
|
|||||||
|
|
||||||
|
|
||||||
|
### Personnalisation
|
||||||
|
|
||||||
|
Via des `patches` sur la ressource `ConfigMap` via un label selecto `com.cadoles.forge.sso-kustom/session=redis` il est possible de modifier la valeur du `REDIS_DSN`.
|
||||||
|
|
||||||
|
|
||||||
|
|Clé|Description|Exemple|
|
||||||
|
|---|-----------|-------|
|
||||||
|
|`REDIS_DSN`| DSN du cluster Redis | `redis://rfs-sso-redis:26379?&redis_sentinel=mymaster`
|
@ -4,3 +4,8 @@ kind: Component
|
|||||||
resources:
|
resources:
|
||||||
- ./resources/redis-failover.yaml
|
- ./resources/redis-failover.yaml
|
||||||
|
|
||||||
|
patches:
|
||||||
|
- path: ./patches/hydra-apps.yaml
|
||||||
|
target:
|
||||||
|
kind: ConfigMap
|
||||||
|
labelSelector: "com.cadoles.forge.sso-kustom/session=redis"
|
||||||
|
3
components/redis/patches/hydra-apps.yaml
Normal file
3
components/redis/patches/hydra-apps.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
- op: replace
|
||||||
|
path: "/data/REDIS_DSN"
|
||||||
|
value: "redis://rfs-sso-redis:26379?&redis_sentinel=mymaster"
|
@ -1,8 +0,0 @@
|
|||||||
# Documentation
|
|
||||||
|
|
||||||
### Redis
|
|
||||||
|
|
||||||
Les applications `hydra-dispatcher`, `hydra-sql` et `hydra-oidc` stockent dorénavant le cache et les sessions utilisateur sur un serveur Redis.
|
|
||||||
Le DSN du serveur est défini dans leur variable d'environnement respective `REDIS_DSN`.
|
|
||||||
Les applications peuvent utiliser le mode `sentinel`` de redis
|
|
||||||
Il est donc nécessaire donc nécessaire de disposer d'un serveur Redis pour utiliser ces applications.
|
|
@ -5,6 +5,10 @@ resources:
|
|||||||
- ./resources/hydra-dispatcher-deployment.yaml
|
- ./resources/hydra-dispatcher-deployment.yaml
|
||||||
- ./resources/hydra-dispatcher-service.yaml
|
- ./resources/hydra-dispatcher-service.yaml
|
||||||
|
|
||||||
|
generatorOptions:
|
||||||
|
labels:
|
||||||
|
com.cadoles.forge.sso-kustom/session: redis
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: hydra-dispatcher-env
|
- name: hydra-dispatcher-env
|
||||||
literals:
|
literals:
|
||||||
@ -21,7 +25,7 @@ configMapGenerator:
|
|||||||
- COOKIE_PATH=/
|
- COOKIE_PATH=/
|
||||||
- DEFAULT_LOCALE=fr
|
- DEFAULT_LOCALE=fr
|
||||||
- APP_LOCALES=fr,en
|
- APP_LOCALES=fr,en
|
||||||
- REDIS_DSN="redis://rfs-sso-redis:26379?&redis_sentinel=mymaster"
|
- REDIS_DSN="redis://redis:6379"
|
||||||
- name: hydra-dispatcher-apps
|
- name: hydra-dispatcher-apps
|
||||||
files:
|
files:
|
||||||
- apps.yaml=./files/hydra/default.yaml
|
- apps.yaml=./files/hydra/default.yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user
Petite typo ici