Skip to main content

Aquire Manager Logs When Deployed Using Kubernetes

This document describes how to aquire logs for the Fluent Manager application when deployed using Kubernetes.

info

Before you can get the logs for the Fluent Manager application, you will need the Kubernetes config entry in the kubectl command line tool. To do that check out this section in the Kubernetes Hosting Guide for creating the kubectl config entry for your specific provider .

Step 1: Get Name of the Pod You Want to Get Logs From

Once kubectl is configured, you can get the names of the pods by running the following command to get the details for all the nodes in your kubernetes cluster:

kubectl describe nodes
tip

You can write the output to a file instead of the console by specifying a file after them command like so:

kubectl describe nodes > nodes.txt

This will give alot of information. The only section we care about is the *Non-terminated Pods" section. An example output is shown below:

Non-terminated Pods:          (11 in total)
Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits Age
--------- ---- ------------ ---------- --------------- ------------- ---
fluent backend-78d94dd58b-gsfxb 0 (0%) 0 (0%) 0 (0%) 0 (0%) 19h
fluent db-98c67fc67-89vgd 0 (0%) 0 (0%) 0 (0%) 0 (0%) 19h
fluent frontend-d9dd456c5-k295r 0 (0%) 0 (0%) 0 (0%) 0 (0%) 19h
fluent restful-engine-5c9698d96d-k9tfm 0 (0%) 0 (0%) 0 (0%) 0 (0%) 19h
kube-system azure-cns-p9t5g 40m (2%) 40m (2%) 250Mi (3%) 250Mi (3%) 20h
kube-system azure-ip-masq-agent-5t8rq 100m (5%) 500m (26%) 50Mi (0%) 250Mi (3%) 20h
kube-system cloud-node-manager-7fm25 50m (2%) 0 (0%) 50Mi (0%) 512Mi (7%) 20h
kube-system csi-azuredisk-node-2dmc2 30m (1%) 0 (0%) 60Mi (0%) 800Mi (11%) 20h
kube-system csi-azurefile-node-mqnbm 30m (1%) 0 (0%) 60Mi (0%) 600Mi (8%) 20h
kube-system konnectivity-agent-6b549f9f87-9nnb4 20m (1%) 1 (52%) 20Mi (0%) 1Gi (14%) 19h
kube-system kube-proxy-rcf2p 100m (5%) 0 (0%) 0 (0%) 0 (0%) 20h

Here we can see the name of the pods as well as the namespace they belong to.

Step 2: Retrieve the Logs from the Pod

Now that we have the pod and namespace name, we can easily extract the logs. To get the logs you can run the following command:

kubectl logs -n <namespace> <pod-name>

For example, to get the logs for the backend pod in the fluent namespace, run the following command:

kubectl logs -n fluent backend-78d94dd58b-gsfxb
tip

Like before, you can write this info to a file by specifying a file after the command like so:

kubectl logs -n fluent backend-78d94dd58b-gsfxb > backend_logs.txt