73 Commits

Author SHA1 Message Date
efec7c2b9d Update deploy/k8s/api-logger.yml 2025-11-05 19:24:42 +01:00
b2689dd772 Update deploy/k8s/api-cache.yml 2025-11-05 19:19:41 +01:00
be4dd45156 Update deploy/k8s/db-postgres.yml 2025-11-05 18:12:04 +01:00
24b69b133d Renamed Chronos to Scheduler 2025-11-05 13:21:29 +01:00
dcd2414ea0 Renamed Chronos to Scheduler 2025-11-05 13:15:22 +01:00
4f1d72ff4d Fixes in generate cert script 2025-11-05 13:15:09 +01:00
dae298bd00 Refactor and added scheduler container in k8s config 2025-10-31 11:53:04 +01:00
37da42027b Update README.md 2025-10-31 11:42:36 +01:00
27b00cd822 Update README.md 2025-10-31 11:42:05 +01:00
7a4ebf2f6f Renamed db-postgres volume name 2025-10-23 09:35:41 +02:00
b3b7fd6b5b Added volume mount to persist redis rdb 2025-10-23 09:35:25 +02:00
276d17e51d Updated migration 2025-10-23 08:54:59 +02:00
a4668a74b8 Added Chronos container for executing Cron Jobs 2025-10-23 08:54:36 +02:00
9f4f6694d2 Added Grafana Dashoabrds configs 2025-10-23 08:53:55 +02:00
c5c10ff8fd Migration SQLs updated 2025-10-22 13:49:53 +02:00
255d874a22 Fixed user for db-postgres in deployment 2025-10-22 13:49:10 +02:00
fca1257d62 Added password field to identity migration file 2025-10-21 15:59:55 +02:00
5cee3b46db Fixes in identity-svc deployment 2025-10-21 15:59:31 +02:00
a6dbe760e2 Fixes in catalog-svc deployment 2025-10-21 15:58:59 +02:00
df63f90152 Added domain for api-gateway in generate certs script 2025-10-21 15:58:02 +02:00
759da872ef Fixed k8s init script 2025-10-21 15:57:33 +02:00
65307e2e27 Added catalog-svc deployment 2025-10-21 15:57:07 +02:00
f3dc764748 Fixed api-eventbus node port 2025-10-21 15:56:15 +02:00
671afb470a Update README.md 2025-10-20 15:29:47 +02:00
832d59cedc Removed useless volumes from api-gateway deploy 2025-10-20 14:30:17 +02:00
87e0c1ad1d Update README.md 2025-10-20 13:53:58 +02:00
0938338b99 Removed docker swarm config
Added K8S config
With big refactor
2025-10-20 13:51:45 +02:00
fa62c0b817 Update 2025-03-16 14:19:29 +01:00
6848b55101 Update & Refactor 2024-12-24 14:29:04 +01:00
Piotr Biernat
a856f24132 refactor 2024-12-24 14:19:23 +01:00
Piotr Biernat
35dd2d38bf Update 2024-12-06 17:08:55 +01:00
Piotr Biernat
0173d65f9b Update 2024-12-05 21:54:28 +01:00
b9b8a57a5b Update 2024-12-05 17:02:44 +01:00
e3173eaecb dev env update 2023-06-25 03:34:58 +02:00
ab2ec6717b Update env 2023-06-25 00:48:39 +02:00
7e5d3273d8 Update Makefile 2023-06-24 15:40:54 +02:00
6842fedccb Update README.md 2023-06-24 15:40:25 +02:00
b0afeb3b89 README.md update 2023-06-24 15:23:36 +02:00
574309d94c Added README.md 2023-06-24 14:04:12 +02:00
f6ea4db35e update 2023-06-24 12:44:28 +02:00
eed5458c0c Updated config files 2023-06-13 21:28:10 +02:00
59368f3660 added pricing service migrations 2023-06-13 21:03:44 +02:00
8fba43e14c Init testing branch 2023-06-13 17:07:05 +02:00
a3428542e7 Update 2023-06-01 21:54:00 +02:00
24378430de update 2023-05-24 14:28:20 +02:00
root
0213ecbadf keshop.bieda.it deploy fixes 2023-05-21 22:34:21 +00:00
6775eeafe6 sql init update 2023-05-22 00:18:08 +02:00
6467a60194 sql init update 2023-05-22 00:16:39 +02:00
3ab3c7f769 sql init update 2023-05-22 00:12:08 +02:00
0d2ff20557 Add init db sql file 2023-05-22 00:05:33 +02:00
f871d5e052 Update 2023-05-20 21:41:33 +02:00
08e6275c50 Added LICENSE 2023-03-30 22:15:45 +02:00
bd38c66fda Added base prometheus config + fast clean-up 2023-03-20 15:13:42 +01:00
6042f81c35 update 2022-12-25 23:21:27 +01:00
317d1a871b gateway command fix 2022-12-06 07:36:17 +01:00
5bd2f273a9 nginx example config update 2022-12-05 03:13:27 +01:00
17c64b31f5 fix 2022-12-05 01:39:24 +01:00
3db0fcf17b added sample nginx demo config 2022-12-05 01:38:51 +01:00
aa5b8bdadb fix 2022-12-05 00:23:18 +01:00
dbc67e44f2 fixes 2022-12-04 10:24:57 +01:00
68596649d4 fixes 2022-12-04 09:51:47 +01:00
80e8a2ac4e tls fixes 2022-12-04 07:19:55 +01:00
047888cf47 added empty directory for certificates(and keys) 2022-12-04 04:01:33 +01:00
f2efd1b141 added admin tools at main gateway entrypoint 2022-12-04 04:01:09 +01:00
958e04f81d env domain names fixes 2022-12-04 01:41:55 +01:00
b972b53d6b Added remove_dangling_images.sh script 2022-12-04 00:02:53 +01:00
b1d5d5c015 moved ports from dev to dev.local.dist stack config 2022-12-02 23:44:20 +01:00
45ce3d3e3c fixes 2022-12-02 22:03:33 +01:00
f9bf711ef6 fix 2022-12-02 14:17:09 +01:00
ea63c86bf8 Refactoring 2022-11-30 02:20:48 +01:00
55267a12e2 fix 2022-10-07 03:17:20 +02:00
2da3dd13d1 update 2022-10-06 20:40:27 +02:00
a811386ee3 Merge '[fix] Updated go version and project name in go.mod file' (#1) from bugfix/fix-go_mod-repair into develop
Reviewed-on: https://git.pbiernat.dev/egommerce/application/pulls/1
2022-06-19 11:35:28 +02:00
46 changed files with 24494 additions and 25 deletions

2
.gitignore vendored
View File

@@ -1 +1,3 @@
.idea/
deploy/certs/

15
.gitmodules vendored
View File

@@ -1,15 +0,0 @@
[submodule "services/basket"]
path = services/basket
url = git@git.pbiernat.dev:egommerce/basket-service.git
[submodule "services/catalog"]
path = services/catalog
url = git@git.pbiernat.dev:egommerce/catalog-service.git
[submodule "services/identity"]
path = services/identity
url = git@git.pbiernat.dev:egommerce/identity-service.git
[submodule "services/notification"]
path = services/notification
url = git@git.pbiernat.dev:egommerce/notification-service.git
[submodule "services/ordering"]
path = services/ordering
url = git@git.pbiernat.dev:egommerce/ordering-service.git

1
CREDITS.md Normal file
View File

@@ -0,0 +1 @@
# Libraries or any other code used in this project:

173
LICENSE.md Normal file
View File

@@ -0,0 +1,173 @@
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
**Using Creative Commons Public Licenses**
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
* __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors).
* __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensors permission is not necessary for any reasonfor example, because of any applicable exception or limitation to copyrightthen that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees).
## Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
### Section 1 Definitions.
a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. __BY-NC-SA Compatible License__ means a license listed at [creativecommons.org/compatiblelicenses](http://creativecommons.org/compatiblelicenses), approved by Creative Commons as essentially the equivalent of this Public License.
d. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
e. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
f. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
g. __License Elements__ means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike.
h. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
i. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
j. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License.
k. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
l. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
m. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
n. __You__ means the individual or entity exercising the Licensed Rights under this Public License. __Your__ has a corresponding meaning.
### Section 2 Scope.
a. ___License grant.___
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
B. produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. __Term.__ The term of this Public License is specified in Section 6(a).
4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
5. __Downstream recipients.__
A. __Offer from the Licensor Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
B. __Additional offer from the Licensor Adapted Material.__ Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapters License You apply.
C. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. ___Other rights.___
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
### Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a. ___Attribution.___
1. If You Share the Licensed Material (including in modified form), You must:
A. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
b. ___ShareAlike.___
In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
1. The Adapters License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
### Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
### Section 5 Disclaimer of Warranties and Limitation of Liability.
a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__
b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
### Section 6 Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
### Section 7 Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
### Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
> Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
>
> Creative Commons may be contacted at creativecommons.org

View File

@@ -0,0 +1,13 @@
DEPLOY_DIR := ./deploy
init:
- sh ${DEPLOY_DIR}/scripts/init-k8s.sh
up:
- sh ${DEPLOY_DIR}/scripts/start-k8s.sh
down:
- sh ${DEPLOY_DIR}/scripts/stop-k8s.sh
certs:
- bash ${DEPLOY_DIR}/scripts/gen-certs.sh

View File

@@ -1,3 +1,15 @@
# application
# Egommerce K8S stack
Main application - includes all microservices
### Generate Certificates by running:
```make certs```
### Init stack (K8S Dependencies and secrets)
```make init```
### Start
```make up```
### Shutdown
```make down```

View File

View File

@@ -0,0 +1,2 @@
DROP TABLE IF EXISTS basket.basket_item;
DROP TABLE IF EXISTS basket.basket;

View File

@@ -0,0 +1,34 @@
CREATE TABLE IF NOT EXISTS basket.basket
(
id uuid NOT NULL DEFAULT gen_random_uuid(),
"state" character varying NOT NULL DEFAULT 'new',
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS basket.basket_item
(
id uuid NOT NULL DEFAULT gen_random_uuid(),
basket_id uuid NOT NULL,
product_id integer NOT NULL,
quantity integer NOT NULL DEFAULT 1,
price double precision NOT NULL DEFAULT 0.00,
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone,
PRIMARY KEY (id)
);
ALTER TABLE IF EXISTS basket.basket_item
ADD CONSTRAINT basket_item_basket_fkey FOREIGN KEY (basket_id)
REFERENCES basket.basket (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID;
ALTER TABLE IF EXISTS basket.basket
OWNER to postgres;
ALTER TABLE IF EXISTS basket.basket_item
OWNER to postgres;
-- TODO ^^ PRIVILEGES...

View File

@@ -0,0 +1 @@
DROP TABLE IF EXISTS catalog.product;

View File

@@ -0,0 +1,12 @@
CREATE TABLE catalog.product
(
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 egommerce;

View File

@@ -0,0 +1 @@
DROP TABLE IF EXISTS identity.users;

View File

@@ -0,0 +1,58 @@
CREATE TABLE IF NOT EXISTS identity.users
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
username character varying NOT NULL,
"password" character varying NOT NULL,
email character varying NOT NULL,
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone,
PRIMARY KEY (id),
UNIQUE (email),
UNIQUE (username)
);
CREATE TABLE IF NOT EXISTS identity.roles
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
name character varying(100) COLLATE pg_catalog."default" NOT NULL,
display_name character varying(200) COLLATE pg_catalog."default" NOT NULL,
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS identity.users_roles
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
user_id uuid NOT NULL,
role_id uuid NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (user_id)
REFERENCES identity.users (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID,
FOREIGN KEY (role_id)
REFERENCES identity.roles (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
UNIQUE (user_id, role_id)
);
CREATE TABLE identity.url_access
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
roles json NOT NULL,
url character varying(255) NOT NULL,
method character varying(10) NOT NULL,
service character varying(100) NOT NULL,
PRIMARY KEY (id),
UNIQUE (url, method, service)
);
ALTER TABLE IF EXISTS identity.users OWNER to egommerce;
ALTER TABLE IF EXISTS identity.roles OWNER to egommerce;
ALTER TABLE IF EXISTS identity.users_roles OWNER to egommerce;
ALTER TABLE IF EXISTS identity.url_access OWNER to egommerce;

View File

@@ -0,0 +1,10 @@
CREATE USER egommerce;
CREATE DATABASE egommerce;
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 catalog AUTHORIZATION egommerce;

View File

@@ -0,0 +1,2 @@
DROP TABLE IF EXISTS "ordering".order_item;
DROP TABLE IF EXISTS "ordering"."order";

View File

@@ -0,0 +1,34 @@
CREATE TABLE IF NOT EXISTS "ordering"."order"
(
id uuid NOT NULL DEFAULT gen_random_uuid(),
"state" character varying NOT NULL DEFAULT 'new',
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS "ordering".order_item
(
id uuid NOT NULL DEFAULT gen_random_uuid(),
order_id uuid NOT NULL,
product_id integer NOT NULL,
quantity integer NOT NULL DEFAULT 1,
price double precision NOT NULL DEFAULT 0.00,
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone,
PRIMARY KEY (id)
);
ALTER TABLE IF EXISTS "ordering".order_item
ADD CONSTRAINT order_item_order_fkey FOREIGN KEY (order_id)
REFERENCES "ordering"."order" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID;
ALTER TABLE IF EXISTS "ordering"."order"
OWNER to postgres;
ALTER TABLE IF EXISTS "ordering".order_item
OWNER to postgres;
-- TODO ^^ PRIVILEGES...

View File

@@ -0,0 +1 @@
DROP TABLE IF EXISTS pricing.price;

View File

@@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS pricing."price"
(
id uuid NOT NULL DEFAULT gen_random_uuid()
);
ALTER TABLE IF EXISTS "pricing"."price"
OWNER to postgres;
-- TODO ^^ PRIVILEGES...

106
deploy/k8s/api-cache.yml Normal file
View File

@@ -0,0 +1,106 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: api-cache-pv
namespace: egommerce
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
storageClassName: api-cache-pv
hostPath:
path: "/home/keedosn/.egommerce/redis" # Ensure this path exists on the node
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: api-cache-pvc
namespace: egommerce
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
# storageClassName: api-cache-pv
---
apiVersion: v1
kind: Service
metadata:
name: api-cache
namespace: egommerce
labels:
app: api-cache
spec:
type: NodePort
selector:
app: api-cache
ports:
- port: 6379
nodePort: 31300
# ---
# apiVersion: v1
# kind: Service
# metadata:
# name: api-cache-metrics
# namespace: egommerce
# labels:
# app: api-cache
# spec:
# type: NodePort
# selector:
# app: api-cache
# ports:
# - port: 9121
# nodePort: 31301
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-cache
namespace: egommerce
spec:
replicas: 1
selector:
matchLabels:
app: api-cache
template:
metadata:
labels:
app: api-cache
spec:
containers:
- name: api-cache
image: git.ego.freeddns.org/egommerce/api-cache:dev
imagePullPolicy: Always
command: [
"redis-server"
]
args: [
"/etc/redis.conf"
]
env:
- name: APP_NAME
value: api-cache
- name: REDIS_PASSWORD
value: "12345678"
resources:
limits:
cpu: "1"
memory: 512M
ports:
- containerPort: 6379
volumeMounts:
- name: api-cache-data
mountPath: /data
- name: api-cache-metrics
image: oliver006/redis_exporter:latest
args:
- --redis.addr=redis://api-cache:6379
ports:
- containerPort: 9121
volumes:
- name: api-cache-data
persistentVolumeClaim:
claimName: api-cache-pvc

View File

@@ -0,0 +1,70 @@
apiVersion: v1
kind: Service
metadata:
name: api-eventbus
namespace: egommerce
labels:
app: api-eventbus
spec:
type: NodePort
selector:
app: api-eventbus
ports:
- name: api-eventbus
protocol: TCP
port: 5672
nodePort: 31200
- name: api-eventbus-mngmnt
protocol: TCP
port: 15672
nodePort: 31299
# - name: api-eventbus-metrics
# protocol: TCP
# port: 15692
# nodePort: 31201
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-eventbus
namespace: egommerce
spec:
replicas: 1
selector:
matchLabels:
app: api-eventbus
template:
metadata:
labels:
app: api-eventbus
spec:
containers:
- name: api-eventbus
image: git.ego.freeddns.org/egommerce/api-eventbus:dev
imagePullPolicy: Always
command: [
"rabbitmq-server"
]
env:
- name: APP_NAME
value: api-eventbus
- name: RABBITMQ_ERLANG_COOKIE
value: rabbitmq
volumeMounts:
- name: eventbus-data
mountPath: /var/lib/rabbitmq
- name: eventbus-logs
mountPath: /var/log/rabbitmq
resources:
limits:
cpu: "1"
memory: 1G
ports:
- containerPort: 5672
- containerPort: 15672
- containerPort: 15692
volumes:
- name: eventbus-data
emptyDir:
- name: eventbus-logs
emptyDir:

122
deploy/k8s/api-gateway.yml Normal file
View File

@@ -0,0 +1,122 @@
apiVersion: v1
kind: Service
metadata:
name: api-gateway
namespace: egommerce
spec:
type: NodePort
ports:
- name: api-gateway-https
port: 8443
nodePort: 31800
- name: api-gateway-stats
port: 1024
nodePort: 31899
selector:
app: api-gateway
---
kind: IngressClass
apiVersion: networking.k8s.io/v1
metadata:
name: haproxy
namespace: egommerce
spec:
controller: haproxy.org/ingress-controller/haproxy
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: api-gateway
namespace: egommerce
annotations:
haproxy.org/server-ssl: "true"
haproxy.org/server-ca: "egommerce/ca-root"
haproxy.org/path-rewrite: |
/api/identity/(.*) /\1
/api/catalog/(.*) /\1
spec:
ingressClassName: haproxy
tls:
- secretName: api-gateway-cert
hosts:
- egommerce.io # CHANGE TO PROD DOMAIN
rules:
- host: egommerce.io # CHANGE TO PROD DOMAIN
http:
paths:
- path: /api/identity
pathType: Prefix
backend:
service:
name: identity-svc
port:
number: 443
- path: /api/catalog
pathType: Prefix
backend:
service:
name: catalog-svc
port:
number: 443
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-gateway
namespace: egommerce
spec:
replicas: 1
selector:
matchLabels:
app: api-gateway
template:
metadata:
labels:
app: api-gateway
spec:
restartPolicy: Always
containers:
- name: api-gateway
image: git.ego.freeddns.org/egommerce/api-gateway:dev
imagePullPolicy: Always
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 50m
memory: 256Mi
ports:
- containerPort: 8443
args:
- --publish-service=egommerce/api-gateway
- --ingress.class=haproxy
- --https-bind-port=8443
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
# runAsUser: 1000
# runAsGroup: 1000
# runAsNonRoot: true
# allowPrivilegeEscalation: false
# seccompProfile:
# type: RuntimeDefault

432
deploy/k8s/api-logger.yml Normal file
View File

@@ -0,0 +1,432 @@
apiVersion: v1
kind: Service
metadata:
name: api-logger-loki
namespace: egommerce
labels:
app: api-logger-loki
spec:
type: NodePort
selector:
app: api-logger-loki
ports:
- protocol: TCP
port: 3100
nodePort: 31401
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-logger-loki
namespace: egommerce
labels:
app: api-logger-loki
spec:
replicas: 1
selector:
matchLabels:
app: api-logger-loki
template:
metadata:
labels:
app: api-logger-loki
spec:
containers:
- name: api-logger-loki
image: git.ego.freeddns.org/egommerce/api-logger-loki:dev
imagePullPolicy: Always
args:
- "-config.file=/etc/loki/loki.yaml"
ports:
- containerPort: 3100
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: api-logger-promtail-ac
namespace: egommerce
labels:
app: api-logger-promtail-ac
annotations: {}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: api-logger-promtail
namespace: egommerce
labels:
app: api-logger-promtail
spec:
revisionHistoryLimit: 1
selector:
matchLabels:
app: api-logger-promtail
# updateStrategy:
# type: RollingUpdate
template:
metadata:
labels:
app: api-logger-promtail
annotations:
prometheus.io/port: http-metrics
prometheus.io/scrape: "true"
spec:
serviceAccountName: api-logger-promtail-ac
automountServiceAccountToken: true
containers:
- name: api-logger-promtail
image: git.ego.freeddns.org/egommerce/api-logger-promtail:dev
imagePullPolicy: Always
env:
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
divisor: '1'
resource: limits.cpu
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
divisor: '1'
resource: limits.memory
ports:
- name: promtail-http
containerPort: 3101
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 50m
memory: 128Mi
livenessProbe:
httpGet:
path: /ready
port: promtail-http
initialDelaySeconds: 45
readinessProbe:
httpGet:
path: /ready
port: promtail-http
initialDelaySeconds: 45
volumeMounts:
# - name: api-logger-promtail-config
# mountPath: /etc/promtail
- name: api-logger-promtail-run
mountPath: /run/promtail
- name: api-logger-promtail-varlog
mountPath: /var/log
readOnly: true
- name: api-logger-promtail-docker
mountPath: /var/lib/docker/containers
readOnly: true
- name: api-logger-promtail-tmp
mountPath: /tmp
subPath: tmp
readOnly: false
securityContext:
privileged: true
readOnlyRootFilesystem: true
runAsUser: 0
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
terminationGracePeriodSeconds: 60
volumes:
- name: api-logger-promtail-run
hostPath:
path: /run/promtail
- name: api-logger-promtail-varlog
hostPath:
path: /var/log
- name: api-logger-promtail-docker
hostPath:
path: /var/lib/docker/containers
- name: api-logger-promtail-tmp
emptyDir:
sizeLimit: 1Gi
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: api-logger-prometheus-pv
namespace: egommerce
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
storageClassName: api-logger-prometheus-pv
hostPath:
path: "/home/keedosn/.egommerce/prometheus" # Ensure this path exists on the node
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: api-logger-prometheus-pvc
namespace: egommerce
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
#storageClassName: api-logger-prometheus-pv
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: api-logger-prometheus
namespace: egommerce
labels:
name: api-logger-prometheus
annotations: {}
---
apiVersion: v1
kind: Service
metadata:
name: api-logger-prometheus
namespace: egommerce
labels:
app: api-logger-prometheus
spec:
type: NodePort
selector:
app: api-logger-prometheus
ports:
- name: api-logger-prometheus
protocol: TCP
port: 9090
nodePort: 31402
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-logger-prometheus
namespace: egommerce
labels:
app: api-logger-prometheus
spec:
# revisionHistoryLimit: 1
# replicas: 1
selector:
matchLabels:
app: api-logger-prometheus
template:
metadata:
labels:
app: api-logger-prometheus
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: prometheus-http
spec:
serviceAccountName: api-logger-prometheus
automountServiceAccountToken: true
securityContext:
runAsGroup: 10001
runAsUser: 10001
runAsNonRoot: true
containers:
- name: api-logger-prometheus
image: git.ego.freeddns.org/egommerce/api-logger-prometheus:dev
imagePullPolicy: Always
env:
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
divisor: '1'
resource: limits.cpu
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
divisor: '1'
resource: limits.memory
args:
# - '--storage.tsdb.retention.time=15d'
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus/data/'
# - '--web.console.libraries=/etc/prometheus/console_libraries'
# - '--web.console.templates=/etc/prometheus/consoles'
# - '--enable-feature=concurrent-rule-eval,promql-experimental-functions,exemplar-storage,promql-per-step-stats,native-histograms'
# - '--web.enable-remote-write-receiver'
# - '--web.enable-otlp-receiver'
# - '--web.enable-lifecycle'
- '--log.level=info'
# - '--log.format=json'
ports:
- name: prometheus-http
containerPort: 9090
# livenessProbe:
# httpGet:
# path: /-/healthy
# port: prometheus-http
# readinessProbe:
# httpGet:
# path: /-/ready
# port: prometheus-http
resources:
limits:
cpu: 150m
memory: 894Mi
requests:
cpu: 100m
memory: 512Mi
volumeMounts:
# - name: config-volume
# mountPath: /etc/prometheus
# - name: config-volume
# mountPath: /etc/config/alerting_rules.yml
# subPath: alerting_rules.yml
- name: api-logger-prometheus-storage
mountPath: /prometheus/data
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: false #true DEFAULT !!!
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
volumes:
- name: api-logger-prometheus-storage
persistentVolumeClaim:
claimName: api-logger-prometheus-pvc
---
apiVersion: v1
kind: Service
metadata:
name: api-logger-grafana
namespace: egommerce
labels:
app: api-logger-grafana
spec:
type: NodePort
selector:
app: api-logger-grafana
ports:
- name: api-logger-grafana-api
protocol: TCP
port: 3000
nodePort: 31400
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: api-logger-grafana-pv
namespace: egommerce
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
storageClassName: api-logger-grafana-pv
hostPath:
path: "/home/keedosn/.egommerce/grafana" # Ensure this path exists on the node
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: api-logger-grafana-pvc
namespace: egommerce
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
#storageClassName: api-logger-grafana-pv
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-logger-grafana
namespace: egommerce
labels:
app: api-logger-grafana
spec:
revisionHistoryLimit: 1
replicas: 1
selector:
matchLabels:
app: api-logger-grafana
template:
metadata:
labels:
app: api-logger-grafana
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "3000"
filter.by.port.name: "true"
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsGroup: 65534
runAsUser: 65534
initContainers:
- name: curl
image: curlimages/curl:latest
imagePullPolicy: IfNotPresent
command:
- /bin/sh
args:
- -c
- |
which curl
volumeMounts:
- name: api-logger-grafana-storage
mountPath: /var/lib/grafana
subPath: grafana
containers:
- name: api-logger-grafana
image: git.ego.freeddns.org/egommerce/api-logger-grafana:dev
imagePullPolicy: Always
env:
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
divisor: '1'
resource: limits.cpu
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
divisor: '1'
resource: limits.memory
ports:
- containerPort: 3000
resources:
limits:
cpu: 100m
memory: 768Mi
requests:
cpu: 50m
memory: 512Mi
volumeMounts:
- name: api-logger-grafana-storage
mountPath: /var/lib/grafana
subPath: grafana
- name: api-logger-grafana-storage
mountPath: /var/lib/grafana/dashboards
subPath: dashboards
- name: api-logger-grafana-storage
mountPath: /tmp
subPath: tmp
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
volumes:
- name: api-logger-grafana-storage
persistentVolumeClaim:
claimName: api-logger-grafana-pvc

134
deploy/k8s/catalog-svc.yml Normal file
View File

@@ -0,0 +1,134 @@
apiVersion: v1
kind: Service
metadata:
name: catalog-svc
namespace: egommerce
annotations:
haproxy.org/check: "true"
# haproxy.org/server-ca: "egommerce/ca-root"
labels:
app: catalog-svc
spec:
type: NodePort
selector:
app: catalog-svc
ports:
- name: catalog-svc
port: 443
nodePort: 31820
# - name: catalog-svc-metrics
# port: 9090
# nodePort: 31811
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: catalog-svc
namespace: egommerce
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1 # Number of extra pods that can be created during update
maxUnavailable: 1 # Max number of pods that can be unavailable during update
selector:
matchLabels:
app: catalog-svc
template:
metadata:
labels:
app: catalog-svc
spec:
# initContainers:
# - name: catalog-svc-init
# image: busybox:1.28
# command: [
# 'sh',
# '-c',
# '/bin/migrate'
# ]
containers:
- name: catalog-svc
image: git.ego.freeddns.org/egommerce/catalog-svc:dev
imagePullPolicy: Always
env:
- name: APP_NAME
value: catalog-svc
- name: APP_DOMAIN
value: catalog-svc.egommerce.local
- name: APP_PATH_PREFIX
value: /catalog
- name: API_EVENTBUS_URL
value: amqp://guest:guest@api-eventbus:5672
- name: API_MONGODB_URL
value: mongodb://mongodb:12345678@mongo-db:27017
readinessProbe:
httpGet:
scheme: HTTPS
port: catalog-svc
path: /health
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 1
livenessProbe:
httpGet:
scheme: HTTPS
port: catalog-svc
path: /health
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 1
volumeMounts:
- name: catalog-cert
mountPath: /certs/catalog-svc.crt
readOnly: true
- name: catalog-key
mountPath: /certs/catalog-svc.key
readOnly: true
- name: catalog-migrations
mountPath: /migrations
readOnly: true
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 50m
memory: 256Mi
ports:
- name: catalog-svc
containerPort: 443
# - name: catalog-svc-metrics
# image: prom/prometheus-exporter:latest
# ports:
# - containerPort: 9090
# args:
# - --web.listen-address=:9090
# - --web.telemetry-path=/metrics
- name: identity-scheduler # Scheduler Container
image: git.ego.freeddns.org/egommerce/identity-svc:dev
imagePullPolicy: Always
command: [
"/usr/local/bin/scheduler"
]
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 50m
memory: 256Mi
volumes:
- name: catalog-cert
hostPath:
path: /egommerce/stack/deploy/certs/catalog-svc/catalog-svc.crt
type: File
- name: catalog-key
hostPath:
path: /egommerce/stack/deploy/certs/catalog-svc/catalog-svc.key
type: File
- name: catalog-migrations
hostPath:
path: /egommerce/stack/deploy/db_migrations/catalog-svc
type: Directory

119
deploy/k8s/db-postgres.yml Normal file
View File

@@ -0,0 +1,119 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: db-postgres-pv
namespace: egommerce
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
storageClassName: db-postgres-pv
hostPath:
path: "/home/keedosn/.egommerce/postgres" # Ensure this path exists on the node
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: db-postgres-pvc
namespace: egommerce
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
#storageClassName: db-postgres-pv
---
apiVersion: v1
kind: Service
metadata:
name: db-postgres
namespace: egommerce
labels:
app: db-postgres
spec:
type: NodePort
selector:
app: db-postgres
ports:
- name: db-postgres
protocol: TCP
port: 5432
nodePort: 31500
# ---
# apiVersion: v1
# kind: Service
# metadata:
# name: db-postgres-metrics
# namespace: egommerce
# labels:
# app: db-postgres
# spec:
# type: NodePort
# selector:
# app: db-postgres
# ports:
# - name: db-postgres
# protocol: TCP
# port: 9187
# nodePort: 31501
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: db-postgres
namespace: egommerce
spec:
replicas: 1
selector:
matchLabels:
app: db-postgres
template:
metadata:
labels:
app: db-postgres
spec:
securityContext:
runAsUser: 70 # postgres user
fsGroup: 70 # postgres user
# remember to change perms and owner of ~/.egommerce/postgres directory
containers:
- name: db-postgres
image: git.ego.freeddns.org/egommerce/db-postgres:dev
imagePullPolicy: Always
env:
- name: APP_NAME
value: db-postgres
- name: APP_DOMAIN
value: db-postgres.egommerce.local
- name: POSTGRES_USER
value: egommerce
- name: POSTGRES_DB
value: egommerce
- name: POSTGRES_PASSWORD
# value: H5Gd7^37*Hka*a72
value: "12345678"
- name: PGDATA
value: /var/lib/postgresql/data
resources:
limits:
cpu: "1"
memory: 512M
ports:
- containerPort: 5432
volumeMounts:
- name: db-postgres-data
mountPath: /var/lib/postgresql/data
# subPath: data
- name: db-postgres-metrics
image: prometheuscommunity/postgres-exporter:latest
ports:
- containerPort: 9187
env:
- name: DATA_SOURCE_NAME
value: "postgresql://postgres:12345678@db-postgres:5432/egommerce" #?sslmode=disable
volumes:
- name: db-postgres-data
persistentVolumeClaim:
claimName: db-postgres-pvc

134
deploy/k8s/identity-svc.yml Normal file
View File

@@ -0,0 +1,134 @@
apiVersion: v1
kind: Service
metadata:
name: identity-svc
namespace: egommerce
annotations:
haproxy.org/check: "true"
# haproxy.org/server-ca: "egommerce/ca-root"
labels:
app: identity-svc
spec:
type: NodePort
selector:
app: identity-svc
ports:
- name: identity-svc
port: 443
nodePort: 31810
# - name: identity-svc-metrics
# port: 9090
# nodePort: 31811
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: identity-svc
namespace: egommerce
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1 # Number of extra pods that can be created during update
maxUnavailable: 1 # Max number of pods that can be unavailable during update
selector:
matchLabels:
app: identity-svc
template:
metadata:
labels:
app: identity-svc
spec:
# initContainers:
# - name: identity-svc-init
# image: busybox:1.28
# command: [
# 'sh',
# '-c',
# '/bin/migrate'
# ]
containers:
- name: identity-svc
image: git.ego.freeddns.org/egommerce/identity-svc:dev
imagePullPolicy: Always
env:
- name: APP_NAME
value: identity-svc
- name: APP_DOMAIN
value: identity-svc.egommerce.local
- name: APP_PATH_PREFIX
value: /identity
- name: API_EVENTBUS_URL
value: amqp://guest:guest@api-eventbus:5672
- name: API_MONGODB_URL
value: mongodb://mongodb:12345678@mongo-db:27017
readinessProbe:
httpGet:
scheme: HTTPS
port: identity-svc
path: /health
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 1
livenessProbe:
httpGet:
scheme: HTTPS
port: identity-svc
path: /health
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 1
volumeMounts:
- name: identity-cert
mountPath: /certs/identity-svc.crt
readOnly: true
- name: identity-key
mountPath: /certs/identity-svc.key
readOnly: true
- name: identity-migrations
mountPath: /migrations
readOnly: true
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 50m
memory: 256Mi
ports:
- name: identity-svc
containerPort: 443
# - name: identity-svc-metrics
# image: prom/prometheus-exporter:latest
# ports:
# - containerPort: 9090
# args:
# - --web.listen-address=:9090
# - --web.telemetry-path=/metrics
- name: identity-scheduler # Scheduler Container
image: git.ego.freeddns.org/egommerce/identity-svc:dev
imagePullPolicy: Always
command: [
"/usr/local/bin/scheduler"
]
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 50m
memory: 256Mi
volumes:
- name: identity-cert
hostPath:
path: /egommerce/stack/deploy/certs/identity-svc/identity-svc.crt
type: File
- name: identity-key
hostPath:
path: /egommerce/stack/deploy/certs/identity-svc/identity-svc.key
type: File
- name: identity-migrations
hostPath:
path: /egommerce/stack/deploy/db_migrations/identity-svc
type: Directory

6
deploy/k8s/namespace.yml Normal file
View File

@@ -0,0 +1,6 @@
kind: Namespace
apiVersion: v1
metadata:
name: egommerce
labels:
name: egommerce

8
deploy/k8s/secret.yml Normal file
View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: regcred
namespace: egommerce
data:
.dockerconfigjson: ewoJImF1dGhzIjogewoJCSJnaXQuZWdvLmNsb3VkbnMuYmUiOiB7CgkJCSJhdXRoIjogImEyVmxaRzl6YmpwWGIyeHVaVFZQY0hKdlozSmhiVzkzWVc1cFpVQT0iCgkJfSwKCQkiaHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEvIjogewoJCQkiYXV0aCI6ICJhMlZsWkc5emJqcGtiMk5yWlhKdmQyVTFiMkp5WVhwNSIKCQl9Cgl9Cn0=
type: kubernetes.io/dockerconfigjson

187
deploy/scripts/gen-certs.sh Executable file
View File

@@ -0,0 +1,187 @@
#!/bin/bash
export DEPLOY_DIR="./deploy"
export CERTS_DIR="${DEPLOY_DIR}/certs/"
export GATEWAY_CN="egommerce.io,gateway.egommerce.local,api-gatway"
export GATEWAY_SAN="DNS:egommerce.io,DNS:gateway.egommerce.local,DNS:api-gateway,IP:127.0.0.1"
export EVENTBUS_CN="esb.egommerce.local,api-eventbus"
export EVENTBUS_SAN="DNS:esb.egommerce.local,DNS:api-eventbus,IP:127.0.0.1"
export CACHE_CN="cache.egommerce.local,api-cache"
export CACHE_SAN="DNS:cache.egommerce.local,DNS:api-cache,IP:127.0.0.1"
export LOGGER_CN="logger.egommerce.local,api-logger"
export LOGGER_SAN="DNS:logger.egommerce.local,DNS:api-logger,IP:127.0.0.1"
# export PROMETHEUS_CN="prometheus.egommerce.local,api-prometheus"
# export PROMETHEUS_SAN="DNS:prometheus.egommerce.local,DNS:api-prometheus,IP:127.0.0.1"
# export GRAFANA_CN="grafana.egommerce.local,api-grafana"
# export GRAFANA_SAN="DNS:grafana.egommerce.local,DNS:api-grafana,IP:127.0.0.1"
export POSTGRES_CN="db-postgres.egommerce.local,db-postgres"
export POSTGRES_SAN="DNS:db-postgres.egommerce.local,DNS:db-postgres,IP:127.0.0.1"
# export MONGO_CN="mongo.db.egommerce.local,db-mongo"
# export MONGO_SAN="DNS:mongo.db.egommerce.local,DNS:db-mongo,IP:127.0.0.1"
export IDENTITY_CN="identity-svc.egommerce.local"
export IDENTITY_SAN="DNS:identity-svc.egommerce.local,IP:127.0.0.1"
export CATALOG_CN="catalog-svc.egommerce.local,catalog-svc"
export CATALOG_SAN="DNS:catalog-svc.egommerce.local,DNS:catalog-svc,IP:127.0.0.1"
export BASKET_CN="basket-svc.egommerce.local,basket-svc"
export BASKET_SAN="DNS:basket-svc.egommerce.local,DNS:basket-svc,IP:127.0.0.1"
export ORDER_CN="order-svc.egommerce.local,order-svc"
export ORDER_SAN="DNS:order-svc.egommerce.local,DNS:order-svc,IP:127.0.0.1"
export PRICING_CN="DNS:pricing-svc.egommerce.local,DNS:pricing-svc"
export PRICING_SAN="DNS:pricing-svc.egommerce.local,DNS:pricing-svc,IP:127.0.0.1"
# Create required directories
mkdir -p \
${CERTS_DIR} \
${CERTS_DIR}ca-root \
${CERTS_DIR}api-gateway \
${CERTS_DIR}api-eventbus \
${CERTS_DIR}api-cache \
${CERTS_DIR}api-logger \
${CERTS_DIR}db-postgres \
${CERTS_DIR}identity-svc \
${CERTS_DIR}basket-svc \
${CERTS_DIR}catalog-svc \
${CERTS_DIR}order-svc \
${CERTS_DIR}pricing-svc
# Generate Root CA cert
openssl req -newkey rsa:2048 -nodes -x509 -days 1024 \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/OU=DevOps Team/CN=Egommerce CA" \
-keyout ${CERTS_DIR}ca-root/ca-root.key -out ${CERTS_DIR}ca-root/ca-root.crt >/dev/null
# Create fullchain pem file
cat ${CERTS_DIR}ca-root/ca-root.key ${CERTS_DIR}ca-root/ca-root.crt > ${CERTS_DIR}ca-root/ca-root.pem
# Generate Gateway cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$GATEWAY_CN" \
-keyout ${CERTS_DIR}api-gateway/api-gateway.key \
-out ${CERTS_DIR}api-gateway/api-gateway.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}api-gateway/api-gateway.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${GATEWAY_SAN}")) \
-out ${CERTS_DIR}api-gateway/api-gateway.crt >/dev/null
# Create fullchain pem file
cat ${CERTS_DIR}api-gateway/api-gateway.key ${CERTS_DIR}api-gateway/api-gateway.crt > ${CERTS_DIR}api-gateway/api-gateway.pem
# Generate Eventbus cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$EVENTBUS_CN" \
-keyout ${CERTS_DIR}api-eventbus/api-eventbus.key \
-out ${CERTS_DIR}api-eventbus/api-eventbus.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}api-eventbus/api-eventbus.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${EVENTBUS_SAN}")) \
-out ${CERTS_DIR}api-eventbus/api-eventbus.crt >/dev/null
# Generate Cache cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$CACHE_CN" \
-keyout ${CERTS_DIR}api-cache/api-cache.key \
-out ${CERTS_DIR}api-cache/api-cache.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}api-cache/api-cache.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${CACHE_SAN}")) \
-out ${CERTS_DIR}api-cache/api-cache.crt >/dev/null
# Generate Logger cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$LOGGER_CN" \
-keyout ${CERTS_DIR}api-logger/api-logger.key \
-out ${CERTS_DIR}api-logger/api-logger.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}api-logger/api-logger.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${LOGGER_SAN}")) \
-out ${CERTS_DIR}api-logger/api-logger.crt >/dev/null
# Generate Postgres cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$POSTGRES_CN" \
-keyout ${CERTS_DIR}db-postgres/db-postgres.key \
-out ${CERTS_DIR}db-postgres/db-postgres.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}db-postgres/db-postgres.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${POSTGRES_SAN}")) \
-out ${CERTS_DIR}db-postgres/db-postgres.crt >/dev/null
# Generate Identity cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$IDENTITY_CN" \
-keyout ${CERTS_DIR}identity-svc/identity-svc.key \
-out ${CERTS_DIR}identity-svc/identity-svc.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}identity-svc/identity-svc.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${IDENTITY_SAN}")) \
-out ${CERTS_DIR}identity-svc/identity-svc.crt >/dev/null
# Generate Basket cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$BASKET_CN" \
-keyout ${CERTS_DIR}basket-svc/basket-svc.key \
-out ${CERTS_DIR}basket-svc/basket-svc.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}basket-svc/basket-svc.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${BASKET_SAN}")) \
-out ${CERTS_DIR}basket-svc/basket-svc.crt >/dev/null
# Generate Catalog cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$CATALOG_CN" \
-keyout ${CERTS_DIR}catalog-svc/catalog-svc.key \
-out ${CERTS_DIR}catalog-svc/catalog-svc.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}catalog-svc/catalog-svc.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${CATALOG_SAN}")) \
-out ${CERTS_DIR}catalog-svc/catalog-svc.crt >/dev/null
# Generate Order cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$ORDER_CN" \
-keyout ${CERTS_DIR}order-svc/order-svc.key \
-out ${CERTS_DIR}order-svc/order-svc.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}order-svc/order-svc.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${ORDER_SAN}")) \
-out ${CERTS_DIR}order-svc/order-svc.crt >/dev/null
# Generate Pricing cert
openssl req -newkey rsa:2048 -nodes \
-subj "/C=PL/ST=Silesia/L=Gliwice/O=Egommerce.dev/CN=$PRICING_CN" \
-keyout ${CERTS_DIR}pricing-svc/pricing-svc.key \
-out ${CERTS_DIR}pricing-svc/pricing-svc.csr >/dev/null
openssl x509 -req -days 365 \
-in ${CERTS_DIR}pricing-svc/pricing-svc.csr -CA ${CERTS_DIR}ca-root/ca-root.crt \
-CAkey ${CERTS_DIR}ca-root/ca-root.key -set_serial 01 \
-extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=${PRICING_SAN}")) \
-out ${CERTS_DIR}pricing-svc/pricing-svc.crt >/dev/null

