- Running kubernetes cluster. Use Orbstack or kind
- Helm
- Kompose: a conversion tool for Docker Compose to container orchestrators such as Kubernetes (or OpenShift)
We need to push docker image to a registry. If you don't want to use docker hub or similar public registries you can create a private one. Check this instructions
- Add helm repository:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
- Update repository:
helm repo update
- Install kube-prometheus-stack from
kubernetes/helm/kube-prometheus-stack
directory:helm upgrade -f values.yml kube-prometheus-stack --create-namespace --namespace kube-prometheus-stack prometheus-community/kube-prometheus-stack
Run: kompose convert
in the root directory (where docker-compose.yaml file is).
NOTE: I moved the generated files to
kubernetes/resources
directory manually
Edit generated kompose resources:
- In
app-service.yaml
add annotationsprometheus.io/scrape: "true" prometheus.io/path: "/actuator/prometheus"
- In
app-deployment.yaml
updateimage: 192.168.2.80:5000/jzoric/cash-compass-app:2
to use your image
For this first version, we can use our simple resource yaml files that we can apply to the cluster.
In the future versions we will explore other options like Kustomize, Helm, jsonnet etc.
TODO:
- Document Prometheus scrape config
- Check: Grafana dashboards
- Document: Port forward for monitoring stack (Grafana and Prometheus)