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
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
Parameter | Description |
---|---|
<<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 |
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.
- Logs
- Deployment Events
- Metrics
- Tracing and SPM
- K8S Objects
- Trivy
- EKS Fargate
Send your Logs
To send your logs, our chartlogzio-monitoring
offers two methods:
logzio-logs-collector
, based on OpenTelemetry collectorlogzio-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
Parameter | Description |
---|---|
<<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:
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.
Send deployment events logs
Send data about deployment events in the cluster, and how they affect its resources.
Supported resource kinds are Deployment
, Daemonset
, Statefulset
, ConfigMap
, Secret
, Service Account
, Cluster Role
and Cluster Role Binding
.
helm install -n monitoring --create-namespace \
--set logzio-k8s-events.secrets.logzioShippingToken='<<LOG-SHIPPING-TOKEN>>' \
--set logzio-k8s-events.secrets.logzioListener='<<LISTENER-HOST>>' \
--set logzio-k8s-events.secrets.env_id='<<CLUSTER-NAME>>' \
--set logzio-k8s-events.secrets.customListener='<<CUSTOM-HOST>>' \
logzio-monitoring logzio-helm/logzio-monitoring
Parameter | Description |
---|---|
<<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. |
<<CUSTOM-HOST>> | (optional) HTTP/s listener endpoint that receives JSON input, overrides the Logz.io listener. |
Deployment events versioning
To add a versioning indicator in Kubernetes 360 and Service Overview, include the logzio/commit_url
annotation in the resource metadata. The 'View commit' button will link to the commit URL in your version control system (VCS).
metadata:
annotations:
logzio/commit_url: ""
GitHub VCS Example
Commit URL structure: https://github.com/<account>/<repository>/commit/<commit-hash>
- Example:
https://github.com/logzio/logzio-k8s-events/commit/069c75c95caeca58dd0776405bb8dfb4eed3acb2
Encounter an issue? See our troubleshooting guide.
Send your metrics
helm install -n monitoring --create-namespace \
--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="<<CLUSTER-NAME>>" \
--set logzio-k8s-telemetry.secrets.env_id="<<CLUSTER-NAME>>" \
logzio-monitoring logzio-helm/logzio-monitoring
Parameter | Description |
---|---|
<<METRICS-SHIPPING-TOKEN>> | Your metrics shipping token. |
<<CLUSTER-NAME>> | The cluster's name, to easily identify the telemetry data for each environment. |
<<LISTENER-HOST>> | Your account's listener host. |
Encounter an issue? See our troubleshooting guide.
Custom Configuration
You can view the full list of the possible configuration values in the logzio-k8s-telemetry Chart folder.
To modify values found in the logzio-telemetry
folder, use the --set
flag with the logzio-k8s-telemetry
prefix.
For example, for a parameter called someField
in the logzio-k8s-telemetry
's values.yaml
file, set it by adding the following to the helm install
command:
--set logzio-k8s-telemetry.someField="my new value"
Send your traces
We offer three options for sending send your traces:
- Send Traces only
- Send Traces and SPM
- Send Traces, SPM and Service Graph data
helm install -n monitoring --create-namespace \
--set metricsOrTraces.enabled=true \
--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.secrets.env_id="<<CLUSTER-NAME>>" \
--set logzio-k8s-telemetry.nodeExporter.enabled=false \
--set logzio-k8s-telemetry.kubeStateMetrics.enabled=false \
--set logzio-k8s-telemetry.pushGateway.enabled=false \
logzio-monitoring logzio-helm/logzio-monitoring
Send traces with SPM
helm install -n monitoring --create-namespace \
--set metricsOrTraces.enabled=true \
--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.secrets.env_id="<<CLUSTER-NAME>>" \
--set logzio-k8s-telemetry.spm.enabled=true \
--set logzio-k8s-telemetry.secrets.SpmToken="<<SPM-METRICS-SHIPPING-TOKEN>>" \
--set logzio-k8s-telemetry.secrets.ListenerHost="https://<<LISTENER-HOST>>:8053" \
--set logzio-k8s-telemetry.nodeExporter.enabled=false \
--set logzio-k8s-telemetry.kubeStateMetrics.enabled=false \
--set logzio-k8s-telemetry.pushGateway.enabled=false \
logzio-monitoring logzio-helm/logzio-monitoring
Send Service Graph data
serviceGraph.enabled=true
will have no effect unless traces.enabled
and spm.enabled=true
is set to true
.
helm install -n monitoring --create-namespace \
--set metricsOrTraces.enabled=true \
--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.secrets.env_id="<<CLUSTER-NAME>>" \
--set logzio-k8s-telemetry.spm.enabled=true \
--set logzio-k8s-telemetry.secrets.SpmToken="<<SPM-METRICS-SHIPPING-TOKEN>>" \
--set logzio-k8s-telemetry.secrets.ListenerHost="https://<<LISTENER-HOST>>:8053" \
--set logzio-k8s-telemetry.serviceGraph.enabled=true \
--set logzio-k8s-telemetry.nodeExporter.enabled=false \
--set logzio-k8s-telemetry.kubeStateMetrics.enabled=false \
--set logzio-k8s-telemetry.pushGateway.enabled=false \
logzio-monitoring logzio-helm/logzio-monitoring
Parameter | Description |
---|---|
<<TRACING-SHIPPING-TOKEN>> | Your traces shipping token. |
<<CLUSTER-NAME>> | The cluster's name, to easily identify the telemetry data for each environment. |
<<LISTENER-HOST>> | Your account's listener host. |
<<LOGZIO_REGION>> | Your Logz.io region code |
<<SPM-METRICS-SHIPPING-TOKEN>> | Your span metrics shipping token. |
Encounter an issue? See our Distributed Tracing troubleshooting.
Custom Configuration
You can view the full list of the possible configuration values in the logzio-k8s-telemetry Chart folder.
To modify values found in the logzio-telemetry
folder, use the --set
flag with the logzio-k8s-telemetry
prefix.
For example, for a parameter called someField
in the logzio-k8s-telemetry
's values.yaml
file, set it by adding the following to the helm install
command:
--set logzio-k8s-telemetry.someField="my new value"
Send Metrics with Kubernetes object logs
k8sObjectsConfig.enabled=true
will have no effect unless metrics.enabled
is also set to true
.
helm install \
--set logzio-k8s-telemetry.metrics.enabled=true \
--set logzio-k8s-telemetry.k8sObjectsConfig.enabled=true \
--set logzio-k8s-telemetry.secrets.LogzioRegion=<<LOGZIO-REGION>> \
--set logzio-k8s-telemetry.secrets.k8sObjectsLogsToken=<<LOG-SHIPPING-TOKEN>> \
--set logzio-k8s-telemetry.secrets.MetricsToken=<<METRICS-SHIPPING-TOKEN>> \
--set logzio-k8s-telemetry.secrets.ListenerHost=<<LISTENER-HOST>> \
--set logzio-k8s-telemetry.secrets.p8s_logzio_name=<<CLUSTER-NAME>> \
--set logzio-k8s-telemetry.secrets.env_id=<<CLUSTER-NAME>> \
logzio-monitoring logzio-helm/logzio-monitoring
Parameter | Description |
---|---|
<<LOG-SHIPPING-TOKEN>> | Your logs shipping token. |
<<METRICS-SHIPPING-TOKEN>> | Your metrics shipping token. |
<<LOGZIO_REGION>> | Your Logz.io region code |
<<LISTENER-HOST>> | Your account's listener host. |
<<CLUSTER-NAME>> | The cluster's name, to easily identify the telemetry data for each environment. |
Scan your cluster for security vulnerabilities
helm install -n monitoring --create-namespace \
--set securityReport.enabled=true \
--set logzio-trivy.env_id="<<CLUSTER-NAME>>" \
--set logzio-trivy.secrets.logzioShippingToken="<<LOG-SHIPPING-TOKEN>>" \
--set logzio-trivy.secrets.logzioListener="<<LISTENER-HOST>>" \
Parameter | Description |
---|---|
<<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. |
Sending telemetry data from EKS on Fargate
Set the fargateLogRouter.enabled
value to true
. This deploys a dedicated aws-observability
namespace and a configmap
for the Fargate log router. Read more on EKS Fargate logging in the official AWS documentation.
helm install -n monitoring --create-namespace \
--set logs.enabled=true \
--set logzio-fluentd.fargateLogRouter.enabled=true \
--set logzio-fluentd.secrets.logzioShippingToken="<<LOG-SHIPPING-TOKEN>>" \
--set logzio-fluentd.secrets.logzioListener="<<LISTENER-HOST>>" \
--set metricsOrTraces.enabled=true \
--set logzio-k8s-telemetry.collector.mode=standalone \
--set logzio-k8s-telemetry.enableMetricsFilter.eks=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="<<CLUSTER-NAME>>" \
--set logzio-k8s-telemetry.traces.enabled=true \
--set logzio-k8s-telemetry.secrets.TracesToken="<<TRACING-SHIPPING-TOKEN>>" \
--set logzio-k8s-telemetry.secrets.LogzioRegion="<<LOGZIO_REGION>>" \
logzio-monitoring logzio-helm/logzio-monitoring
Parameter | Description |
---|---|
<<LOG-SHIPPING-TOKEN>> | Your logs shipping token. |
<<LISTENER-HOST>> | Your account's listener host. |
<<METRICS-SHIPPING-TOKEN>> | Your metrics shipping token. |
<<CLUSTER-NAME>> | The name for your environment's identifier, to easily identify the telemetry data for each environment. |
<<TRACING-SHIPPING-TOKEN>> | Replace <<TRACING-SHIPPING-TOKEN>> with the token of the account you want to ship to. |
<<LOGZIO_REGION>> | Your Logz.io region code |
Advanced Configuration and Troubleshooting
- Pull Rate Limit
- Parse JSON Logs
- Filter Metrics
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
Configuring logs in JSON format
To parse JSON Logs using the fluentd chart, configure the following processor using the configmap.extraConfig
configuration option:
<filter **>
@type parser
key_name message
reserve_data true
remove_key_name_field true
<parse>
@type json
</parse>
</filter>
Instructions of using configmap.extraConfig
can be found here.
Custom Filter for Metrics
We provide a setting (enableMetricsFilter
) which filters by default only the metrics needed for K8360.
If you wish to customize the metrics being sent, you can do so by modifying the prometheusFilters
configuration in your Helm chart.
Follow the steps below to adjust this configuration:
1. Identify metrics to keep
Determine which metrics you need to add to your collection, and format them as a regex string (e.g., new_metric_1|new_metric_2
).
2. Set filters
Run the following command to update your Chart with the specified metrics:
helm upgrade <RELEASE_NAME> logzio-helm/logzio-monitoring \
--set prometheusFilters.metrics.infrastructure.keep.aks="existing_metric_1|existing_metric_2|new_metric_1|new_metric_2" \
--set logzio-k8s-telemetry.enableMetricsFilter.<SERVICE>=true
- Replace
<RELEASE_NAME>
with the name of your Helm release. - Replace
<SERVICE>
with the appropriate service name:ask
,eks
orgke
.