Page cover

cldkctl console

The console command allows you to execute commands inside a running container of a Kubernetes pod. This is useful for debugging or inspecting the state of your containerized application directly from the terminal. It opens an interactive shell session or executes a specific command within a container of a running pod — similar to running: kubectl exec -it <pod-name> -- /bin/sh

Usage

cldkctl console [pod name] [flags]

Steps

Follow the steps below to run and view the result of this command:

  1. Retrieve the list of running pods in your project to identify the target pod name.

./cldkctl get pod
  1. Run the console command with the desired pod name:

./cldkctl console [pod-name]
  1. Specify the container name if the pod has multiple containers:

./cldkctl console [pod-name] --container [container-name]
  1. Define the namespace if the pod is in a non-default namespace:

./cldkctl console [pod-name] --namespace [namespace-name]
  1. Once executed, the CLI opens an interactive terminal session inside the container. You can run shell commands directly from within the container environment.

Flags

circle-info

This command supports global flags. Refer to the Global Flags section for details

Flag
Description

-c, --container string

Specify the container name (default: the first container in the list).

-h, --help

Help for the console command.

-n, --namespace string

Specify the Kubernetes namespace to scope the operation.

-p, --project string

Specify the project ID.

Last updated