Kubernetes: `kubectl debug`

Getting started with Akita is as simple as dropping our Agent into your pod. Below are instructions for starting a new ephemeral container with an Akita Agent sidecar in an existing Kubernetes pod.

📘

Requirements

In order to use this method, you must have:

  • Kubernetes v1.18+
  • Alpha features in Kubernetes enabled, and
  • kubectly debug specifically must be enabled.

To get the Akita agent running as a sidecar in a new ephemeral container in a single Kubernetes service, you will:

  1. Meet the prerequisites
  2. Create an Akita Project
  3. Generate an API key for the Akita Agent
  4. Attach the Akita Agent as a sidecar
  5. Verify that the Akita Agent is working

Thanks to Bruno Felix, who experimented with this method and provided us with his examples!

Prerequisites

You must have an Akita account to use Akita. You can create an account here.

Your Kubernetes service must:

  • have access to the public internet
  • use unencrypted HTTP
  • be version 1.18 or higher
  • have alpha features enabled
  • have kubectly debug enabled

Create a project

Log into the Akita App, and go to the Settings page.
Enter a project name and click "Create Project". We suggest naming the project after your app or deployment stack.

2254

Give your project a name that's easy to remember – you'll need it later, when you start the Akita Agent on the CLI.

Generate API key

On the same Settings page, locate and click the “API Keys” tab. Click the “Set up the Akita client” button. Copy your API key secret into your favorite password manager or somewhere else you can easily access it. Also note your API key, as you will need it later.

780

Attach Agent

To attach the Akita Agent as a sidecar:

  1. Identify the name of the pod that is running the app or service you want Akita to monitor.
  2. Identify the port the pod is running on.
  3. Run the below command, inserting your Akita Project name, API key ID, and key secret.
kubectl debug -it myservice-xyzabc \
   --image=akitasoftware/cli:latest \
   --env="AKITA_API_KEY_ID=$AKITA_API_KEY_ID" \
   --env="AKITA_API_KEY_SECRET=$AKITA_API_KEY_SECRET" \
   -- akita apidump --project my-project-name

Verify

If the command was successful, you will see the akita apidump output. Use Ctrl+C to stop the trace as if you were running normally from the command line.

In the Akita web console, check out the incoming data on the Model page. You should see a map of your API being generated as the Akita Agent gathers data.

Then check out the Metrics and Errors page to get real-time information on the health of your app or service.