Shipping Kubernetes events

Kubernetes events are a resource type that Kubernetes automatically creates when other resources get state changes, errors, or other messages that should be shared across the system.

This guide uses the kubernetes-event-exporter tool to ship kubernetes events to Layerlog.

Sending logs from nodes with taints

If you want to ship logs from any of the nodes that have a taint, make sure that the taint key values are listed in your in your daemonset/deployment configuration as follows:

tolerations:
- key: 
  operator: 
  value: 
  effect: 

To determine if a node uses taints as well as to display the taint keys, run:

kubectl get nodes -o json | jq ".items[]|{name:.metadata.name, taints:.spec.taints}"
Create monitoring namespace
kubectl create namespace monitoring
Store your Layerlog credentials

Save your Layerlog shipping credentials as a Kubernetes secret. To do this, customize the sample command below to your specifics and run it.

kubectl create secret generic logzio-events-secret \
  --from-literal=logzio-log-shipping-token='<<LOG-SHIPPING-TOKEN>>' \
  --from-literal=logzio-log-listener='<<LISTENER-HOST>>' \
  -n monitoring
  • Replace <<LISTENER-HOST>> with the host for your region. For example, listener.layerlog.com if your account is hosted on AWS US East, or listener-nl.layerlog.com if hosted on Azure West Europe.
  • Replace <<LOG-SHIPPING-TOKEN>> with the token of the account you want to ship to.
Deploy
kubectl apply -f https://raw.githubusercontent.com/logzio/logz-docs/master/shipping-config-samples/k8s-events.yaml
Check Layerlog for your events

Give your events some time to get from your system to ours, and then open Kibana.

If you still don’t see your events, see log shipping troubleshooting.