feat(resource): adding new hydra-maester resource

This allow to manage "Clients" with a CRD

from official doc:

The controller listens for Custom Resource which defines client registration request.
Once Custom resource is created, the controller register oauth2 client in hydra using
hydra's REST API.

Client Id, Client Secret and Identifier of the client in hydra are be stored in the
kubernetes as a secret and referenced in the applied CR. Reference is used to
identify in which kubernetes secret are stored mentioned properties.

Secret iscreated in the same namespace of applied CR. By default controller should
be deployed in the same pod as hydra. Service discovery will come in place in the future.
This commit is contained in:
2023-03-17 11:05:23 +01:00
parent b1b834c2d4
commit 8075071f22
11 changed files with 199 additions and 67 deletions

View File

@ -2,23 +2,23 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./resources/hydra-dispatcher-deployment.yaml
- ./resources/hydra-dispatcher-service.yaml
- ./resources/hydra-dispatcher-deployment.yaml
- ./resources/hydra-dispatcher-service.yaml
configMapGenerator:
- name: hydra-dispatcher-env
literals:
- APP_ENV=prod
- APP_DEBUG=false
- HYDRA_BASE_URL=http://hydra:4444
- HYDRA_ADMIN_BASE_URL=http://hydra:4445
- HYDRA_REWRITE_ISSUER=yes
- HYDRA_ORIGINAL_ISSUER=http://hydra:4444
- HYDRA_NEW_ISSUER=http://hydra-dispatcher
- BASE_URL=http://hydra-dispatcher
- COOKIE_PATH=/
- DEFAULT_LOCALE=fr
- APP_LOCALES=fr,en
- name: hydra-dispatcher-apps
files:
- ./files/hydra/default.yaml
- name: hydra-dispatcher-env
literals:
- APP_ENV=prod
- APP_DEBUG=false
- HYDRA_BASE_URL=http://hydra:4444
- HYDRA_ADMIN_BASE_URL=http://hydra:4445
- HYDRA_REWRITE_ISSUER=yes
- HYDRA_ORIGINAL_ISSUER=http://hydra:4444
- HYDRA_NEW_ISSUER=http://hydra-dispatcher
- BASE_URL=http://hydra-dispatcher
- COOKIE_PATH=/
- DEFAULT_LOCALE=fr
- APP_LOCALES=fr,en
- name: hydra-dispatcher-apps
files:
- ./files/hydra/default.yaml

View File

@ -17,20 +17,20 @@ spec:
io.kompose.service: hydra-dispatcher
spec:
containers:
- name: hydra-dispatcher
image: reg.cadoles.com/cadoles/hydra-dispatcher-v1:v0.0.0-159-gd91e77b
envFrom:
- configMapRef:
name: hydra-dispatcher-env
volumeMounts:
- mountPath: /var/www/config/hydra
name: hydra-dispatcher-apps
ports:
- containerPort: 80
resources: {}
- name: hydra-dispatcher
image: reg.cadoles.com/cadoles/hydra-dispatcher-v1:v0.0.0-218-g4b5e1d9
envFrom:
- configMapRef:
name: hydra-dispatcher-env
volumeMounts:
- mountPath: /var/www/config/hydra
name: hydra-dispatcher-apps
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
volumes:
- name: hydra-dispatcher-apps
configMap:
name: hydra-dispatcher-apps
- name: hydra-dispatcher-apps
configMap:
name: hydra-dispatcher-apps