To clone and run the application, you will need to have Kubectl, k3s, Helm installed on your machine. With all programs installed, run the following command lines:
# Clone this repository
$ git clone https://github.com/moroleandro/stack-k3d
# Access the repository
$ cd stack-k3d/app
# Build image
$ docker build -t [repository-docker-hub]/api-produto:v1.0.0
# Push image
$ docker push [repository-docker-hub]/api-produto:v1.0.0
# Create cluster using k3d
$ k3d cluster create --servers 1 --agents 2 -p "8080:30000@loadbalancer" -p "8181:30001@loadbalancer" -p "8282:30002@loadbalancer"
# Apply manifests kubernetes
$ kubectl apply -f ./kubernetes/
# Access dashboard swagger of add products
http://localhost:8080/api-docs/
##################
### MONITORING ###
###################
# Add repo helm prometheus
$ helm3 repo add prometheus-community https://prometheus-community.github.io/helm-charts
$ helm3 repo update
# Install prometheus on cluster
$ helm3 install prometheus prometheus-community/prometheus --values ./prometheus/values.yaml
# Dashboard grafana
$ localhost:8181
# Add repo helm grafana
$ helm3 repo add grafana https://grafana.github.io/helm-charts
$ helm3 repo update
# Install grafana on cluster
$ helm3 install grafana grafana/grafana --values ./grafana/values.yaml
# Dashboard grafana
$ localhost:8282
@moroleandro