Create cluster: task minikube:create-cluster
Deploy PostgreSQL: task postgres:deploy POSTGRES_PASSWORD=<password>
- Create an user in PostgreSQL
- Create a database in PostgreSQL, with the same name as in POSTGRES_DB
- Build-Image:
task config-server:build-image - Create the config with the user credentials from step 1:
task config-server:create-config POSTGRES_USER=<user> POSTGRES_PASSWORD=<password> - Deploy app:
task config-server:deploy-app
- Create an user in PostgreSQL
- Create a database in PostgreSQL, with the same name
odins_oddities - Build-Image:
task product-service:build-image - Create the config with the user credentials from step 1:
task product-service:create-config POSTGRES_USER=<user> POSTGRES_PASSWORD=<password> - Deploy app:
task product-service:deploy-app
- Build-Image:
task event-generator:build-image - Create the config with the user credentials from step 1:
task event-generator:create-config - Deploy app:
task event-generator:deploy-app
Project: Kube-Prometheus
- Install using Helm Chart
helm install kube-prometheus oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack -n monitoring --create-namespace - Create a ServiceMonitor:
kubectl apply -f ./k8s/Prometheus/ServiceMonitor.yml - Prometheus & Grafana Dashboards can be accessed with:
- Prometheus:
kubectl --namespace monitoring port-forward svc/prometheus-operated 9090 - Grafana:
kubectl --namespace monitoring port-forward svc/kube-prometheus-grafana 3000:80
- Prometheus:
Run: task <service>:port-forward
- Create .env file:
CONFIG_SERVER_URI=http://localhost:8888
SPRING_PROFILES_ACTIVE=local
POSTGRES_USER=<user>
POSTGRES_PASSWORD=<password>
- Add
"envFile": "${workspaceFolder}/.env"to.vscode/launch.json:
{
"type": "java",
"name": "ProductServiceApplication",
"request": "launch",
"mainClass": "productservice/de.jodabyte.springonk8slab.productservice.ProductServiceApplication",
"projectName": "product-service",
"envFile": "${workspaceFolder}/.env"
}
- Port-Forward PostgreSQL and Config Server
Open (Swagger UI)[http://localhost:8081/swagger-ui.html]
- The Event Generator needs the
.envfile - Add
"envFile": "${workspaceFolder}/.env"to.vscode/launch.json:
{
"type": "java",
"name": "EventGeneratorApplication",
"request": "launch",
"mainClass": "de.jodabyte.springonk8slab.eventgenerator.EventGeneratorApplication",
"projectName": "event-generator",
"envFile": "${workspaceFolder}/.env"
}
- Port-Forward Config-Server and Product-Service