kubectl exec -it gives you. In Ankra you open one from the pod’s Exec tab in the browser, or with ankra cluster terminal from your own shell, with no kubeconfig and no port-forward. Every session is recorded in the audit log.
Before you start
- Your role needs
kubernetes.execon the cluster. Theowner,adminandoperatorroles hold it;memberandviewerdo not. Without it the Exec tab saysYou need kubernetes.exec permission on this cluster.See Roles & Access. - The cluster’s agent must be connected, and the container must be running.
- The shell you pick must exist in the container image.
Opening a Terminal
1
Open the pod
Go to Infrastructure → Clusters → <your cluster> → Technical details → Kubernetes → Workloads → Pods and click a running pod.
2
Open the Exec tab
Click Exec. The Exec into a container section reads
Disconnected. Choose Connect to start a session.3
Pick the container and shell
Pick the container in Container and the shell in Shell:
/bin/sh (the default), /bin/bash, /bin/ash or /bin/zsh.4
Connect
Click Connect. The status line reads
Connected. Switching views or hiding this tab disconnects the session. and the terminal takes your keystrokes.From the CLI
The same terminal is available from the shell you are already in, through the platform - no kubeconfig and no port-forward:exit or Ctrl-D. A pod with one container needs nothing more; one with several takes --container. The command needs kubernetes.exec on the cluster, and the session is recorded and audited exactly like a portal one (see Recorded sessions). ankra cluster debug create --attach uses it to drop straight into a freshly created debug pod.
One-off commands
To run a single command rather than open a shell - apsql -c check, a curl from inside the pod, reading a config file - use ankra cluster exec. It runs the command, streams its output, and exits with the command’s own exit code, so a script or CI job can branch on it:
-- is passed to the container exactly as given: no shell re-parses it, so quote once for your local shell and not again. For pipes, globs or variables, run a shell explicitly: -- sh -c 'env | grep ^APP_'. (ankra cluster terminal --shell names a shell binary and cannot carry arguments; exec is the way to run a command.)
The command runs without a TTY. When it ran,
ankra cluster exec exits with its exit code; otherwise with the CLI’s usual codes (6 for a refused credential, 7 without kubernetes.exec, 1 when the command could not be started, for example because the binary does not exist in the image).
exec goes through the same platform relay as the terminal: it needs kubernetes.exec on the cluster, and each run is recorded with an open_pod_terminal audit row whose details carry the exact command (command: [...]) instead of a shell. It needs a cluster agent recent enough to run one-off commands; an older agent is refused with the version it needs and nothing is run - upgrade it with ankra cluster agent upgrade.
Features
Supported Shells
Recorded sessions
Every terminal session opened through Ankra is recorded, and so is everyankra cluster exec. Opening a shell writes an open_pod_terminal row to the audit log naming who opened it, into which container, with which shell (or, for exec, the command it ran); while the session runs, everything typed and everything the container answered is stored with it, up to 4 MiB per session (longer sessions are marked truncated).
Anyone with audit.read (the owner and admin roles) can review a session. Open Infrastructure → Clusters → <your cluster> → Technical details → Audit log, open the open_pod_terminal row and click Replay terminal recording. The Terminal recording page shows the Session facts (pod, container, who opened it, when it started and ended, and whether the recording is complete) and the Recorded output: click Play replay to play it back, pick a Replay speed, and Pause replay to stop. From the CLI, ankra org terminal-session <session-id> --transcript prints the same recording.
A recording contains whatever the shell printed, secrets included. Transcript access is gated on
audit.read; the transcript itself never travels inside the audit row.recording_unavailable; a session whose recording failed part-way through is marked as degraded.
Ankra keeps a session’s transcript for 90 days by default. When a transcript is pruned at the end of that period, the session’s facts - who, where, when, how it ended, how much was recorded - stay with the audit row, and the replay says the transcript was pruned and when, rather than showing an empty recording.