To use kubectl on a phone, SSH into a server or bastion that already holds the kubeconfig. Four pieces keep typing to a minimum: the k alias, a context and namespace pinned with kubectl config, kubectl get pods -n to list pods, and logs -f or describe to diagnose a specific pod.
The k alias and kubectl completion on a mobile keyboard
alias k=kubectl turns a seven-letter command into one letter. It is the first line worth adding to the bastion's ~/.bashrc. kubectl also generates its own bash completion script, and you can hook that script to the alias so Tab completes resources, pods and namespaces.
# ~/.bashrc on the server that holds the kubeconfig
source <(kubectl completion bash)
alias k=kubectl
complete -o default -F __start_kubectl kNow k get po plus Tab fills in the pod name instead of making you copy a random hash by hand. For zsh, kubectl completion zsh generates the equivalent script. On a phone, the catch is that the system keyboard has no Tab key. termi1's keyboard puts Tab in a top row alongside Esc, Ctrl and the arrow keys. It also suggests options as you type, which saves taps on flags like -n and -o.
kubectl context and namespace: pin them and stop typing -n
kubectl config current-context shows which cluster every command will hit. Run it before you change anything from a phone: on a narrow screen a long prompt gets truncated, and it is easy to lose track of where you are.
k config current-context
k config get-contexts
k config use-context staging
k config set-context --current --namespace=paymentsAfter the last command, get, logs and describe act on payments without -n. You only need -n to peek at another namespace. The change is written to the kubeconfig, so it also affects any other session on that server that uses the same file.
If the bastion can reach production, tag that connection as production in termi1. With the tag set, Production Guard applies: no AI-suggested command gets Enter automatically. Anything that deletes, stops or changes something, such as k delete pod or k scale, is also held back before it reaches the prompt.
kubectl get pods -n: listing and watching pods from a phone
kubectl get pods -n <namespace> lists pods with their status, restart count and age. With the alias it becomes k get pods -n payments, or just k get po once the namespace is pinned.
k get pods -n payments
k get pods -n payments -o wide
k get pods -n payments -w
k get pods -A --field-selector=status.phase!=Running-o wide adds the node and the pod IP. That output does not fit in portrait, so rotate the phone to landscape. -w keeps the list open and prints every status change until you press Ctrl+C. The last line searches every namespace for pods that are not Running, which is usually the most useful query when an alert fires.
kubectl logs -f and describe: diagnosing a pod without a laptop
kubectl logs -f streams a container's output in real time. kubectl describe pod prints the Events section, which usually explains why a pod will not start or keeps restarting.
k logs -f api-6f8b9c-x2k4p -n payments --tail=100
k logs api-6f8b9c-x2k4p -n payments -c sidecar --since=10m
k logs api-6f8b9c-x2k4p -n payments --previous
k describe pod api-6f8b9c-x2k4p -n payments--tail=100 stops thousands of lines from flooding a mobile connection before the stream starts. -c picks the container when the pod runs more than one. --previous shows the logs of the last run, which is what you need for a CrashLoopBackOff. describe output is long; PgUp and PgDn on the fn layer of termi1's keyboard let you page through it without scrolling by finger.
If you need the full log, redirect it to a file with k logs api-6f8b9c-x2k4p -n payments > /tmp/api.log. Then pull it to the phone with termi1's built-in SFTP, without leaving the session. For long commands you can also type or dictate a sentence such as "last hundred lines of the api pod in payments". The AI turns it into the command and types it at the prompt without pressing Enter; in Review mode it never presses Enter. The AI does not open the session and never receives keys or passwords.
kubectl on mobile versus desktop: what changes for each task
kubectl commands are identical on both; what changes is how you reach the keys and how the session survives.
| kubectl task | Desktop | iOS/Android with termi1 |
|---|---|---|
| Completing pod names | Tab on a physical keyboard | Tab in the keyboard's extra row |
| Stopping logs -f or get -w | Ctrl+C directly | Ctrl key in the extra row, then C |
| Reading a long describe | Mouse wheel or PgDn | PgUp/PgDn on the fn layer |
| Typing long flags | Fast two-handed typing | k alias, completion and as-you-type suggestions |
| Switching networks | Stable wired or wifi connection | Mosh keeps the session from wifi to mobile data |
| Saving a log locally | scp or kubectl cp | Built-in SFTP without leaving the session |
Keeping a kubectl session alive on mobile with Mosh and tmux
Mosh uses UDP, by default on ports 60000-61000, and starts mosh-server over an initial SSH connection. The bastion therefore needs SSH reachable (OpenSSH listens on TCP port 22 by default) and that UDP range open. With Mosh, a running k logs -f stays on screen when the phone moves from wifi to mobile data.
To keep the stream running after you close the app, start it inside tmux:
tmux new -s k8s
k logs -f api-6f8b9c-x2k4p -n payments --tail=100
# Ctrl+b, then d to detach; when you come back:
tmux attach -t k8stermi1 uses tmux so whatever you leave running is still there when you return. The full key reference lives in the official tmux repository. Note that Mosh does no port forwarding, so a kubectl port-forward on the bastion cannot reach the phone that way. If the bastion has no public IP or open ports, a private mesh network such as Prialo, or Tailscale, lets you reach it without exposing it. If you need a client, the mobile SSH and Mosh terminal from Sinergia works without an account and is available as an SSH terminal for iPhone and on Google Play.
Frequently asked questions
How do I use kubectl from an iPhone or Android phone?
To use kubectl from an iPhone or Android phone, SSH into a server or bastion that already has kubectl and the cluster's kubeconfig. The phone only needs an SSH client. The key can be generated on the phone itself and added to authorized_keys with 600 permissions.
How do I change the default namespace in kubectl?
The default namespace in kubectl is changed with kubectl config set-context --current --namespace=name. From then on, get, logs and describe act on that namespace without -n, until you change it again or switch to another context with kubectl config use-context.
How do I stop kubectl logs -f on a phone?
kubectl logs -f stops with Ctrl+C, exactly as on a computer. On a phone you need a Ctrl key, which the system keyboard does not provide; termi1's keyboard includes it in its extra row. To keep the stream running, start it inside tmux and detach.
Is it safe to run kubectl against production from a phone?
Running kubectl against production from a phone is as safe as the bastion and the key you use. Check kubectl config current-context before acting. In termi1, Production Guard holds back commands that delete, stop or change something on connections tagged as production, before they reach the prompt.