From 9d60b4bbee1ed18b72f3cc5143f87cf1adefcb22 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Mon, 12 Jun 2023 14:09:12 +0200 Subject: [PATCH] feat(hydra-sql): adding new hydra login app --- components/hydra-sql/kustomization.yaml | 24 ++++++++++ .../resources/hydra-sql-deployment.yaml | 46 +++++++++++++++++++ .../resources/hydra-sql-service.yaml | 14 ++++++ kustomization.yaml | 1 + 4 files changed, 85 insertions(+) create mode 100644 components/hydra-sql/kustomization.yaml create mode 100644 components/hydra-sql/resources/hydra-sql-deployment.yaml create mode 100644 components/hydra-sql/resources/hydra-sql-service.yaml diff --git a/components/hydra-sql/kustomization.yaml b/components/hydra-sql/kustomization.yaml new file mode 100644 index 0000000..07ae19d --- /dev/null +++ b/components/hydra-sql/kustomization.yaml @@ -0,0 +1,24 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: +- ./resources/hydra-sql-service.yaml +- ./resources/hydra-sql-deployment.yaml + +configMapGenerator: +- name: hydra-sql-env + literals: + - ISSUER_URL="http://localhost:8000" + - BASE_URL='http://localhost:8080' + - HYDRA_ADMIN_BASE_URL='http://hydra:4445' + - APP_LOCALES="fr,en" + - HASH_ALGO_LEGACY="sha256, bcrypt" + - SECURITY_PATTERN="password,salt,pepper" + - DSN_REMOTE_DATABASE="pgsql:host='postgres';port=5432;dbname=lasql" + +secretGenerator: +- name: login-db + literals: + - DB_USER="" + - DB_PASSWORD="" + - PEPPER="" diff --git a/components/hydra-sql/resources/hydra-sql-deployment.yaml b/components/hydra-sql/resources/hydra-sql-deployment.yaml new file mode 100644 index 0000000..558119c --- /dev/null +++ b/components/hydra-sql/resources/hydra-sql-deployment.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + io.kompose.service: hydra-sql + name: hydra-sql +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: hydra-sql + strategy: + type: Recreate + template: + metadata: + labels: + io.kompose.service: hydra-sql + spec: + containers: + - name: hydra-sql + image: reg.cadoles.com/cadoles/hydra-sql:latest + envFrom: + - configMapRef: + name: hydra-sql-env + - secret + env: + - name: DB_USER + valueFrom: + secretKeyRef: + name: login-db + key: DB_USER + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: login-db + key: DB_PASSWORD + - name: PEPPER + valueFrom: + secretKeyRef: + name: login-db + key: PEPPER + ports: + - containerPort: 80 + resources: {} + restartPolicy: Always + diff --git a/components/hydra-sql/resources/hydra-sql-service.yaml b/components/hydra-sql/resources/hydra-sql-service.yaml new file mode 100644 index 0000000..45d58fa --- /dev/null +++ b/components/hydra-sql/resources/hydra-sql-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + io.kompose.service: hydra-sql + name: hydra-sql +spec: + ports: + - name: hydra-sql + port: 80 + selector: + io.kompose.service: hydra-sql +status: + loadBalancer: {} diff --git a/kustomization.yaml b/kustomization.yaml index 38c75b0..60bbd7a 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -9,3 +9,4 @@ components: - ./components/hydra-cnpg-database - ./components/hydra-oidc - ./components/hydra-saml +- ./components/hydra-sql