Overview

Helm is a tool for managing packages of pre-configured Kubernetes resources, known as Charts.

You can ship metrics from your Kubernetes cluster using Logzio-k8s-metrics.

This Daemonset can be deployed using a standard configuration or Metricbeat autodiscover, for even more powerful automation.

Before you begin, you’ll need:

  • Helm CLI installed
  • kube-state-metrics installed
  • Metricbeat 7.6 or higher for Autodiscover support. This integration defaults to Metricbeat 7.9.1.
  • To allow outgoing traffic to destination port 5015
  • Kubelet read-only-port 10255 enabled. Kubelet read-only-port 10255 is enabled by default on some cluster versions. If it isn’t enabled, follow Kubernetes’s instructions for enabling 10255 as a read-only-port in Kubelet’s config file

Helm 2 will reach EOL on November 2020. This document follows the command syntax recommended for Helm 3, but the Chart will work with both Helm 2 and Helm 3.

Automated deployment

This is the simplest method for deployment but it doesn’t offer advanced configuration options. The chart will be deployed according to the listed parameter defaults.

Run the automated deployment script
bash <(curl -s https://raw.githubusercontent.com/logzio/logzio-helm/master/quickstart-metrics.sh)

Note: The script is currently only compatible with Helm 3.

Add the configuration

Follow through the system’s prompts and provide the requested parameters.

Prompt Answer Required/Default
Logz.io metrics shipping token Your Metrics account token. Replace <<METRICS-SHIPPING-TOKEN>> with a token for the Metrics account you want to ship to.
Look up your Metrics token.
Required
Logz.io region Two-letter region code, or blank for US East (Northern Virginia). This determines your listener URL (where you’re shipping the logs to) and API URL. You can find your region code in the Regions and URLs table. DEFAULT: Blank (US East)
Cluster name Name of the Kubernetes cluster in which you are deploying. DEFAULT: detected by the script
Standard or autodiscover deployment To deploy with configuration templates answer ‘autodiscover’. DEFAULT: standard
Open your Kubernetes dashboard in Logz.io

Give your metrics a few minutes to get from your system to ours, and then open Logz.io.

Your metrics should appear in the preconfigured dashboard in your Metrics account. To open it, search your Logz.io Metrics dashboards for Kubernetes.

Overview

Helm is a tool for managing packages of pre-configured Kubernetes resources, known as Charts.

You can ship metrics from your Kubernetes cluster using Logzio-k8s-metrics.

This Daemonset can be deployed using a standard configuration or Metricbeat autodiscover, for even more powerful automation.

Before you begin, you’ll need:

  • Helm CLI installed
  • kube-state-metrics installed
  • Metricbeat 7.6 or higher for Autodiscover support. This integration defaults to Metricbeat 7.9.1.
  • To allow outgoing traffic to destination port 5015
  • Kubelet read-only-port 10255 enabled. Kubelet read-only-port 10255 is enabled by default on some cluster versions. If it isn’t enabled, follow Kubernetes’s instructions for enabling 10255 as a read-only-port in Kubelet’s config file

Helm 2 will reach EOL on November 2020. This document follows the command syntax recommended for Helm 3, but the Chart will work with both Helm 2 and Helm 3.

Manual deployment

This method of deployment gives you greater control over the configuration.

Add the logzio-k8s-metrics repo to your helm repo list
helm repo add logzio-helm https://logzio.github.io/logzio-helm
helm repo update
Deploy

You have three options for deployment: Standard configuration, Autodiscover configuration, Custom configuration.

Replace the placeholders to match your specifics. (They are indicated by the double angle brackets << >>):

  • Replace <<METRICS-SHIPPING-TOKEN>> with a token for the Metrics account you want to ship to.
    Look up your Metrics token.

  • Replace <<LISTENER-HOST>> with the host for your region. For example, listener.logz.io if your account is hosted on AWS US East, or listener-nl.logz.io if hosted on Azure West Europe.
  • Replace <<KUBE-STATE-METRICS-NAMESPACE>>, <<KUBE-STATE-METRICS-PORT>>, and <<CLUSTER-NAME>> in this command to save your cluster details as a Kubernetes secret.
Deploy with standard configuration
helm install --namespace=kube-system \
--set=secrets.MetricsToken=<<METRICS-SHIPPING-TOKEN>> \
--set=secrets.ListenerHost=<<LISTENER-HOST>> \
--set=secrets.ClusterName=<<CLUSTER-NAME>> \
--set=secrets.KubeStatNamespace=<<KUBE-STATE-METRICS-NAMESPACE>> \
--set=secrets.KubeStatPort=<<KUBE-STATE-METRICS-PORT>> \
logzio-k8s-metrics logzio-helm/logzio-k8s-metrics
Deploy with Autodiscover configuration

This Daemonset’s default autodiscover configuration is hints based.

helm install --namespace=kube-system \
--set configType='autodiscover' \
--set=secrets.MetricsToken=<<METRICS-SHIPPING-TOKEN>> \
--set=secrets.ListenerHost=<<LISTENER-HOST>> \
--set=secrets.ClusterName=<<CLUSTER-NAME>> \
--set=secrets.KubeStatNamespace=<<KUBE-STATE-METRICS-NAMESPACE>> \
--set=secrets.KubeStatPort=<<KUBE-STATE-METRICS-PORT>> \
logzio-k8s-metrics logzio-helm/logzio-k8s-metrics

For more information about Autodiscover, see Kubernetes configuration and autodiscover’s appenders.

Deploy with custom configuration
helm install --namespace=kube-system \
--set=secrets.MetricsToken=<<METRICS-SHIPPING-TOKEN>> \
--set=secrets.ListenerHost=<<LISTENER-HOST>> \
--set=secrets.ClusterName=<<CLUSTER-NAME>> \
--set=secrets.KubeStatNamespace=<<KUBE-STATE-METRICS-NAMESPACE>> \
--set=secrets.KubeStatPort=<<KUBE-STATE-METRICS-PORT>> \
--set configType='auto-custom' \
--set-file metricbeatConfig.autoCustomConfig=/path/to/your/config.yaml \
logzio-k8s-metrics logzio-helm/logzio-k8s-metrics

If you’re using a custom config, please make sure that you’re using a valid .yml file with the following structure:

metricbeat.yml: |-
  metricbeat.config.modules:
    path: ${path.config}/modules.d/*.yml
    reload.enabled: false
  metricbeat.autodiscover:
    # your autodiscover config
    # ...

  processors:
    - add_cloud_metadata: ~
  fields:
    logzio_codec: json
    token: ${LOGZIO_METRICS_SHIPPING_TOKEN}
    cluster: ${CLUSTER_NAME}
    type: metricbeat
  fields_under_root: true
  ignore_older: 3hr
  output:
    logstash:
      hosts: ["${LOGZIO_METRICS_LISTENER_HOST}:5015"]
      ssl:
        certificate_authorities: ['/etc/pki/tls/certs/SectigoRSADomainValidationSecureServerCA.crt']
Open your Kubernetes dashboard in Logz.io

Give your metrics a few minutes to get from your system to ours, and then open Logz.io.

Your metrics should appear in the preconfigured dashboard in your Metrics account. To open it, search your Logz.io Metrics dashboards for Kubernetes.

To override values in a chart

When you don’t want the default values, you can override them in the chart by using the --set flag and passing the configuration from the command line.

Specify each parameter argument in the format --set key=value[,key=value] immediately after the command helm install. For example, to set the imageTag and terminationGracePeriodSeconds values, run:

helm install --namespace=kube-system logzio-k8s-metrics logzio-helm/logzio-k8s-metrics \
  --set=imageTag=7.7.0,terminationGracePeriodSeconds=30

To override configurations such as metricbeatConfig.autoCustomConfig, deployment.metricbeatConfig.custom and daemonset.metricbeatConfig.custom, use the --set-file argument in helm install. For example,

helm install --namespace=kube-system logzio-k8s-metrics logzio-helm/logzio-k8s-metrics \
  --set-file deployment.metricbeatConfig.custom=/path/to/your/config.yaml

Configuration options

Parameter Description Default
image The Metricbeat Docker image. "docker.elastic.co/beats/metricbeat"
imageTag The Metricbeat Docker image tag. "7.9.1"
nameOverride Overrides the Chart name for resources. ""
fullnameOverride Overrides the full name of the resources. "metricbeat"
apiVersions.ConfigMap API version of configmap.yaml. v1
apiVersions.Deployment API version of deployment.yaml. apps/v1
apiVersions.DaemonSet API version of daemonset.yaml. apps/v1
apiVersions.ServiceAccount API version of serviceaccount.yaml. v1
apiVersions.ClusterRole API version of clusterrole.yaml. rbac.authorization.k8s.io/v1beta1
apiVersions.ClusterRoleBinding API version of clusterrolebinding.yaml. rbac.authorization.k8s.io/v1beta1
shippingProtocol Shipping protocol. http
shippingPort Shipping port. 10255
serviceAccount.create Specifies whether a service account should be created. true
serviceAccount.name Name of the service account. metricbeat
podSecurityContext Configurable securityContext for Metricbeat DaemonSet and Deployment pod execution environment. {}
resources Sets the resources for both your Metricbeat DaemonSet and Deployment. {}
clusterRoleRules Configurable cluster role rules that Metricbeat uses to access Kubernetes resources. See values.yaml.
managedServiceAccount Set to true to enable the option to manage the serviceAccount by the Helm chart. Otherwise, set to false to manage your own service account and related roles. true
secretMounts Mounts a secret as a file inside both your Metricbeat DaemonSet and Deployment. You can use it to mount certificates and other secrets. See values.yaml.
terminationGracePeriod In case of pod shutdown, the waiting period in seconds before killing the Metricbeat pod process. 30
hostPathRoot Fully-qualified hostPath that will be used to persist Metricbeat registry data. /var/lib
logzioCert Logzio public SSL certificate. See values.yaml.
metricbeatConfig Metricbeat configuration. See values.yaml.
daemonset.leanConfig When set to true, sets the Daemonset’s Metricbeat modules configuration to the minimal configuration required to populate Logz.io’s dashboards. See values.yaml.
daemonset.extraVolumeMounts Templatable string of additional volumeMounts to be passed to the DaemonSet. See values.yaml.
daemonset.extraVolumes Templatable string of additional volumes to be passed to the DaemonSet. See values.yaml.
daemonset.metricbeatConfig.default Default configuration for Daemonset’s Metricbeat modules. See values.yaml.
daemonset.metricbeatConfig.lean Lean configuration for Daemonset’s Metricbeat modules. See values.yaml.
daemonset.metricbeatConfig.custom Allows you to add any config files in /usr/share/metricbeat such as metricbeat.yml for Metricbeat Daemonset. Please note that the custom config should be formatted and indented as in daemonset.metricbeat.config.default. {}
daemonset.securityContext Configurable securityContext for Metricbeat DaemonSet pod execution environment. See values.yaml.
daemonset.resources Sets the resources for your Metricbeat deployment. See values.yaml.
daemonset.secretMounts Mounts a secret as a file inside the DaemonSet. You can use it to mount certificates and other secrets. See values.yaml.
daemonset.sslVerificationMode Sets the SSL verification mode for Metricbeat. "none"
daemonset.tolerations Set tolerations for all DaemonSet pods. {}
deployment.extraVolumeMounts Templatable string of additional volumeMounts to be passed to the deployment. See values.yaml.
deployment.extraVolumes Templatable string of additional volumes to be passed to the deployment. See values.yaml.
deployment.metricbeatConfig.default Default configuration for Deployment’s Metricbeat modules. See values.yaml.
deployment.metricbeatConfig.lean Lean configuration for Deployment’s Metricbeat modules. See values.yaml.
deployment.metricbeatConfig.custom Allows you to add any config files in /usr/share/metricbeat such as metricbeat.yml for Metricbeat Deployment. Please note that the custom config should be formatted and indented as in deployment.metricbeat.config.default. {}
deployment.securityContext Configurable securityContext for your Metricbeat deployment pod execution environment. See values.yaml.
deployment.resources Sets the resources for your Metricbeat deployment. See values.yaml.
deployment.secretMounts Mounts a secret as a file in the deployment. You can use it to mount certificates and other secrets. See values.yaml.
namespace Chart’s namespace kube-system
secrets.MetricsToken Secret with your Logz.io Metrics token. ""
secrets.ListenerHost Secret with your Logz.io listener host. ""
secrets.ClusterName Secret with your cluster name. ""
secrets.KubeStatNamespace Secret with your Kube-Stat-Metrics namespace. ""
secrets.KubeStatPort Secret with your Kube-Stat-Metrics port. ""

To uninstall the chart

To uninstall the chart, run the following command to remove all k8s components associated with the Chart and delete the release. For example, to uninstall the logzio-k8s-metrics deployment, run:

helm uninstall --namespace=kube-system logzio-k8s-metrics