May 6, 2021

Monitor DigitalOcean Kubernetes Service with Axiom

What is DigitalOcean Kubernetes Service?

DigitalOcean Kubernetes (DOKS) is a managed Kubernetes service that lets you deploy Kubernetes clusters without the complexities of handling the control plane and containerized infrastructure.


  • DigitalOcean account
  • Kubectl installed and configured
  • DigitalOcean CLI installed
  • Axiom Deployment

In this tutorial, I will show you how to:

  • Create a Kubernetes Cluster on DigitalOcean
  • Ingress logs from DigitalOcean Kubernetes Service to Axiom
  • Create a dataset & Ingest token on Axiom.
  • Analyze and Stream your Kubernetes logs on Axiom.

Axiom centralizes all your logs from all your log sources, so you have complete visibility into your entire system. Using Axiom for log management means that you can monitor your event logs more effectively and gain deeper insight into your system metrics.

Let's jump in 💫

  1. Create your account on DigitalOcean, and enter your details.

  2. Select Kubernetes in the dashboard menu/control plane, select the Kubernetes version you want to work with (the latest version is selected by default), and choose the data center region you want to create your cluster in.


  1. Customize the default node pool, you can choose the names you want to use for your node pool, select the machine type and node plan you want to work with for your cluster capacity, you can create more add additional node pool.


  1. Name the cluster, add a tag if you want to, and select the project you want your cluster to belong to.


  1. Click Create Cluster and follow the Getting Started steps to Provision your cluster. Setting up the cluster takes some time.


  1. Download the cluster configuration file by clicking Actions, then Download Configuration from the cluster home page.


  1. Create a token, Click the API link in the main navigation, which takes you to the Applications & API page on the Tokens/Keys tab. In the Personal access tokens section, click the Generate New Token button.


  1. Authenticate your DigitalOcean Account to use the doctl CLI by typing doctl auth init in your terminal, then paste the token you generated from the control plane in step 7.


  1. Get the Kubernetes cluster list by typing doctl kubernetes cluster list on your terminal.

  2. Save your cluster credentials using doctl kubernetes cluster kubeconfig save <cluster name>

  3. Confirm to be sure that your current context is the same as the cluster you created.

  • Run kubectl config get-contexts to see the clusters you set-up
  • kubectl config current-contexts tells you which cluster is your active
  • kubectl config use-context [name] lets you switch to a different one.
  • You can see the different nodes name and status on your terminal by running kubectl get nodes
  1. Head over to Axiom, Head to Settings → Datasets and create a new dataset for your DKS logs.


  1. Create an ingest token on the Axiom UI, to create an ingest token.
  • On the Axiom UI, Click on settings, select ingest token.
  • Select Add ingest token.
  • Enter a name and description and select ADD.
  • Copy the generated token to your clipboard. Once you navigate from the page, the token can be seen again by selecting Ingest Tokens.


  1. Axiom uses Filebeats to forward logs from your Kubernetes cluster. Setting it up is as simple as copying the daemonset’s yaml file from the Axiom Docs and configuring it by adding the environment variable values for your Axiom host, dataset, and the ingest token.
    - name: AXIOM_HOST
      value: // replace with your self-host url if needed
      value: aks-logs
      value: xait-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  1. Apply and run your .yaml file using kubectl apply -f (NAME OF FILE).yaml


  • The Filebeats nodes will be created and you should see them running on the DigitalOcean cloud portal.


  1. Back in Axiom, you will see your logs from DOKS been ingested live to the dataset you created earlier.


  • You can now collect and store insights on your logs and run aggregations across all the matching data to generate visualization as well as a table of results.


  1. You can also stream your logs on Axiom, this allows you to inspect individual events from DigitalOcean Kubernetes Service and watch as they are ingested live.


That’s a Wrap 🎬

You can now see how direct it is for you to ingress logs from DigitalOcean Kubernetes Service to Axiom. You can read more about Axiom Kubernetes configuration on our docs.

If you have specific questions or issues configuring the file, I’d love to hear about them. Contact us here or ask a question in the Axiom Community!

We do love discussing logging, observability, analytics if you have any thoughts, questions, or suggestions kindly contact us. You can also follow us on Twitter and on our blog. And if you’ve enjoyed this post, please, take a second to share it on Twitter.

Further reading

Join us in changing how developers think about data