Compare commits

..

51 Commits

Author SHA1 Message Date
0084707bbc fix(dispatcher): dispatcher service must use containerport 2024-02-13 15:56:10 +01:00
0dbd5dd551 fix(dispatcher): liveness probe must use the container port
Container port is 8080 so ... the probes must use the same port
2024-02-12 11:46:07 +01:00
f1d621d4a9 fix(maester): CRD must be installed cluster wide 2024-02-12 11:42:35 +01:00
83b81b1056 Revert "fix(resources): do not set namespace in maester rolebinding"
This reverts commit 1fccf5f8dc.
2024-01-30 12:34:54 +01:00
1fccf5f8dc fix(resources): do not set namespace in maester rolebinding 2024-01-30 12:27:50 +01:00
907618902e fix(resources): oauth2client CRD must be installed clusterwide 2024-01-30 12:21:13 +01:00
6b1702b7ed fix(component): do not specify namespace for werther component 2024-01-30 10:42:56 +01:00
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
824b8613c4 update doc 2023-12-18 11:15:51 +01:00
19910617bd typo 2023-12-18 10:52:54 +01:00
f4146345d5 Patche du DSN redis 2023-12-18 10:38:13 +01:00
bbeb1ec62f mise en place d'un component pour Redis 2023-12-18 09:25:30 +01:00
fcfbb6cc30 correction port mapping de hydra-remote-user 2023-12-15 15:25:02 +01:00
7a802a6d28 ajout redis à l'example 2023-12-15 14:44:04 +01:00
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
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
e333d07c14 feat(hydra-dispatcher): maj ref image hydra-dispatcher pour ajout url_link env var 2023-12-13 10:41:44 +01:00
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
dd6804aa11 feat(shibboleth-sp): update dev ref image 2023-12-13 09:38:05 +01:00
c7b937adaf feat(hydra-sql): update env vars 2023-12-13 09:38:05 +01:00
77eb73818f feat(hydra-remote-user): update dev image ref 2023-12-13 09:38:05 +01:00
cc3d07d654 feat(hydra-sql): update hydra-sql dev image ref 2023-12-13 09:38:05 +01:00
86754cf518 cosmetic(oidc-test): rename CM oidc-test to oidc-test-env 2023-12-11 17:33:02 +01:00
8b02e8a875 Merge pull request 'Composant "OIDC Test"' (#7) from oidc-test-component-2 into develop
Reviewed-on: #7
2023-12-11 14:31:37 +01:00
caa180747e feat: add oidc-test app component 2023-12-11 14:29:30 +01:00
4d29851350 Merge pull request 'Ajout de la tâche programmée "janitor" pour Hydra' (#8) from hydra-janitor into develop
Reviewed-on: #8
2023-12-11 13:46:54 +01:00
d88cc2de65 feat(hydra): add janitor cronjob 2023-12-11 11:30:50 +01:00
435597f9f1 feat(hydra-dispatcher): update image tag 2023-12-11 10:47:56 +01:00
ee2bb1ea45 update hydra-dispatcher probes and image ref 2023-12-11 10:47:56 +01:00
63c5d7259c add probes 2023-12-11 10:47:56 +01:00
815917c306 add hydra-sql deployment 2023-12-11 10:47:56 +01:00
bc6fe46e1c fix(saml): fixing port name longer than 15c 2023-12-11 10:47:56 +01:00
1b1cc27916 feat(hydra-sql): adding new hydra login app 2023-12-11 10:47:56 +01:00
d37e85000f set correct tag for hydra-oidc 2023-12-11 10:47:56 +01:00
d9570ec8d0 add imagepullpolicy rule 2023-12-11 10:47:56 +01:00
d56ae059a3 remove loginapp default app configmap 2023-12-11 10:47:56 +01:00
5ec48c8b22 update config default apps filename 2023-12-11 10:47:56 +01:00
aaae6e2f20 set default configuration 2023-12-11 10:47:56 +01:00
081e854454 correciton config 2023-12-11 10:47:56 +01:00
3dba6c0d69 set hydra-oidc side container 2023-12-11 10:47:56 +01:00
8c6dc30bde set hydra-dispatcher side container 2023-12-11 10:47:56 +01:00
4ff0f83880 set hydra-dispatcher side container 2023-12-11 10:47:56 +01:00
e93bc069d3 set correct path for hydra-dispatcher conf 2023-12-11 10:47:56 +01:00
a56089efe5 Utilisation images symfony-containers 2023-12-11 10:47:56 +01:00
c4998279d5 Merge pull request 'feat(component): adding hydra-ldap' (#6) from f/werther into master
Reviewed-on: #6
2023-12-11 10:13:18 +01:00
6de80b1d9c fix(hydra-ldap): update werther secret name references 2023-12-11 10:06:37 +01:00
2f3cf60974 fix(hydra-ldap): update werther container port name 2023-12-11 09:56:27 +01:00
bf865b02e2 feat(hydra-ldap): rename resources from werther to hydra-ldap 2023-12-11 09:50:33 +01:00
063b575117 feat(werther): update image 2023-12-06 15:38:40 +01:00
38d3f1c1df feat(werther): adding a timeout for LDAP connection 2023-12-06 14:40:24 +01:00
6acda0553e feat(component): adding werther 2023-11-29 10:22:33 +01:00
29 changed files with 204 additions and 74 deletions

View File

@ -29,7 +29,7 @@ vars:
fieldref: fieldref:
fieldpath: metadata.name fieldpath: metadata.name
patchesJson6902: patches:
- target: - target:
group: apps group: apps
version: v1 version: v1
@ -42,3 +42,9 @@ patchesJson6902:
kind: Job kind: Job
name: hydra-migrate name: hydra-migrate
path: patches/hydra-migrate-job.yaml path: patches/hydra-migrate-job.yaml
- target:
group: batch
version: v1
kind: CronJob
name: hydra-janitor
path: patches/hydra-janitor-cronjob.yaml

View File

@ -0,0 +1,21 @@
- op: add
path: "/spec/jobTemplate/spec/template/spec/containers/0/env/-"
value:
name: HYDRA_DATABASE_USER
valueFrom:
secretKeyRef:
name: hydra-postgres-user
key: username
- op: add
path: "/spec/jobTemplate/spec/template/spec/containers/0/env/-"
value:
name: HYDRA_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: hydra-postgres-user
key: password
- op: add
path: "/spec/jobTemplate/spec/template/spec/containers/0/env/-"
value:
name: DSN
value: "postgres://$(HYDRA_DATABASE_USER):$(HYDRA_DATABASE_PASSWORD)@$(HYDRA_DATABASE_SERVICE_NAME)-rw:5432/hydra?sslmode=disable"

View File

@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: hydra-ldap name: hydra-ldap
namespace: default
labels: labels:
app.kubernetes.io/name: hydra-ldap app.kubernetes.io/name: hydra-ldap
app.kubernetes.io/version: "v1.2.2" app.kubernetes.io/version: "v1.2.2"

View File

@ -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:
@ -26,6 +30,7 @@ configMapGenerator:
- CLIENT_SECRET_FC=MyClientSecret - CLIENT_SECRET_FC=MyClientSecret
- COOKIE_PATH=/ - COOKIE_PATH=/
- TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR - TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR
- REDIS_DSN="redis://redis:6379"
# - name: hydra-dispatcher-apps # - name: hydra-dispatcher-apps
# behavior: merge # behavior: merge
# files: # files:
@ -35,5 +40,5 @@ patchesJson6902:
- target: - target:
version: v1 version: v1
kind: ConfigMap kind: ConfigMap
name: hydra-dispatcher-env name: hydra-oidc-env
path: patches/hydra-dispatcher-env.yaml path: patches/hydra-oidc-env.yaml

View File

@ -18,7 +18,7 @@ spec:
spec: spec:
containers: containers:
- name: hydra-oidc-php-fpm - 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 imagePullPolicy: Always
args: ["/usr/sbin/php-fpm81", "-F", "-e"] args: ["/usr/sbin/php-fpm81", "-F", "-e"]
readinessProbe: readinessProbe:
@ -47,7 +47,7 @@ spec:
name: hydra-oidc-env name: hydra-oidc-env
resources: {} 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 imagePullPolicy: Always
name: hydra-oidc-nginx name: hydra-oidc-nginx
args: ["/usr/sbin/nginx"] args: ["/usr/sbin/nginx"]

View File

@ -18,12 +18,12 @@ spec:
spec: spec:
containers: containers:
- name: hydra-saml-remote-user - 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: envFrom:
- configMapRef: - configMapRef:
name: hydra-saml-env name: hydra-saml-env
ports: ports:
- containerPort: 80 - containerPort: 8080
resources: {} resources: {}
restartPolicy: Always restartPolicy: Always
--- ---
@ -37,6 +37,7 @@ spec:
ports: ports:
- name: http - name: http
port: 80 port: 80
targetPort: 8080
selector: selector:
io.kompose.service: hydra-saml-remote-user io.kompose.service: hydra-saml-remote-user
status: status:

View File

@ -20,7 +20,7 @@ spec:
fsGroup: 102 fsGroup: 102
containers: containers:
- name: hydra-saml-shibboleth-sp - 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: envFrom:
- configMapRef: - configMapRef:
name: hydra-saml-env name: hydra-saml-env

View File

@ -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:
@ -17,6 +21,7 @@ configMapGenerator:
- DSN_REMOTE_DATABASE="pgsql:host='postgres';port=5432;dbname=lasql" - DSN_REMOTE_DATABASE="pgsql:host='postgres';port=5432;dbname=lasql"
- DB_USER="makeMeASecret" - DB_USER="makeMeASecret"
- DB_PASSWORD="makeMeASecret" - DB_PASSWORD="makeMeASecret"
- REDIS_DSN="redis://redis:6379"
- PEPPER="MakeMeABigSecret" - PEPPER="MakeMeABigSecret"
- name: sql-login-config - name: sql-login-config
files: files:

View File

@ -18,7 +18,7 @@ spec:
spec: spec:
containers: containers:
- name: hydra-sql-fpm - 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 imagePullPolicy: Always
args: ["/usr/sbin/php-fpm81", "-F", "-e"] args: ["/usr/sbin/php-fpm81", "-F", "-e"]
readinessProbe: readinessProbe:
@ -54,7 +54,7 @@ spec:
subPath: "sql_login.yaml" subPath: "sql_login.yaml"
- name: hydra-sql-nginx - 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 imagePullPolicy: Always
args: ["/usr/sbin/nginx"] args: ["/usr/sbin/nginx"]
readinessProbe: 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 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 3. Déployer l'application

View File

@ -2,19 +2,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ../../overlays/base - ../../overlays/full
- ./resources/ingress.yaml - ./resources/ingress.yaml
- ./resources/saml-idp.yaml - ./resources/saml-idp.yaml
- ./resources/self-signed-issuer.yaml - ./resources/self-signed-issuer.yaml
- ./resources/port-forwarder.yaml - ./resources/port-forwarder.yaml
components:
- ../../components/hydra-cnpg-database
- ../../components/oidc-test
#- ../../components/hydra-oidc
- ../../components/hydra-saml
patchesJson6902: patchesJson6902:
- target: - target:
version: v1 version: v1
@ -38,7 +31,7 @@ patchesJson6902:
path: patches/hydra-secret.yaml path: patches/hydra-secret.yaml
- target: - target:
version: v1 version: v1
kind: Secret kind: ConfigMap
name: oidc-test name: oidc-test
path: patches/oidc-test.yaml path: patches/oidc-test.yaml
- target: - target:

View File

@ -3,4 +3,4 @@
value: https://ssokustom/oauth2/callback value: https://ssokustom/oauth2/callback
- op: replace - op: replace
path: "/spec/postLogoutRedirectUris/0" path: "/spec/postLogoutRedirectUris/0"
value: https://ssokustom/oauth2/callback value: https://ssokustom

View File

@ -1,6 +1,3 @@
- op: replace
path: "/data/LOG_LEVEL"
value: 0
- op: replace - op: replace
path: "/data/OIDC_REDIRECT_URL" path: "/data/OIDC_REDIRECT_URL"
value: https://ssokustom/oauth2/callback value: https://ssokustom/oauth2/callback

View File

@ -3,6 +3,7 @@ kind: Kustomization
resources: resources:
- https://github.com/jetstack/cert-manager/releases/download/v1.13.2/cert-manager.yaml - 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/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 - https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
patchesJson6902: patchesJson6902:

5
kustomization.yaml Normal file
View File

@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./overlays/base

View File

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

View File

@ -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,6 +25,7 @@ configMapGenerator:
- COOKIE_PATH=/ - COOKIE_PATH=/
- DEFAULT_LOCALE=fr - DEFAULT_LOCALE=fr
- APP_LOCALES=fr,en - APP_LOCALES=fr,en
- 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

View File

@ -18,7 +18,7 @@ spec:
spec: spec:
containers: containers:
- name: hydra-dispatcher-php-fpm - 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"] args: ["/usr/sbin/php-fpm81", "-F", "-e"]
readinessProbe: readinessProbe:
exec: exec:
@ -49,21 +49,21 @@ spec:
name: hydra-dispatcher-apps name: hydra-dispatcher-apps
resources: {} 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 imagePullPolicy: Always
name: hydra-dispatcher-nginx name: hydra-dispatcher-nginx
args: ["/usr/sbin/nginx"] args: ["/usr/sbin/nginx"]
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /health path: /health
port: 80 port: 8080
initialDelaySeconds: 5 initialDelaySeconds: 5
timeoutSeconds: 5 timeoutSeconds: 5
periodSeconds: 10 periodSeconds: 10
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /health path: /health
port: 80 port: 8080
initialDelaySeconds: 15 initialDelaySeconds: 15
timeoutSeconds: 5 timeoutSeconds: 5
periodSeconds: 15 periodSeconds: 15

View File

@ -7,7 +7,7 @@ metadata:
spec: spec:
ports: ports:
- name: http - name: http
port: 80 port: 8080
selector: selector:
io.kompose.service: hydra-dispatcher io.kompose.service: hydra-dispatcher
status: status:

View File

@ -9,6 +9,7 @@ resources:
- ./resources/hydra-serviceaccount.yaml - ./resources/hydra-serviceaccount.yaml
- ./resources/hydra-migrate-job.yaml - ./resources/hydra-migrate-job.yaml
- ./resources/hydra-maester - ./resources/hydra-maester
- ./resources/hydra-janitor-cronjob.yaml
secretGenerator: secretGenerator:
- name: hydra-secret - name: hydra-secret

View File

@ -0,0 +1,34 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: hydra-janitor
labels:
app.kubernetes.io/name: hydra-janitor
spec:
concurrencyPolicy: Forbid
schedule: "0 */1 * * *"
jobTemplate:
spec:
template:
metadata:
labels:
app.kubernetes.io/name: hydra-janitor
spec:
restartPolicy: OnFailure
serviceAccountName: hydra-sa
containers:
- name: janitor
image: reg.cadoles.com/proxy_cache/oryd/hydra:v2.0.3
envFrom:
- configMapRef:
name: hydra-env
imagePullPolicy: IfNotPresent
command: ["hydra"]
env: []
args:
- janitor
- --read-from-env
- --grants
- --requests
- --tokens
resources: {}

View File

@ -4,7 +4,6 @@ kind: Kustomization
resources: resources:
- ./resources/hydra-maester-deployment.yaml - ./resources/hydra-maester-deployment.yaml
- ./resources/hydra-maester-rbac.yaml - ./resources/hydra-maester-rbac.yaml
- https://raw.githubusercontent.com/ory/k8s/v0.28.2/helm/charts/hydra-maester/crds/crd-oauth2clients.yaml
configMapGenerator: configMapGenerator:
- name: hydra-maester-env - name: hydra-maester-env