vmonitor-metric-agent

by VNG Cloud

Helm chartv2.1.0App 1.26.2Verified publisher

vMonitor Platform Metric Agent

About this chart

vMonitor Plaform Metric Agent

vMonitor Platform Metric is a service that continuously monitors the performance of all resources on your system. This chart adds the vMonitor Platform Metric Agent to all nodes in your Kubernetes cluster via a DaemonSet. It also optionally deploy and collect kube-state-metrics which support deep monitoring Kubernetes resources.

How to use vMonitor Platform repository

helm repo add vmonitor-platform https://vngcloud.github.io/helm-charts-vmonitor
helm repo update

Kubernetes compatibility versions

NameVersion
Kubernetes>= 1.20

Note that: vMonitor Metrics Agent also supports Kubernetes Cluster version < 1.20, see vMonitor Platform Metrics Agent legacy for more information

Requirements

RepositoryNameVersion
https://prometheus-community.github.io/helm-chartskube-state-metrics4.20.0

Quick start

The vMonitor Platform Metric Node Agent runs in a DaemonSet. The vMonitor Platform Metric Agent that collects kube-state-metrics runs in a Deployment.

Installing the vMonitor Platform Metrics Chart

To install the chart with the release name 'vmonitor-metric-agent', retrieve or create the IAM credentials from the IAM Dashboard and run

helm install vmonitor-metric-agent vmonitor-platform/vmonitor-metric-agent \
 --set vmonitor.iamClientID=YOUR_CLIENT_ID_XXXXXXXXXXXXXXXXXXX \
 --set vmonitor.iamClientSecret=YOUR_CLIENT_SECRET_XXXXXXXXXXXXXXX \
 --set vmonitor.clusterName=my-cluster-k8s \

To install the chart in specific namespace using the following command

helm install -n <your_namespace> vmonitor-metric-agent vmonitor-platform/vmonitor-metric-agent \
 --set vmonitor.iamClientID=YOUR_CLIENT_ID_XXXXXXXXXXXXXXXXXXX \
 --set vmonitor.iamClientSecret=YOUR_CLIENT_SECRET_XXXXXXXXXXXXXXX \
 --set vmonitor.clusterName=my-cluster-k8s \

Run the following command using kubectl and make sure all pods are in the Running state

kubectl get pod <-n your_namespace> | grep "vmonitor-metric-agent"

Uninstalling the chart

To uninstall/delete the vmonitor-metric-agent deployment:

helm uninstall vmonitor-metric-agent

The command removes all the Kubernetes resources associated with the chart and deletes the release.

Configuration

For the configuration management to become easier, you only need to create a new YAML file that specifies the values for the chart parameters should be used to configure the chart. Any parameters not specified in this file will default to those set in values.yaml

Export default values of vmonitor-metric-agent chart to file values.yaml:

helm show values vmonitor-platform/vmonitor-metric-agent > values.yaml

Create an empty 'vmonitor-values.yaml' Set the following parameters in your vmonitor-values.yaml file to change the collect and flush metric interval:

nodeAgent:
  config:
    agent:
      interval: "10s"
      flush_interval: "10s"
kubeStateMetricsAgent:
  config:
    agent:
      interval: "10s"
      flush_interval: "10s"

Install or upgrade the vMonitor Platform Metrics Helm chart with the new vmonitor-values.yaml file:

helm install -f vmonitor-values.yaml vmonitor-metric-agent vmonitor-platform/vmonitor-metric-agent

OR

helm upgrade -f vmonitor-values.yaml --reuse-values vmonitor-metric-agent vmonitor-platform/vmonitor-metric-agent

See the All configuration options section to discover the description of all the available configuration.

All configuration options

The following table contains the configurable parameters available in the vMonitor Platform Metric Agent chart and their default values.

Configuration and their default values.

