Skip to main content

Kubernetes

Integrate your Kubernetes system with Logz.io to monitor your logs, metrics, and traces, gain observability into your environment, and be able to identify and resolve issues with a few clicks.

Before you integrate Kubernetes you'll need:

Prerequisites

  • Helm

  • Add Logzio-helm repository

    helm repo add logzio-helm https://logzio.github.io/logzio-helm && helm repo update

Send All Telemetry Data (logs, metrics, traces and security reports)

Send all of your telemetry data using one single Helm chart:

helm install  -n monitoring --create-namespace \
--set logs.enabled=true \
--set logzio-logs-collector.secrets.logzioLogsToken="<<LOG-SHIPPING-TOKEN>>" \
--set logzio-logs-collector.secrets.logzioRegion="<<LOGZIO_ACCOUNT_REGION_CODE>>" \
--set logzio-logs-collector.secrets.env_id="<<CLUSTER-NAME>>" \
--set metricsOrTraces.enabled=true \
--set logzio-k8s-telemetry.metrics.enabled=true \
--set logzio-k8s-telemetry.secrets.MetricsToken="<<METRICS-SHIPPING-TOKEN>>" \
--set logzio-k8s-telemetry.secrets.ListenerHost="https://<<LISTENER-HOST>>:8053" \
--set logzio-k8s-telemetry.secrets.p8s_logzio_name="<<ENV-ID>>" \
--set logzio-k8s-telemetry.traces.enabled=true \
--set logzio-k8s-telemetry.secrets.TracesToken="<<TRACING-SHIPPING-TOKEN>>" \
--set logzio-k8s-telemetry.secrets.LogzioRegion="<<LOGZIO_ACCOUNT_REGION_CODE>>" \
--set logzio-k8s-telemetry.spm.enabled=true \
--set logzio-k8s-telemetry.secrets.env_id="<<ENV-ID>>" \
--set logzio-k8s-telemetry.secrets.SpmToken="<<SPM-METRICS-SHIPPING-TOKEN>>" \
--set logzio-k8s-telemetry.serviceGraph.enabled=true \
--set logzio-k8s-telemetry.k8sObjectsConfig.enabled=true \
--set logzio-k8s-telemetry.secrets.k8sObjectsLogsToken="<<LOG-SHIPPING-TOKEN>>" \
--set securityReport.enabled=true \
--set logzio-trivy.env_id="<<ENV-ID>>" \
--set logzio-trivy.secrets.logzioShippingToken="<<LOG-SHIPPING-TOKEN>>" \
--set logzio-trivy.secrets.logzioListener="<<LISTENER-HOST>>" \
--set deployEvents.enabled=true \
--set logzio-k8s-events.secrets.logzioShippingToken="<<LOG-SHIPPING-TOKEN>>" \
--set logzio-k8s-events.secrets.logzioListener="<<LISTENER-HOST>>" \
--set logzio-k8s-events.secrets.env_id="<<ENV-ID>>" \
logzio-monitoring logzio-helm/logzio-monitoring
ParameterDescription
<<LOG-SHIPPING-TOKEN>>Your logs shipping token.
<<LISTENER-HOST>>Your account's listener host.
<<METRICS-SHIPPING-TOKEN>>Your metrics shipping token.
<<SPM-METRICS-SHIPPING-TOKEN>>Your SPM account shipping token
<<ENV-ID>>The name for your environment's identifier, to easily identify the telemetry data for each environment.
<<TRACING-SHIPPING-TOKEN>>Your traces shipping token.
<<LOGZIO_ACCOUNT_REGION_CODE>>Your Logz.io region code
tip

To diable metrics when metricsOrTraces.enabled=true, make sure to include the below flags in the command:

--set logzio-k8s-telemetry.nodeExporter.enabled=false \
--set logzio-k8s-telemetry.kubeStateMetrics.enabled=false \
--set logzio-k8s-telemetry.pushGateway.enabled=false \

Manual Setup

Below are instructions for configuring each type of telemetry data individually.

Send your Logs

To send your logs, our chartlogzio-monitoring offers two methods:

  • logzio-logs-collector, based on OpenTelemetry collector
  • logzio-fluentd, based on fluentd

Log collection with OpenTelemetry collector

helm install -n monitoring --create-namespace \
--set logs.enabled=true \
--set logzio-logs-collector.secrets.logzioLogsToken="<<LOG-SHIPPING-TOKEN>>" \
--set logzio-logs-collector.secrets.logzioRegion="<<LOGZIO_ACCOUNT_REGION_CODE>>" \
--set logzio-logs-collector.secrets.env_id="<<CLUSTER-NAME>>" \
logzio-monitoring logzio-helm/logzio-monitoring

Log collection with Fluentd

The logzio-fluentd chart is disabled by default in favor of the logzio-logs-collector chart. Deploy logzio-fluentd by adding the following --set flags:

helm install -n monitoring --create-namespace \
--set logs.enabled=true \
--set logzio-fluentd.enabled=true \
--set logzio-logs-collector.enabled=false \
--set logzio-fluentd.secrets.logzioShippingToken="<<LOG-SHIPPING-TOKEN>>" \
--set logzio-fluentd.secrets.logzioListener="<<LISTENER-HOST>>" \
--set logzio-fluentd.env_id="<<CLUSTER-NAME>>" \
logzio-monitoring logzio-helm/logzio-monitoring
ParameterDescription
<<LOG-SHIPPING-TOKEN>>Your logs shipping token.
<<LISTENER-HOST>>Your account's listener host.
<<CLUSTER-NAME>>The cluster's name, to easily identify the telemetry data for each environment.
<<LOGZIO-REGION>>Your Logz.io region code.

Encounter an issue? See our troubleshooting guide.

Adding pod labels

To ensure that labels are applied correctly to the pods managed by the Logz.io collector, add the following section to your Helm chart configuration:

logzio-k8s-telemetry:
standaloneCollector:
podLabels:
team: devops-tooling

Custom Configuration

You can view the full list of possible configuration options for each chart in the links below:

  1. logzio-fluentd Chart
  2. logzio-logs-collector Chart

To modify values, use the --set flag with the chart name as a prefix.

Example: For a parameter called someField in the logzio-logs-collector's values.yaml file, set it by adding the following to the helm install command:

--set logzio-logs-collector.someField="my new value"

Adding log_type annotation with a custom value will be parsed into a log_type field with the same value.

Advanced Configuration and Troubleshooting

Handling image pull rate limit

Docker Hub pull rate limits could result in the following error: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits. To avoid this, use the --set commands below to access an alternative image repository:

--set logzio-k8s-telemetry.image.repository=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib
--set logzio-k8s-telemetry.prometheus-pushgateway.image.repository=public.ecr.aws/logzio/prom-pushgateway
--set logzio-fluentd.image=public.ecr.aws/logzio/logzio-fluentd
--set logzio-fluentd.daemonset.init.containerImage=public.ecr.aws/docker/library/busybox
--set logzio-trivy.image=public.ecr.aws/logzio/trivy-to-logzio