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.
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
- Make sure you’ve logged into Azure
- 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.
- In your resource group dashboard, click on add
- Select Kubernetes service
- Create your Kubernetes Cluster.
- Enter your Kubernetes cluster name
- Choose your Region
- Select the Kubernetes version you want to use
Review your configuration and click on Create
- When your deployment is complete, click on connect to a cluster.
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.
- Now, let’s switch back to Axiom for a section. Head to Settings → Datasets and create a new dataset for your AKS logs.
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.
- 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
- Apply and run your
kubectl apply -f (NAME OF FILE).yaml.The Filebeats pods will be created and you should see them running on the Azure portal.
- 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.
- 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.
Whew, you did it! Thanks for following along. You can read more about Axiom Kubernetes configuration on our docs.