The Zenoss Cloud agent on Kubernetes collects key
cluster metrics from
kube-apiserver
and then streams them directly to Zenoss Cloud. The agent sends both
metric and model data for pods, containers, nodes, namespaces, and the cluster itself.
You can view the metric data in dashboards
or in Smart View. After installing the agent, you can customize the provided Kubernetes dashboard template for your purposes.
The Zenoss Cloud agent on Kubernetes requires a
metrics-server. You install the agent in a cluster and Kubernetes schedules the agent in its own pod on one node. Your cluster size determines how much RAM the agent consumes.
The agent uses incremental change notifications
to collect data, so it receives updates any time a monitored property changes. The agent sends a batch of metric data to Zenoss Cloud every 60 seconds and sends a batch of model data when the model data changes.
Zenoss Cloud uses the data collected by the Zenoss agent on Kubernetes
to create separate entities
for each unique node, pod, container, and namespace in a cluster, and
one entity for the cluster itself. To find a cluster in a dashboard
scope query or Smart View query, enter the cluster name that you
specified when you deployed the agent.
Modeled entities include:
k8s.cluster
k8s.container
k8s.deployment
k8s.initcontainer
k8s.namespace
k8s.node
k8s.pod
k8s.service
k8s.statefulset
Entity relationships
The model data that the Zenoss agent on Kubernetes sends to Zenoss Cloud includes
entity relationships. The following diagram illustrates the relationships:
The arrows show which objects affect other objects. The relationships
are used to populate the related entities area
in Smart View.
The following list replicates the diagram in text:
Nodes affect pods and the cluster.
The cluster affects namespaces.
Namespaces and containers affect pods.
Kubernetes metric data
You can configure many of the metrics that Zenoss Cloud collects for Kubernetes as tiles in Dashboards. All metrics are the gauge metric type.
Cluster metrics
Metric
Units
Description
k8s.cluster.allocatable.cpu.ms
millisecond
Sum of all the allocatable CPU for the nodes in the Kubernetes cluster.
k8s.cluster.allocatable.memory.bytes
byte
Sum of all the allocatable memory for the nodes in the Kubernetes cluster.
k8s.cluster.capacity.cpu.ms
millisecond
Sum of all the capacity CPU for the nodes in the kubernetes cluster.
k8s.cluster.capacity.memory.bytes
byte
Sum of all the capacity memory for the nodes in the kubernetes cluster.
k8s.cluster.containers.total
integer
Total number of containers in the Kubernetes cluster.
k8s.cluster.cpu.ms
millisecond
Total CPU milliseconds used by all containers in the Kubernetes cluster.
k8s.cluster.limits.cpu.ms
millisecond
Sum of all the container CPU limits in the kubernetes cluster.
k8s.cluster.limits.memory.bytes
byte
Sum of all the container memory limits in the kubernetes cluster.
k8s.cluster.memory.bytes
byte
Total memory bytes used by all containers in the Kubernetes cluster.
k8s.cluster.nodes.total
integer
Total number of nodes in the Kubernetes cluster.
k8s.cluster.pods.total
integer
Total number of pods in the Kubernetes cluster.
k8s.cluster.requests.cpu.ms
millisecond
Sum of all the container CPU requests in the kubernetes cluster.
k8s.cluster.requests.memory.bytes
byte
Sum of all the container memory requests in the kubernetes cluster.
k8s.cluster.unhandledevents.total.sincestart
integer
Total number of unhandled events.
Node metrics
Metric
Units
Description
k8s.node.allocatable.cpu.ms
millisecond
Allocatable CPU for the kubernetes node.
k8s.node.allocatable.memory.bytes
byte
Allocatable memory for the kubernetes node.
k8s.node.capacity.cpu.ms
millisecond
CPU Capacity for the kubernetes node.
k8s.node.capacity.memory.bytes
byte
Memory Capacity for the kubernetes node.
k8s.node.cpu.ms
millisecond
CPU milliseconds used by the Kubernetes node.
k8s.node.memory.bytes
byte
Memory bytes used by the Kubernetes node.
k8s.node.cpu.ms
millisecond
CPU milliseconds used by the Kubernetes node.
k8s.node.memory.bytes
byte
Memory bytes used by the Kubernetes node.
Namespace metrics
Metric
Units
Description
k8s.namespace.containers.total
integer
Total number of containers in the Kubernetes namespace.
k8s.namespace.cpu.ms
millisecond
Total CPU milliseconds used by all containers in the Kubernetes namespace.
k8s.namespace.memory.bytes
byte
Total memory bytes used by all containers in the Kubernetes namespace.
k8s.namespace.pods.total
integer
Total number of pods in the Kubernetes namespace.
Deployment metrics
Metric
Units
Description
k8s.deployment.generation.observed
generation
Most recent generation observed for the Kubernetes deployment.
k8s.deployment.generation
generation
Current generation for the Kubernetes deployment.
k8s.deployment.replicas.available
integer
Number of available replicated pods for the Kubernetes deployment.
k8s.deployment.replicas.desired
integer
Number of desired replicated pods for the Kubernetes deployment.
k8s.deployment.replicas.ready
integer
Number of ready replicated pods for the Kubernetes deployment.
k8s.deployment.replicas.rollingupdate.max.surge
integer
Maximum number of replicated pods that can be scheduled above the desired number during a rolling update of the Kubernetes deployment.
Maximum number of unavailable replicated pods during a rolling update of the Kubernetes deployment.
k8s.deployment.replicas.unavailable
integer
Number of unavailable replicated pods for the Kubernetes deployment.
k8s.deployment.replicas.updated
integer
Number of updated replicated pods for the Kubernetes deployment.
k8s.deployment.replicas
integer
Number of replicated pods for the Kubernetes deployment.
Pod metrics
Metric
Units
Description
k8s.pod.containers.total
integer
Total number of containers in the Kubernetes pod.
k8s.pod.cpu.ms
millisecond
Total CPU milliseconds used by all containers in the Kubernetes pod.
k8s.pod.limits.cpu.ms
millisecond
CPU limit for the Kubernetes pod.
k8s.pod.limits.memory.bytes
byte
Memory limit for the Kubernetes pod.
k8s.pod.memory.bytes
byte
Total memory bytes used by all containers in the Kubernetes pod.
k8s.pod.overhead.cpu.cores
core
Pod overhead with respect to CPU cores associated with running a pod.
k8s.pod.overhead.memory.bytes
byte
Pod overhead with respect to memory associated with running a pod.
k8s.pod.requests.cpu.ms
millisecond
CPU requested for the Kubernetes pod.
k8s.pod.requests.memory.bytes
byte
Memory requested for the Kubernetes pod.
Statefulset metrics
Metric
Units
Description
k8s.statefulset.collisions
integer
Number of hash collisions from the Kubernetes statefulset.
k8s.statefulset.generation.observed
generation
Most recent generation observed for the Kubernetes statefulset.
k8s.statefulset.generation
generation
Current generation for the Kubernetes statefulset.
k8s.statefulset.replicas.available
integer
Number of available replicated pods for the Kubernetes statefulset.
k8s.statefulset.replicas.current
integer
Number of replicated pods for the current revision of Kubernetes statefulset.
k8s.statefulset.replicas.ready
integer
Number of ready replicated pods for the Kubernetes statefulset.
k8s.statefulset.replicas.updated
integer
Number of updated replicated pods for the Kubernetes statefulset.
k8s.statefulset.replicas
integer
Number of replicated pods for the Kubernetes statefulset.
Container metrics
Metric
Units
Description
k8s.container.cpu.ms
millisecond
CPU milliseconds used by the Kubernetes container.
k8s.container.limits.cpu.ms
millisecond
CPU limit for the Kubernetes container.
k8s.container.limits.memory.bytes
byte
Memory limit for the Kubernetes container.
k8s.container.memory.bytes
byte
Memory bytes used by the Kubernetes container.
k8s.container.requests.cpu.ms
millisecond
CPU requested for the Kubernetes container.
k8s.container.requests.memory.bytes
byte
Memory requested for the Kubernetes container.
k8s.container.status.restarts.total
integer
Number of restarts for the Kubernetes container.
Initcontainer metrics
Metric
Units
Description
k8s.initcontainer.limits.cpu.ms
millisecond
CPU limit for Kubernetes init container.
k8s.initcontainer.limits.memory.bytes
byte
Memory limit for Kubernetes init container.
k8s.initcontainer.requests.cpu.ms
millisecond
CPU requested for Kubernetes init container.
k8s.initcontainer.requests.memory.bytes
byte
Memory requested for Kubernetes init container.
k8s.initcontainer.status.restarts.total
integer
Number of restarts for the Kubernetes init container.
Installing the Zenoss Cloud agent on Kubernetes
To connect a Kubernetes cluster to Zenoss, you can install an agent in your cluster. The agent uses a YAML file for configuration settings.
You can install the Zenoss Agent on Kubernetes by either using a Helm chart or directly using the kubectl command. In general, Zenoss recommends using the Helm package manager to install the agent. More advanced users might choose the kubectl CLI.
Before installing the agent, you need:
The name of the Kubernetes cluster that you want to connect to.
The correct Zenoss API endpoint for your environment.
The Zenoss agent on Kubernetes
supports Kubernetes version 1.8 and higher. It requires the
metrics-server.
Install the agent using Helm
Perform the following steps to install the Zenoss agent on Kubernetes using
Helm. As a best practice, be sure to make the customizations as specified in Step 3 before installing the agent.
The history -d command removes the authentication key from
your shell history file.
After installing the agent, create a dashboard using the Kubernetes template. In Dashboards, copy the Kubernetes dashboard template, then rename it, adjust the scope, and change the source to the name of the cluster that you chose when installing the agent.
Kubernetes provides a CLI for communicating with a Kubernetes cluster using the Kubernetes API. If you choose this method to install the agent, it is assumed that you are familiar with the kubectl CLI.
Carefully consider the MY_CLUSTER_NAME before installation. Your selected MY_CLUSTER_NAME is used as the source in Zenoss Cloud.
Perform the following steps to install and manage the Zenoss agent on
Kubernetes using the kubectl command.
Important
You must have an internet connection from the target cluster to Docker Hub so you can download the agent image.
Set a cluster context. Configure kubectl to use the correct Kubernetes cluster. In your terminal, run the following command:
kubectlconfigcurrent-context
Store your authentication key as a Kubernetes secret. Create a
secret
for the Zenoss API key you are using for the target cluster.
In the following command, replace MY_API_KEY with your Zenoss API key:
The history -d command removes the authentication key from
your shell history file.
Create a configuration file for the agent. For configuration settings, the agent uses a YAML file. In the following YAML file, make the following changes:
Replace MY_CLUSTER_NAME with the unique name
of the target cluster in all locations.
Replace MY_API_ENDPOINT with the correct Zenoss API endpoint for your environment.
Install the agent in the cluster. Run the following command:
kubectlapply-fzenoss-agent-kubernetes.yml
After installing the agent, create a dashboard using the Kubernetes template. In Dashboards, copy the Kubernetes dashboard template, then rename it, adjust the scope, and change the source to the name of the cluster that you chose when installing the agent.