diff --git a/.gitignore b/.gitignore index b0cc8bd..d31a3dd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ debug/ target/ *.profraw +*.crt +*.key diff --git a/README.md b/README.md index 2f3a930..fb4702f 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,35 @@ Web api application prototype written in rust ## Structure - `acl` - anti corruption layer implemented as kafka consumer -- `app` - application layer with endpoints +- `api` - application layer with endpoints - `domain` - business logic contracts (queries/commands interfaces) - `domain_impl` - implementation of buisiness logic contracts - `infra` - infrastructure layer (dal) - `host` - host process for application with composition root -- `integration-tests` - integration tests for application \ No newline at end of file +- `integration-tests` - integration tests for application + +## Dev environment + +- `docker` v24.0.6 +- `docker-compose` v2.23.0 +- `kubernetes` v1.28.2 +- `rustc` 1.72.1 +- `cargo` 1.72.1 + +For deploing with helm `/etc/hosts` require `127.0.0.1 dev-wep-api.com` entry for access to application in browser. + +## Up & Running + +From src folder: +- `docker-compose up -d` - up dev environment +- `run.sh` - run api application for local debuging +- `build.sh` - build all workspaces +- `build_images.sh` - build `acl` and `api` dev images +- `docker-compose --profile dev-build up -d` - up `acl` and `api` dev images with compose +- `format.sh` - format code +- `analyze.sh` - static analysis +- `run_tests.sh` - build and run tests + +From root folder: +- `generate_cert.sh` - generate self signed cert and create kubernetes secret +- `deploy_helm.sh` - deploy images to local kubernetes cluster \ No newline at end of file diff --git a/generate_cert.sh b/generate_cert.sh new file mode 100755 index 0000000..ac49064 --- /dev/null +++ b/generate_cert.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +openssl req \ +-x509 -newkey rsa:4096 -sha256 -nodes \ +-keyout tls.key -out tls.crt \ +-subj "/CN=ingress.local" -days 365 + +kubectl create secret tls api-secret \ + --cert=tls.crt \ + --key=tls.key diff --git a/helm/values.yaml b/helm/values.yaml index 57dc2aa..7bc9e41 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -70,7 +70,7 @@ api: memory: "128Mi" cpu: "500m" ingress: - host: foomyapp.com + host: dev-wep-api.com ingressClassName: nginx kafka: brokers: kafka-service:9092