Installing agents
Kube State Metrics
Kube-state-metrics (KSM) is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects. The metrics are exported on the HTTP endpoint /metrics on the listening port (default 8080).
Deploying KSM
- Clone the repo: https://github.com/kubernetes/kube-state-metrics
- Use the following command.
Verifying if KSM is deployed successfully
- Check the service.
- Check the pod.
If both service and pods are created, KSM is deployed successfully.
cAdvisor
cAdvisor (Container Advisor) provides container users with an understanding of the resource usage and performance characteristics of their running containers. It is a running daemon that collects, aggregates, processes, and exports information about running containers. It has a UI and the metrics are exported on the HTTP endpoint/metrics on the listening port (default 8080). Also, cAdvisor uses Kustomize to manage kubernetes yaml files.
Deploying cAdvisor
- Clone the repo: https://github.com/google/cadvisor
- Use the following command.
Create a kubernetes service object for cadvisor in cadvisor namespace and map it to the 8080 port of the container.
Example: Sample file for cadvisor-svc.yaml:
Verify if cAdvisor is deployed successfully
- Check the service.
- Check the pod.
If both service and pods are created, cAdvisor is deployed successfully.
SixthSense Kubernetes Agent
Deploying the agent
- Download the Docker image
- docker login gitlab-registry.34.120.183.186.sslip.io
- username & password: (create new read only user for tenant, and share credentials)
- latest version: latest
- docker pull gitlab-registry.34.120.183.186.sslip.io/sixthsense/sixthsense-mvn-dependency/sixthsense-kubernetes-agent:agent-version
note
If the instances are behind corporate proxy, Docker pull will not work. Corporate proxy information must be set in Docker config in the URL -- https://docs.docker.com/network/proxy/#configure-the-docker-client.
- Create a clusterrole and clusterrolebinding in order to allow agent to fetch the metrics.
Filename: sixthsense-clusterrole.yml
- Create a deployment using the Docker image.
Sample Deployment file: Name: sixthsense-k8-deploy.yml
- Check the pod status.