2021-04-20

Ingress Logs from Azure Kubernetes Service to Axiom

Tola Ore-Aruwaji
@thecraftman_

In this tutorial, I will show you how to ingress your logs from Azure Kubernetes Service (AKS) to Axiom. You will be able to stream and analyze your logs.

We’ll set up an AKS deployment from scratch and configure it to log directly to Axiom. If you already have an AKS deployment, feel free to skip to step 7.

Prerequisites

For this tutorial, you will need:

  • Access to an Axiom deployment

  • Azure account, create one here if you don’t have one

  • Azure CLI installed

Azure Kubernetes Service (AKS) is a robust and cost-effective container orchestration service that helps you to deploy and manage containerized applications in seconds where additional resources are assigned automatically without the headache of managing additional servers.

Using Axiom for log management means you can log more data from AKS and keep it for longer. This means you and your team have every piece of detail should something go wrong or if you just want to see how well your services are running!

With this, you can deploy your logs from Azure Kubernetes Service directly to Axiom

Let's get to it 🔥

  1. Make sure you’ve logged into Azure

Azure1

  1. Create a resource group you will use for your AKS Configuration

Azure resource group is a container that holds related resources for your Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group. You decide how you want to allocate resources to resource groups based on what makes the most sense for your organization.

Azure2

  1. In your resource group dashboard, click on add

Azure3

  1. Select Kubernetes service

Azure4

  1. Create your Kubernetes Cluster.
  • Enter your Kubernetes cluster name
  • Choose your Region
  • Select the Kubernetes version you want to use

Azure5

Review your configuration and click on Create

Azure6

  1. When your deployment is complete, click on connect to a cluster.

Azure7

This gives you the commands you need to configure and interact directly with your cluster using Azure Kubernetes Service command-line tooling. Run and paste the commands in your terminal.

Azure8

  1. Now, let’s switch back to Axiom for a section. Head to Settings → Datasets and create a new dataset for your AKS logs.

Azure9

To create an ingest Token,

  • On the Axiom UI, under 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, token can be seen again by selecting Ingest Tokens.

Azure10

  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.
env:
	- name: AXIOM_HOST
	  value: http://cloud.axiom.co // replace with your self-host url if needed
	- name: AXIOM_DATASET_NAME
	  value: aks-logs
	- name: AXIOM_INGEST_TOKEN
	  value: xait-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

  1. Apply and run your .yaml file using kubectl apply -f (NAME OF FILE).yaml. The Filebeats pods will be created and you should see them running on the Azure portal.

Azure11

  1. Back in Axiom, you will see your logs from AKS streaming in live to the dataset you created earlier. You can now gather insights on your logs and run aggregations across all the matching data to produce various types of visualizations as well as a table of results.

Azure12

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

Azure13

Merci 🎀

Whew, you did it! Thanks for following along. 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!

Join us in changing how developers think about data