ConfigurationTypeDefaultDescription
image.repostring"vcr.vngcloud.vn/81-vmp-public/vmonitor-metrics-agent"vMonitor Platform Metric Agent image name to use
image.tagstring"1.26.0-2.0.2"Define the Agent version to use
image.pullPolicystring"IfNotPresent"Agent image pull policy
vmonitor.kubeStateMetricsEnabledbooltrueIf false, install vMonitor Platform Metric Agent without deploy the kube-state-metrics deployment (Use the kube-state-metrics that is already deployed using kubeStateMetricsAgent.useCustomKubeStateMetricEndpoint)
vmonitor.vmonitorSitestring"monitoring-agent.vngcloud.vn"The site of vMonitor Platform receive metric from agent
vmonitor.iamURLstring"https://iamapis.vngcloud.vn/accounts-api/v2/auth/token"Endpoint for IAM Authentication
vmonitor.iamClientIDstringnilYour IAM Client ID
vmonitor.iamClientSecretstringnilYour IAM Client Secret
vmonitor.clusterNamestring"cluster-k8s"Set a unique Kubernetes Cluster Name for filtering hosts easily
nodeAgent.config.agent.intervalstring"30s"Interval for collecting data from Kubernetes node
nodeAgent.config.agent.metric_batch_sizeint1000Control the size of each write batch that vMonitor Platform Metric Agent send to the vMonitor Platform site
nodeAgent.config.agent.metric_buffer_limitint100000Max metric buffer size when Agent writes are failing to the vMonitor Platform site
nodeAgent.config.agent.flush_intervalstring"30s"Interval for flushing (writing) data to the vMonitor Platform site. This value should not be set lower tan the nodeAgent.config.agent.interval (collection interval)
nodeAgent.resourcesobject{}Resource requests and limits for the Agent.
nodeAgent.nodeSelectorobject{}Allow the Agent DaemonSet to schedule only on selected nodes
nodeAgent.tolerationslist[]Allow the Agent DaemonSet to schedule on tainted nodes
nodeAgent.affinityobject{}Allow the Agent DaemonSet to schedule using affinity rules
kubeStateMetricsAgent.enabledbooltrueIf false, do not deploy vMonitor Platform Metric Agent that collects metrics from the kube-state-metrics
kubeStateMetricsAgent.useCustomKubeStateMetricEndpoint.enabledboolfalseIf true, using the custom endpoint for collecting the kube-state-metrics
kubeStateMetricsAgent.useCustomKubeStateMetricEndpoint.endpointstring"http://example-kube-state-metrics.namespace:8080/metrics"Custom endpoint for collecting the kube-state-metrics (required kubeStateMetricsAgent.useCustomKubeStateMetricEndpoint.enabled=true to take effect)
kubeStateMetricsAgent.config.agent.intervalstring"30s"Interval for collecting data from Kubernetes node
kubeStateMetricsAgent.config.agent.metric_batch_sizeint1000Control the size of each write batch that vMonitor Platform Metric Agent send to the vMonitor Platform site
kubeStateMetricsAgent.config.agent.metric_buffer_limitint100000Max metric buffer size when Agent writes are failing to the vMonitor Platform site
kubeStateMetricsAgent.config.agent.flush_intervalstring"30s"Interval for flushing (writing) data to the vMonitor Platform site. This value should not be set lower tan the nodeAgent.config.agent.interval (collection interval)
kubeStateMetricsAgent.resourcesobject{}Resource requests and limits for the Kube State Metrics Agent.
kubeStateMetricsAgent.nodeSelectorobject{}Allow Kube State Metrics Agent Deployment to schedule on selected nodes
kubeStateMetricsAgent.tolerationslist[]Allow Kube State Metrics Agent Deployment to schedule on tainted nodes
kubeStateMetricsAgent.affinityobject{}Allow Kube State Metrics Agent Deployment to schedule using affinity rules
kube-state-metrics.image.repositorystring"vcr.vngcloud.vn/81-vmp-public/kube-state-metrics"Default kube-state-metrics image repository.
kube-state-metrics.rbac.createbooltrueIf true, create & use RBAC resources
kube-state-metrics.resourcesobject{}Resource requests and limits for the kube-state-metrics container.
kube-state-metrics.serviceAccount.createbooltrueIf true, create ServiceAccount, require rbac kube-state-metrics.rbac.create true
kube-state-metrics.serviceAccount.namestringnilThe name of the ServiceAccount to use.

Deploy vmonitor-metric-agent with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has vmonitor-metric-agent on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartvmonitor-metric-agent is pinned at v2.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply