Web application which holds and manages articles to read out.
Below you can find endpoints exposed by this microservice.
To collect metrics uses Prometheus.
Grafana monitors metrics
Set up following env variables. Easiest way is over .env file.
APP_AUTH_TOKEN_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
SPRING_DATASOURCE_USERNAME=
SPRING_DATASOURCE_PASSWORD=
Build with maven
mvn package -DskipTests
run locally
mvn spring-boot:run
test locally
http://localhost:8080
switch to angular directory
cd /angular
download all dependencies
npm install
run locally
npm run start
test locally
http://localhost:4200
Build a docker image using Dokerfile:
docker build -t webcane/readme-app-spring .
Run docker image locally
docker run --name readme-app-spring -p 8080:8080 webcane/readme-app-spring
Build docker image
docker build -t webcane/readme-app-angular ./angular
Run docker image locally
docker run --name readme-app-angular -p 4200:80 webcane/readme-app-angular
check if docker running
docker ps
stop the docker image
docker stop <container id>
Containers, by default, run in isolation and don’t know anything about other processes or containers on the same machine. So, allow one container to talk to another.
docker network create readme-app-net
docker run --network readme-app-net --network-alias app --name readme-app-spring -p 8080:8080 webcane/readme-app-spring
docker run --network readme-app-net --network-alias ui --name readme-app-angular -p 4200:80 webcane/readme-app-angular
Docker Compose is a tool that was developed to help define and share multi-container applications.
build containers for first time
docker-compose build
start back-end and front-end together
docker-compose up
docker-compose down -v
Push images to the container registry:
docker push webcane/readme-app-spring:latest
docker push webcane/readme-app-angular:latest
helm repo add bitnami https://charts.bitnami.com/bitnami
downloads the postgresql dependency
helm dependency update
Run tests to ensure that the chart is well-formed
helm lint ./helm
Deploy the ingress controller with the following command:
helm upgrade --install ingress-nginx ingress-nginx \
--repo https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx --create-namespace
It will validate and verify your chart by connecting to kubernetes api server and after successful validation it will render the manifest in the form of YAMLs (kubernetes resources) locally.
helm install readme-app ./helm --dry-run --debug
install readme-app
chart to the kubernetes cluster
helm install readme-app ./helm
provides required configs and secrets. It will be dynamically located in readme-app-env
ConfigMap and Secrets respectively and linked into deployment
helm install --set app.secrets.APP_AUTH_TOKEN_SECRET=*** \
--set app.secrets.SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_ID=*** \
--set app.secrets.SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_SECRET=*** \
--set postgresql.auth.password=*** --set postgresql.auth.postgresPassword=*** readme-app ./helm