View File

@@ -0,0 +1,21 @@
#!/bin/sh
alias kubectl="microk8s kubectl" # MicroK8S fix
# Install plugins
microk8s enable dns
# microk8s enable ingress
# microk8s enable storage
# microk8s enable helm3
# microk8s enable metallb:10.64.0.100-10.64.0.200
# API Gateway CRDs
# kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/latest/download/standard-install.yaml
# kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/webhook-install.yaml
# Create ca root tls secret
kubectl create secret tls ca-root --cert=deploy/certs/ca-root/ca-root.crt --key=deploy/certs/ca-root/ca-root.key -n egommerce
# kubectl annotate secret ca-root haproxy.org/server-ca="egommerce/ca-root" -n egommerce
# Create api-gateway tls secret
kubectl create secret tls api-gateway-cert --cert=deploy/certs/api-gateway/api-gateway.crt --key=deploy/certs/api-gateway/api-gateway.key -n egommerce

View File

@@ -0,0 +1,21 @@
#!/bin/sh
# RUN IT FORM THE REPO ROOT DIR
alias kubectl="microk8s kubectl" # MicroK8S fix
echo "Starting egommerce k8s stack..."
kubectl apply -f deploy/k8s/namespace.yml
kubectl apply -f deploy/k8s/secret.yml
kubectl apply -f deploy/k8s/api-gateway.yml
kubectl apply -f deploy/k8s/api-eventbus.yml
kubectl apply -f deploy/k8s/api-cache.yml
kubectl apply -f deploy/k8s/api-logger.yml
kubectl apply -f deploy/k8s/db-postgres.yml
# kubectl apply -f deploy/k8s/db-mongo.yml
kubectl apply -f deploy/k8s/identity-svc.yml
kubectl apply -f deploy/k8s/catalog-svc.yml
echo "Done."

