From dae298bd00f28f4d3f8f4853453c1fc088c51cff Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Fri, 31 Oct 2025 11:53:04 +0100 Subject: [PATCH] Refactor and added scheduler container in k8s config --- CREDITS.md | 1 + .../catalog-svc/0001_create_base_tables.up.sql | 10 +++------- deploy/db_migrations/init/init.sql | 4 ++-- deploy/k8s/api-gateway.yml | 4 ++-- deploy/k8s/catalog-svc.yml | 13 +++++++++++++ 5 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 CREDITS.md diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..7698d6e --- /dev/null +++ b/CREDITS.md @@ -0,0 +1 @@ +# Libraries or any other code used in this project: diff --git a/deploy/db_migrations/catalog-svc/0001_create_base_tables.up.sql b/deploy/db_migrations/catalog-svc/0001_create_base_tables.up.sql index 7fe625f..1a446e4 100644 --- a/deploy/db_migrations/catalog-svc/0001_create_base_tables.up.sql +++ b/deploy/db_migrations/catalog-svc/0001_create_base_tables.up.sql @@ -1,16 +1,12 @@ CREATE TABLE catalog.product ( - id integer NOT NULL GENERATED ALWAYS AS IDENTITY, - pid uuid NOT NULL DEFAULT gen_random_uuid(), + id uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, + slug character varying NOT NULL, price double precision NOT NULL, created_at timestamp without time zone NOT NULL DEFAULT now(), updated_at timestamp without time zone, PRIMARY KEY (id) ); -ALTER TABLE IF EXISTS catalog.product - OWNER to postgres; - -COMMENT ON COLUMN catalog.product.pid - IS 'Unique product ID. EAN, UPC etc...'; +ALTER TABLE IF EXISTS catalog.product OWNER to egommerce; diff --git a/deploy/db_migrations/init/init.sql b/deploy/db_migrations/init/init.sql index ee6f9f3..61c58af 100644 --- a/deploy/db_migrations/init/init.sql +++ b/deploy/db_migrations/init/init.sql @@ -6,5 +6,5 @@ GRANT ALL PRIVILEGES ON DATABASE egommerce TO egommerce; CREATE EXTENSION IF NOT EXISTS "pgcrypto"; CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; --- CREATE SCHEMA "identity" --- AUTHORIZATION egommerce; +CREATE SCHEMA "identity" AUTHORIZATION egommerce; +CREATE SCHEMA catalog AUTHORIZATION egommerce; diff --git a/deploy/k8s/api-gateway.yml b/deploy/k8s/api-gateway.yml index f43f29c..40683d2 100644 --- a/deploy/k8s/api-gateway.yml +++ b/deploy/k8s/api-gateway.yml @@ -39,9 +39,9 @@ spec: tls: - secretName: api-gateway-cert hosts: - - egommerce.io + - egommerce.io # CHANGE TO PROD DOMAIN rules: - - host: egommerce.io + - host: egommerce.io # CHANGE TO PROD DOMAIN http: paths: - path: /api/identity diff --git a/deploy/k8s/catalog-svc.yml b/deploy/k8s/catalog-svc.yml index ce3c05f..28df40f 100644 --- a/deploy/k8s/catalog-svc.yml +++ b/deploy/k8s/catalog-svc.yml @@ -106,6 +106,19 @@ spec: # args: # - --web.listen-address=:9090 # - --web.telemetry-path=/metrics + - name: identity-chronos # Scheduler Container + image: git.ego.freeddns.org/egommerce/identity-svc:dev + imagePullPolicy: Always + command: [ + "/usr/local/bin/chronos" + ] + resources: + limits: + cpu: 100m + memory: 512Mi + requests: + cpu: 50m + memory: 256Mi volumes: - name: catalog-cert hostPath: