Monitor Kubernetes

Monitor the different components of your container infrastructure using Site24x7's Kubernetes Monitoring and get a complete picture of the health and performance of your Kubernetes clusters.

Table of contents

Add a Monitor

Site24x7 supports Kubernetes monitoring in the following platforms: Azure (Azure Kubernetes Engine), AWS (Elastic Kubernetes Service) and AWS EKS Fargate, GCP (Google Kubernetes Engine), MicroK8s, Kind, K3s and on-premises.

To add a Kubernetes monitor, log in to your Site24x7 account and go to Server > Kubernetes > Clusters (+).

Method 1: DaemonSets

Configure Role-Based Access Control (RBAC) permissions and install Site24x7 agent as DaemonSet: 

  1. Download the site24x7-agent.yaml file and save it in your Cloud Shell or Master Node terminal.
  2. Copy and execute the below command to create the Secret and apply the YAML(Replace <device-key> with your device key):
    kubectl create secret generic site24x7-agent --from-literal KEY='<device-key>' && kubectl apply -f site24x7-agent.yaml
  3. Configure kube-state-metrics: Download the site24x7-kube-state-metrics.yaml file, and save it in your Cloud Shell or Master Node Terminal. Execute the below command to apply the YAML:
    kubectl apply -f site24x7-kube-state-metrics.yaml
Enable kube-state-metrics for monitoring advanced Kubernetes metrics.

Ensure the site24x7-agent pods are created and in running state. Please wait a few minutes for all of your nodes, containers, pods, deployments, HPA, and ReplicaSets to be added in Site24x7's web client. 

Proxy configuration:

If the set up has proxy, uncomment the following lines under Site24x7's env section in the site24x7-agent.yaml file, and update the proxy value.
- name: http_proxy
 value: <http_proxy_value>
- name: https_proxy
 value: <https_proxy_value>

Method 2: Helm chart
Follow the below steps to install your Site24x7 Kubernetes Agent using Helm chart:

  1. Install Helm.
  2. Add the Site24x7 Helm Repository by executing the following commands:    
    helm repo add site24x7 https://site24x7.github.io/helm-charts/
  3. Fetch the latest version of the chart using the below command:

    helm repo update
  4. Copy and execute the below command to create the Secret(Replace <device-key> with your device key):

    kubectl create secret generic site24x7-agent --from-literal KEY='<device-key>'  
  5. Deploy the agent as below: (Choose a Release Name for identifying the helm chart. Example: site24x7-agent)
    If you are using Helm version: 3 or above, use the below command:

    helm install <Release Name> site24x7/site24x7agent

    If you are using Helm version: 2, use the below command:
    helm install --name <Release Name> site24x7/site24x7agent

    Helm chart adds Site24x7 to all the nodes in your cluster via a DaemonSet. Within a few minutes, Site24x7 begins to report the hosts and the metrics in your account.

Proxy configuration:

Set the proxy configuration as one of the install parameters to the Helm install command.

Sample:

helm install <RELEASE_NAME> --set ---set site24x7.http_proxy ="http://192.108.10.10:3128" --set site24x7.https_proxy ="http://192.108.10.10:3128"  site24x7/site24x7agent

Sample with proxy authentication:

helm install <RELEASE_NAME> --set site24x7.http_proxy ="http://username:password@192.108.10.10:3128" --set site24x7.https_proxy ="http://username:password@192.108.10.10:3128"  site24x7/site24x7agent

Choose a RELEASE_NAME for identifying the Helm chart. Example: site24x7-agent

The Helm chart adds Site24x7 Kubernetes Agent to all the nodes in your cluster via a DaemonSet. In addition, it also deploys the kube-state-metrics as a deployment for fetching advanced kubernetes metrics.

Once the kube-state-metrics is deployed, Site24x7 reports the hosts and the metrics data in your account.

Method 3: Sidecar Container

Configure Role-Based Access Control (RBAC) permissions and deploy the Site24x7 Server Monitoring agent as a Sidecar Container to your Application Container:

  1. Download the Site24x7 Sidecar YAML file.
  2. Save it in the Cloud Shell or Master Node terminal.
  3. Open the downloaded YAML file and replace the application's image and name with your application container.
  4. Copy and execute the below command to create the Secret and apply the YAML(Replace <device-key> with your device key):
    kubectl create secret generic site24x7-agent --from-literal KEY='<device-key>' && kubectl apply -f site24x7-sidecar-agent.yaml

Proxy  configuration:

If the set up has proxy, uncomment the following lines under Site24x7's env section in the site24x7-sidecar-agent.yaml file and update the proxy value.

- name: http_proxy
 value: <http_proxy_value>
- name: https_proxy
 value: <https_proxy_value>

Enable kube-state-metrics for monitoring advanced Kubernetes metrics. To configure kube-state-metrics:

  1. Download the Site24x7 kube-state metrics YAML file.
  2. Save it in the Cloud Shell or Master Node terminal.
  3. Execute the below command to apply the YAML.
    kubectl apply -f site24x7-kube-state-metrics.yaml
  • This deployment will discover your overall Kubernetes infrastructure.
  • Since the agent is running as a side-car container, performance metrics of the nodes, pods, and containers will only be subjected to that pod.
  • If you wish to monitor the performance of each pod then run an agent in each pod.

Method 4: GKE Autopilot

Configure Role-Based Access Control (RBAC) permissions in the cluster and install the Site24x7 agent as DaemonSet in GKE Autopilot:

  1. Download the Site24x7 GKE Autopilot YAML file.
  2. Save it in the Cloud Shell or Master Node terminal.
  3. Copy and execute the below command to create the Secret and apply the YAML(Replace <device-key> with your device key):
    kubectl create secret generic site24x7-agent --from-literal KEY='<device-key>' && kubectl apply -f site24x7-gke-autopilot-agent.yaml

Proxy configuration:

If the set up has proxy, uncomment the following lines under env section in the site24x7-agent.yaml file, and update the proxy value.
- name: http_proxy
 value: <http_proxy_value>
- name: https_proxy
 value: <https_proxy_value>

Method 5: Openshift

Configure Role-Based Access Control (RBAC) permissions in the cluster and install the Site24x7 agent as DaemonSet in OpenShift:

  1. Download the site24x7-openshift-agent.yaml file.
  2. Save it in the Cloud Shell or Master Node terminal.
  3. Open the downloaded YAML file and replace the Device key with your Device key.
  4. Copy and execute the below command to apply the YAML.
    oc apply -f site24x7-openshift-agent.yaml

Proxy configuration:

If the set up has a proxy, uncomment the following lines under env in the Site24x7 agent YAML file and update the proxy value.
- name: http_proxy
 value: <http_proxy_value>
- name: https_proxy
 value: <https_proxy_value>

Edit Monitor

You can choose to modify configurations for your Kubernetes cluster in the Edit Kubernetes Monitor page.

  1. In the Site24x7 web client, go to Server > Kubernetes > click on a cluster > Cluster Details
  2. Hover on the hamburger icon beside the display name. Click Edit.
  3. Choose to edit the Display Name, association with Monitor Groups, Tags, IT Automation Templates, choose the Resource Type, Exclude/include Namespaces, Exclude/include Names, Exclude/include Labels, select Name Filter for Resource Type, exclude/include HPA, select/deselect Resource Groups, and edit Configuration Profiles.
  4. Under Resource Termination Settings, mute alerts when resources are terminated using the Mute Resource Termination Alerts option and remove terminated resources using the Automatically Remove Terminated Resources toggle. You can also specify how long (in days) the terminated resources should be retained in the Site24x7 web console before permanent deletion.
  5. Save your changes.

Dashboards

The Cluster dashboard in Site24x7 lets you get a centralized view of all your Clusters, Nodes, Pods, Services, DaemonSets, Deployments, ReplicaSets, and Jobs of your entire Kubernetes cluster. 

