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,43 +2,43 @@ apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
configurations:
- ./configurations/cnpg-cluster.yaml
- ./configurations/cnpg-cluster.yaml
resources:
- ./resources/hydra-cnpg-cluster.yaml
- ./resources/hydra-cnpg-cluster.yaml
secretGenerator:
- name: hydra-postgres-admin
type: Secret
literals:
- username=postgres
- password=NotSoSecret
- name: hydra-postgres-user
type: Secret
literals:
- username=hydra
- password=NotSoSecret
- name: hydra-postgres-admin
type: Secret
literals:
- username=postgres
- password=NotSoSecret
- name: hydra-postgres-user
type: Secret
literals:
- username=hydra
- password=NotSoSecret
vars:
- name: HYDRA_DATABASE_SERVICE_NAME
objref:
name: hydra-postgres
kind: Cluster
kind: Cluster
apiVersion: postgresql.cnpg.io/v1
fieldref:
fieldpath: metadata.name
patchesJson6902:
- target:
group: apps
version: v1
kind: Deployment
name: hydra
path: patches/hydra-deployment.yaml
- target:
group: batch
version: v1
kind: Job
name: hydra-migrate
path: patches/hydra-migrate-job.yaml
- target:
group: apps
version: v1
kind: Deployment
name: hydra
path: patches/hydra-deployment.yaml
- target:
group: batch
version: v1
kind: Job
name: hydra-migrate
path: patches/hydra-migrate-job.yaml

View File

@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: hydra-oidc
image: reg.cadoles.com/cadoles/hydra-oidc-v1:v0.0.0-159-gd91e77b
image: reg.cadoles.com/cadoles/hydra-oidc-v1:v0.0.0-170-g485b138
envFrom:
- configMapRef:
name: hydra-oidc-env

View File

@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: hydra-saml-remote-user
image: reg.cadoles.com/cadoles/hydra-remote-user-v1:v0.0.0-159-gd91e77b
image: reg.cadoles.com/cadoles/hydra-remote-user-v1:v0.0.0-170-g485b138
envFrom:
- configMapRef:
name: hydra-saml-env

View File

@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: hydra-saml-shibboleth-sp
image: reg.cadoles.com/cadoles/shibboleth-sp-v3:v0.0.0-159-gd91e77b
image: reg.cadoles.com/cadoles/shibboleth-sp-v3:v0.0.0-172-g0f44679
envFrom:
- configMapRef:
name: hydra-saml-env