From 991825df95b85a1b794ba3ae1306fe3879a21ca3 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 9 Mar 2024 23:02:43 +0100 Subject: [PATCH] feat: add resources Signed-off-by: kjuulh --- templates/kustomize/base/configmap.yaml | 9 +++++++++ templates/kustomize/base/crdb.configmap.yaml | 7 +++++++ templates/kustomize/base/deployment.yaml | 7 +++++++ templates/kustomize/base/kustomization.yaml | 3 +++ templates/kustomize/base/nats.configmap.yaml | 8 ++++++++ 5 files changed, 34 insertions(+) create mode 100644 templates/kustomize/base/configmap.yaml create mode 100644 templates/kustomize/base/crdb.configmap.yaml create mode 100644 templates/kustomize/base/nats.configmap.yaml diff --git a/templates/kustomize/base/configmap.yaml b/templates/kustomize/base/configmap.yaml new file mode 100644 index 0000000..f80fe81 --- /dev/null +++ b/templates/kustomize/base/configmap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "{{ service | lower | replace(from='_', to='-') }}-config" +data: + AWS_ACCESS_KEY_ID: "dNo8Kxbg08WcWVJdazXZ" + AWS_SECRET_ACCESS_KEY: "5NUnyOZMvIu89FJbqKwkynSvJVPRc5lsprsqm0c8" + AWS_ENDPOINT_URL: "https://api.minio.i.kjuulh.io" + diff --git a/templates/kustomize/base/crdb.configmap.yaml b/templates/kustomize/base/crdb.configmap.yaml new file mode 100644 index 0000000..c85050a --- /dev/null +++ b/templates/kustomize/base/crdb.configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "{{ service | lower | replace(from='_', to='-') }}-database-crdb" +data: +# DATABASE_URL: "postgresql://{{ service | lower | replace(from='-', to='_') }}:strongpassword123@prod-cluster:26257/{{ service | lower | replace(from='-', to='_') }}" + DATABASE_URL: "postgresql://root@prod-cluster:26257/defaultdb" diff --git a/templates/kustomize/base/deployment.yaml b/templates/kustomize/base/deployment.yaml index 2b29ba7..931f726 100644 --- a/templates/kustomize/base/deployment.yaml +++ b/templates/kustomize/base/deployment.yaml @@ -20,3 +20,10 @@ spec: name: internal-http - containerPort: 3002 name: internal-grpc + envFrom: + - configMapRef: + name: "{{ service | lower | replace(from='_', to='-') }}-database-crdb" + - configMapRef: + name: "{{ service | lower | replace(from='_', to='-') }}-config" + - configMapRef: + name: "{{ service | lower | replace(from='_', to='-') }}-message-queue-nats" diff --git a/templates/kustomize/base/kustomization.yaml b/templates/kustomize/base/kustomization.yaml index 1681e3b..6720101 100644 --- a/templates/kustomize/base/kustomization.yaml +++ b/templates/kustomize/base/kustomization.yaml @@ -7,6 +7,9 @@ kind: Kustomization resources: - deployment.yaml - service.yaml +- crdb.configmap.yaml +- nats.configmap.yaml +- configmap.yaml commonLabels: app: "{{ service }}" diff --git a/templates/kustomize/base/nats.configmap.yaml b/templates/kustomize/base/nats.configmap.yaml new file mode 100644 index 0000000..ce351db --- /dev/null +++ b/templates/kustomize/base/nats.configmap.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "{{ service | lower | replace(from='_', to='-') }}-message-queue-nats" +data: + NATS_USERNAME: "{{ service | lower | replace(from='_', to='-') }}" + NATS_PASSWORD: "{{ service | lower | replace(from='_', to='-') }}" + NATS_URL: "nats"