Compare commits

...

15 Commits

Author SHA1 Message Date
wpetit fce733374c Merge pull request 'feat(hydra): mise en place du stockage des session redis sur la stack hydra, et correction logout sur hydra-oidc' (#31) from hydra-redis into develop
Reviewed-on: #31
2023-12-18 11:18:31 +01:00
Matthieu Lamalle 824b8613c4 update doc 2023-12-18 11:15:51 +01:00
Matthieu Lamalle 19910617bd typo 2023-12-18 10:52:54 +01:00
Matthieu Lamalle f4146345d5 Patche du DSN redis 2023-12-18 10:38:13 +01:00
Matthieu Lamalle bbeb1ec62f mise en place d'un component pour Redis 2023-12-18 09:25:30 +01:00
Matthieu Lamalle fcfbb6cc30 correction port mapping de hydra-remote-user 2023-12-15 15:25:02 +01:00
Matthieu Lamalle 7a802a6d28 ajout redis à l'example 2023-12-15 14:44:04 +01:00
Matthieu Lamalle a02622b516 feat(hydra): mise en place du stockage des session redis sur la stack hydra, et correction logout sur hydra-oidc 2023-12-15 10:17:23 +01:00
wpetit 61d9dade3b Merge pull request 'feat(hydra-dispatcher): maj ref image hydra-dispatcher pour ajout url_link env var' (#29) from hydra-dispatcher-link-url into develop
Reviewed-on: #29
2023-12-13 10:41:44 +01:00
Matthieu Lamalle e333d07c14 feat(hydra-dispatcher): maj ref image hydra-dispatcher pour ajout url_link env var 2023-12-13 10:41:44 +01:00
wpetit 06f58a061d Merge pull request 'Issue-16 : update dev image ref' (#27) from issue-16 into develop
Reviewed-on: #27
2023-12-13 09:38:05 +01:00
Matthieu Lamalle dd6804aa11 feat(shibboleth-sp): update dev ref image 2023-12-13 09:38:05 +01:00
Matthieu Lamalle c7b937adaf feat(hydra-sql): update env vars 2023-12-13 09:38:05 +01:00
Matthieu Lamalle 77eb73818f feat(hydra-remote-user): update dev image ref 2023-12-13 09:38:05 +01:00
Matthieu Lamalle cc3d07d654 feat(hydra-sql): update hydra-sql dev image ref 2023-12-13 09:38:05 +01:00
18 changed files with 90 additions and 16 deletions

View File

@ -5,6 +5,10 @@ resources:
- ./resources/hydra-oidc-deployment.yaml
- ./resources/hydra-oidc-service.yaml
generatorOptions:
labels:
com.cadoles.forge.sso-kustom/session: redis
configMapGenerator:
- name: hydra-oidc-env
literals:
@ -26,6 +30,7 @@ configMapGenerator:
- CLIENT_SECRET_FC=MyClientSecret
- COOKIE_PATH=/
- TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR
- REDIS_DSN="redis://redis:6379"
# - name: hydra-dispatcher-apps
# behavior: merge
# files:
@ -35,5 +40,5 @@ patchesJson6902:
- target:
version: v1
kind: ConfigMap
name: hydra-dispatcher-env
path: patches/hydra-dispatcher-env.yaml
name: hydra-oidc-env
path: patches/hydra-oidc-env.yaml

View File

@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: hydra-oidc-php-fpm
image: reg.cadoles.com/cadoles/hydra-oidc-base:2023.11.17-develop.1657.761e035
image: reg.cadoles.com/cadoles/hydra-oidc-base:2023.12.15-develop.1012.d57f2ad
imagePullPolicy: Always
args: ["/usr/sbin/php-fpm81", "-F", "-e"]
readinessProbe:
@ -47,7 +47,7 @@ spec:
name: hydra-oidc-env
resources: {}
- image: reg.cadoles.com/cadoles/hydra-oidc-base:2023.11.17-develop.1657.761e035
- image: reg.cadoles.com/cadoles/hydra-oidc-base:2023.12.15-develop.1012.d57f2ad
imagePullPolicy: Always
name: hydra-oidc-nginx
args: ["/usr/sbin/nginx"]

View File

@ -18,12 +18,12 @@ spec:
spec:
containers:
- name: hydra-saml-remote-user
image: reg.cadoles.com/cadoles/hydra-remote-user-v1:v0.0.0-233-g64fcacc
image: reg.cadoles.com/cadoles/hydra-remote-user-base:2023.12.11-develop.1523.5f14595
envFrom:
- configMapRef:
name: hydra-saml-env
ports:
- containerPort: 80
- containerPort: 8080
resources: {}
restartPolicy: Always
---
@ -37,6 +37,7 @@ spec:
ports:
- name: http
port: 80
targetPort: 8080
selector:
io.kompose.service: hydra-saml-remote-user
status:

View File

@ -20,7 +20,7 @@ spec:
fsGroup: 102
containers:
- name: hydra-saml-shibboleth-sp
image: reg.cadoles.com/cadoles/shibboleth-sp-v3:v0.0.0-233-g64fcacc
image: reg.cadoles.com/cadoles/shibboleth-sp-v3:2023.12.12-develop.1039.49b85e1
envFrom:
- configMapRef:
name: hydra-saml-env

View File

@ -5,6 +5,10 @@ resources:
- ./resources/hydra-sql-service.yaml
- ./resources/hydra-sql-deployment.yaml
generatorOptions:
labels:
com.cadoles.forge.sso-kustom/session: redis
configMapGenerator:
- name: hydra-sql-env
literals:
@ -17,6 +21,7 @@ configMapGenerator:
- DSN_REMOTE_DATABASE="pgsql:host='postgres';port=5432;dbname=lasql"
- DB_USER="makeMeASecret"
- DB_PASSWORD="makeMeASecret"
- REDIS_DSN="redis://redis:6379"
- PEPPER="MakeMeABigSecret"
- name: sql-login-config
files:

View File

@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: hydra-sql-fpm
image: reg.cadoles.com/cadoles/hydra-sql-base:0.0.1
image: reg.cadoles.com/cadoles/hydra-sql-base:2023.12.14-develop.1107.740a756
imagePullPolicy: Always
args: ["/usr/sbin/php-fpm81", "-F", "-e"]
readinessProbe:
@ -54,7 +54,7 @@ spec:
subPath: "sql_login.yaml"
- name: hydra-sql-nginx
image: reg.cadoles.com/cadoles/hydra-sql-base:0.0.1
image: reg.cadoles.com/cadoles/hydra-sql-base:2023.12.14-develop.1107.740a756
imagePullPolicy: Always
args: ["/usr/sbin/nginx"]
readinessProbe:

View File

@ -0,0 +1,22 @@
# 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
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.
### Personnalisation
Via des `patches` sur la ressource `ConfigMap` via un label selector `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`

View File

@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
resources:
- ./resources/redis-failover.yaml
patches:
- path: ./patches/hydra-apps.yaml
target:
kind: ConfigMap
labelSelector: "com.cadoles.forge.sso-kustom/session=redis"

View File

@ -0,0 +1,3 @@
- op: replace
path: "/data/REDIS_DSN"
value: "redis://rfs-sso-redis:26379?&redis_sentinel=mymaster"

View File

@ -0,0 +1,21 @@
apiVersion: databases.spotahome.com/v1
kind: RedisFailover
metadata:
name: sso-redis
spec:
sentinel:
replicas: 3
resources:
requests:
cpu: 100m
limits:
memory: 100Mi
redis:
replicas: 3
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 400m
memory: 500Mi

View File

@ -1 +0,0 @@
# Documentation

View File

@ -15,7 +15,7 @@ L'exemple est actuellement déployé avec le composant `hydra-saml` uniquement.
2. Déployer les opérateurs nécessaires au déploiement
```
kubectl kustomize --enable-helm ./examples/k8s/kind/cluster | kubectl apply -f -
kubectl apply -k ./examples/k8s/kind/cluster --server-side
```
3. Déployer l'application

View File

@ -3,6 +3,7 @@ kind: Kustomization
resources:
- https://github.com/jetstack/cert-manager/releases/download/v1.13.2/cert-manager.yaml
- https://forge.cadoles.com/CadolesKube/c-kustom//base/cloudnative-pg-operator?ref=develop
- https://forge.cadoles.com/CadolesKube/c-kustom//base/redis?ref=develop
- https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
patchesJson6902:
@ -11,4 +12,4 @@ patchesJson6902:
kind: ConfigMap
name: ingress-nginx-controller
namespace: ingress-nginx
path: patches/nginx-controller.yaml
path: patches/nginx-controller.yaml

View File

@ -14,4 +14,5 @@ components:
- ../../components/hydra-oidc
- ../../components/hydra-saml
- ../../components/hydra-sql
- ../../components/oidc-test
- ../../components/oidc-test
- ../../components/redis

View File

@ -14,4 +14,4 @@ hydra:
api_method: "%env(string:HYDRA_DISPATCHER_WEBHOOK_API_METHOD)%"
firewall:
additional_properties: "%env(bool:HYDRA_DISPATCHER_FIREWALL_ADDITIONAL_PROPERTIES)%"
rules: {}
rules: {}

View File

@ -5,6 +5,10 @@ resources:
- ./resources/hydra-dispatcher-deployment.yaml
- ./resources/hydra-dispatcher-service.yaml
generatorOptions:
labels:
com.cadoles.forge.sso-kustom/session: redis
configMapGenerator:
- name: hydra-dispatcher-env
literals:
@ -21,6 +25,7 @@ configMapGenerator:
- COOKIE_PATH=/
- DEFAULT_LOCALE=fr
- APP_LOCALES=fr,en
- REDIS_DSN="redis://redis:6379"
- name: hydra-dispatcher-apps
files:
- apps.yaml=./files/hydra/default.yaml

View File

@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: hydra-dispatcher-php-fpm
image: reg.cadoles.com/cadoles/hydra-dispatcher-base:2023.11.17-develop.1408.ad93359
image: reg.cadoles.com/cadoles/hydra-dispatcher-base:2023.12.15-develop.903.b675347
args: ["/usr/sbin/php-fpm81", "-F", "-e"]
readinessProbe:
exec:
@ -49,7 +49,7 @@ spec:
name: hydra-dispatcher-apps
resources: {}
- image: reg.cadoles.com/cadoles/hydra-dispatcher-base:2023.11.17-develop.1408.ad93359
- image: reg.cadoles.com/cadoles/hydra-dispatcher-base:2023.12.15-develop.903.b675347
imagePullPolicy: Always
name: hydra-dispatcher-nginx
args: ["/usr/sbin/nginx"]