There are two more exclusive dashboards for Kubernetes: 

Site24x7 also offers dashboards to view metrics at different levels such as Nodes, Pods, Containers, and more. Learn more about Site24x7's various Kubernetes dashboards

Business View

Once a Kubernetes monitor is added, a business view is created for your entire cluster. Toggle between Infrastructure View and Service View to spot outliers and detect unusual monitoring patterns in Kubernetes cluster. Learn more.

Infrastructure View:

This view shows your entire Kubernetes cluster from a node point of view(i.e., data of the Kubernetes cluster, nodes, pods, and containers).

Infrastructure View

Service View:

This view shows your entire Kubernetes cluster from a service point of view (i.e., data of the Kubernetes cluster, service, pods, and containers).

Performance Metrics

For every component discovered and monitored in Site24x7, find the list of various performance metrics we provide to ensure continued functioning of your Kubernetes cluster.

Configuration Rules

Configuration Rules of Kubernetes help you assign predefined actions to various monitor groups in order to monitor configuration changes. You can assign these rules to a group of resources and run them to be applied immediately. 

Reports

In the Site24x7 web client, go to Reports > Kubernetes. The following reports are available for Kubernetes monitor:

  • Summary Report
  • Availability Summary Report
  • Busy Hours Report
  • Health Trend Report
  • Performance Report

Kubernetes Logs

You can collect and monitor the following logs in the Kubernetes environment via the Server monitoring agent running on your Kubernetes nodes:

How does data collection (DC) happen

Site24x7 Kubernetes monitoring architecture

Security

The Site24x7 agent collects the configuration data and basic performance data using the Kubernetes API. The API version used is apps/v1. The Site24x7 agent accesses the APIs using RBAC authorization. As a part for RBAC authorization, the following objects with the below mentioned permissions are created while applying the site24x7-agent.yaml file:

  • ServiceAccount named 'site24x7' under 'default' namespace.
  • ClusterRole named 'site24x7' which includes only 'list' & 'watch' permissions to the APIs for nodes, pods etc.
  • ClusterRoleBinding named 'site24x7'.

Once the site24x7-agent.yaml file is applied, the RBAC authorization token is created and automatically mounted into the Site24x7 agent containers created via Daemonset. Using this token, the agent hits the APIs to collect data.

DaemonSet Configurations for the Site24x7 agent:  

Once the site24x7-agent.yaml file is applied, a DaemonSet named site24x7-agent is created. RollingUpdate strategy is used for DaemonSet. 

  • Pods are created with the same name site24x7-agent
  • The containers with 'store/site24x7/docker-agent:<version>' image are created.
    ImagePullPolicy is set to 'Always'.
  • These volumes are mounted inside the containers: /etc/, /var/, /proc/, and /var/run/docker.sock

Collection of performance metrics:

kube-state-metrics is used to collect in-depth performance data. This is enabled only when kube-state-metrics.yaml file is applied. Performance data will be collected by hitting the API:

http://<KUBE_STATE_IP>:<KUBE_STATE_PORT>/metrics
<KUBE_STATE_IP> -> kube state pod ip
<KUBE_STATE_PORT> -> 8080 by default
Ensure this is enabled to view metrics like the number of containers in waiting/running/terminated state, number of available/unavailable replicas in deployment and more.

Access for Site24x7 agent:

The Site24x7 agent will have only List or Watch permissions for the Kubernetes APIs, as specified in the site24x7-agent.yaml file. The agent can only read Kubernetes objects data via the Kubernetes APIs and no write operations can be performed. The agent cannot create or update any Kubernetes objects. Data is collected by the agent only via authorized methods recommended by Kubernetes.

Licensing

The main Kubernetes cluster is a basic monitor. For more information, read this article.

You can view the number of licenses consumed by your Kubernetes cluster by clicking Server > Kubernetes > Cluster. The total number of licenses consumed by that particular cluster will be listed under the License Usage column. Click the number to view a drilled-down view of the consumed licenses.

kubernetes license consumption

FAQs

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.