View File

@@ -0,0 +1,21 @@
#!/bin/sh
# RUN IT FORM THE REPO ROOT DIR
alias kubectl="microk8s kubectl" # MicroK8S fix
echo "Stopping egommerce k8s stack..."
kubectl delete -f deploy/k8s/identity-svc.yml
kubectl delete -f deploy/k8s/catalog-svc.yml
# kubectl delete -f deploy/k8s/db-mongo.yml
kubectl delete -f deploy/k8s/db-postgres.yml
kubectl delete -f deploy/k8s/api-logger.yml
kubectl delete -f deploy/k8s/api-cache.yml
kubectl delete -f deploy/k8s/api-eventbus.yml
kubectl delete -f deploy/k8s/api-gateway.yml
kubectl delete -f deploy/k8s/secret.yml
# kubectl delete -f deploy/k8s/namespace.yml
echo "Done."

3
go.mod
View File

@@ -1,3 +0,0 @@
module git.pbiernat.dev/egommerce/application
go 1.18

View File

@@ -0,0 +1,140 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2267340490403840,
"links": [],
"panels": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"footer": {
"reducers": []
},
"hideFrom": {
"viz": false
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Time"
},
"properties": [
{
"id": "custom.width",
"value": 153
}
]
},
{
"matcher": {
"id": "byName",
"options": "Line"
},
"properties": [
{
"id": "custom.width",
"value": 986
}
]
}
]
},
"gridPos": {
"h": 16,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"cellHeight": "sm",
"showHeader": true,
"sortBy": [
{
"desc": false,
"displayName": "tsNs"
}
]
},
"pluginVersion": "12.2.0",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"direction": "backward",
"editorMode": "builder",
"expr": "{app=\"api-cache\"} |= ``",
"queryType": "range",
"refId": "A"
}
],
"title": "API Cache Logs",
"type": "table"
}
],
"preload": false,
"refresh": "5s",
"schemaVersion": 42,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "API Cache Logs",
"uid": "ad7sctw",
"version": 3
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,152 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2231809731538944,
"links": [],
"panels": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"footer": {
"reducers": []
},
"hideFrom": {
"viz": false
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Time"
},
"properties": [
{
"id": "custom.width",
"value": 188
}
]
},
{
"matcher": {
"id": "byName",
"options": "labels"
},
"properties": [
{
"id": "custom.width",
"value": 50
}
]
},
{
"matcher": {
"id": "byName",
"options": "Line"
},
"properties": [
{
"id": "custom.width",
"value": 1045
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"cellHeight": "sm",
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Time"
}
]
},
"pluginVersion": "12.2.0",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"direction": "backward",
"editorMode": "builder",
"expr": "{app=\"api-eventbus\"} |= ``",
"queryType": "range",
"refId": "A"
}
],
"title": "API Eventbus Logs",
"type": "table"
}
],
"preload": false,
"refresh": "5s",
"schemaVersion": 42,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "API Eventbus Logs",
"uid": "addld9d",
"version": 2
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2292411350208512,
"links": [],
"panels": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"footer": {
"reducers": []
},
"hideFrom": {
"viz": false
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Time"
},
"properties": [
{
"id": "custom.width",
"value": 155
}
]
},
{
"matcher": {
"id": "byName",
"options": "Line"
},
"properties": [
{
"id": "custom.width",
"value": 990
}
]
}
]
},
"gridPos": {
"h": 15,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"cellHeight": "sm",
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Time"
}
]
},
"pluginVersion": "12.2.0",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"direction": "backward",
"editorMode": "builder",
"expr": "{app=\"api-gateway\"} |= ``",
"queryType": "range",
"refId": "A"
}
],
"title": "API Gateway Logs",
"type": "table"
}
],
"preload": false,
"refresh": "5s",
"schemaVersion": 42,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "API Gateway Logs",
"uid": "adct2hs",
"version": 4
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2293973304823808,
"links": [],
"panels": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"footer": {
"reducers": []
},
"hideFrom": {
"viz": false
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Time"
},
"properties": [
{
"id": "custom.width",
"value": 151
}
]
},
{
"matcher": {
"id": "byName",
"options": "Line"
},
"properties": [
{
"id": "custom.width",
"value": 992
}
]
}
]
},
"gridPos": {
"h": 15,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"cellHeight": "sm",
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Time"
}
]
},
"pluginVersion": "12.2.0",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"direction": "backward",
"editorMode": "builder",
"expr": "{app=\"identity-svc\"} |= ``",
"queryType": "range",
"refId": "A"
}
],
"title": "Identity SVC Logs",
"type": "table"
}
],
"preload": false,
"refresh": "5s",
"schemaVersion": 42,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "Identity SVC Logs",
"uid": "adck5c7",
"version": 3
}

Submodule services/basket deleted from c4134dc7a2

Submodule services/catalog deleted from cc115fb4c9