We saw some of the effects that can be caused by a discrepancy between resource usage and resource specification. It's only natural that we should adjust our specification to reflect the actual memory and CPU usage better.
Let's start with the database:
DB_POD_NAME=$(kubectl get pods \
-l service=go-demo-2 \
-l type=db \
-o jsonpath="{.items[0].metadata.name}")
curl "$BASE_URL/$DB_POD_NAME/containers/db/metrics/memory/usage"
curl "$BASE_URL/$DB_POD_NAME/containers/db/metrics/cpu/usage_rate"
We retrieved the name of the database Pod and used it to obtain memory and CPU usage of the db container. As a result, we now know that memory usage is somewhere between 30Mi and 40Mi. Similarly, we know that the CPU consumption is somewhere around 5m
Let's take the same metrics for...