Kubernetes Monitoring
Monitor metrics from Kubernetes
This manual is for Kubernetes with minikub on a virtual machine running the Linux Ubuntu operating system.
Quickstart
Step 1 - Preparation
Minikube must be running with Kubernetes version <=v1.23.0 and the Kubernetes API must be exposed.
The recommended way to expose the API is to redirect the API port (default is 8443
). This can be done with the following command:
Step 2 - Installation
In Kubernetes, you must install kube-state-metrics and cAdvisor (cAdvisor is integrated into kubelet by default).
Step 3 - kube-state-metrics
For the purposes of the instructions, we used the example provided here.
After downloading the entire folder to the virtual machine with Kubernetes, we type the following command:
Step 4 - Data collector
The next step is to add a data collector to collect data from Kubernetes and send it to the OAP.
Download:
Then set the RevDeBug server address in the open-telemetry file - REVDEBUG_SERVER_NAME
.
Then in the same file name your cluster k8s (in two places) - YOUR_CLUSTER_NAME
.
Step 5 - Running
Run the deployment of these files after by:
Step 6 - Setup
You need to copy the contents of the .kube/config
file for Linux the full path is /home/your_user/.kube/config
Then copy the 3 certificates whose paths are given in the config file:
/home/ubuntu/.minikube/ca.crt
/home/ubuntu/.minikube/profiles/minikube/client.crt
/home/ubuntu/.minikube/profiles/minikube/client.key
In the next step, switch to the server with RevDeBug:
Go to the
/var/revdebug/apm-oap/config/k8s
folder - if the folder does not exist then create it.Create a new file starting with config, e.g.
config-cluster1
,config-name
.Next, create a folder where we will keep the previously downloaded keys, for example:
name_your_folder_with_certs
.In the
config-your_name
file, we paste the contents of our config from minikub.We are adjusting the verifier paths to the RevDeBug container:
We adjust the Kubernetes address - by default, there is an internal API set the address of your Kubernetes/Port API that we exposed at the beginning. Important: always https.
Step 7 - Environment variables
Go to the folder with docker-compose on the RevDeBug server. Add the following variables to the .env
file:
SW_OTEL_RECEIVER_ENABLED_HANDLERS="oc"
SW_OTEL_RECEIVER=default
SW_OTEL_RECEIVER_ENABLED_OC_RULES=k8s-cluster,k8s-node,k8s-service
If you have virtual machine monitoring set up then do not remove SW_OTEL_RECEIVER_ENABLED_OC_RULES:vm,oap
just add more rules after the comma.
Step 8 - Down/up RevDeBug compose
If you want to enable Kubernetes monitoring option, please contact sales@revdebug.com
Last updated