> Markdown version of https://tuna.am/en/docs/cli/kubernetes/. Documentation index: [llms.txt](https://tuna.am/en/llms.txt), full text in one file: [llms-full.txt](https://tuna.am/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# tuna kubernetes

Start a Kubernetes API tunnel.

Alias: `k8s`.

Guide with examples: [Kubernetes](https://tuna.am/en/docs/tunnels/kubernetes.md).

Usage

```bash
tuna kubernetes [flags]

```

Examples

```bash
tuna kubernetes
tuna kubernetes --context=staging
tuna kubernetes --context=staging --service-account=debug
tuna kubernetes --context=staging --service-account=ops/debug --ttl=4h
tuna kubernetes --context=staging --namespace=shop --read-only
tuna kubernetes --context=staging --preset=view
tuna kubernetes --context=staging --preset=debug --namespace=shop

```

| Flag                        | Description                                                                                                          |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `--api-key string`          | Your tuna.am api key with the tunnels:connect scope (env `TUNA_API_KEY`).                                            |
| `--context string`          | Kubeconfig context to expose (default is the current context).                                                       |
| `--deny-resource string`    | Deny these resource kinds for the session regardless of RBAC (secrets, configmaps). Can be repeated.                 |
| `--deny-subresource string` | Deny these subresources for the session regardless of RBAC (exec, attach, portforward, log, proxy). Can be repeated. |
| `-d, --domain string`       | Host tunnel on a custom domain.                                                                                      |
| `--download-limit int`      | How many times the guest kubeconfig can be downloaded (0 removes the limit). Default: `1`.                           |
| `--inspect`                 | Enable or disable the request inspector. Default: `true`.                                                            |
| `--inspect-port int`        | Inspector port, the tunnel fails if it is busy (also `TUNA_INSPECT_PORT`).                                           |
| `--kubeconfig string`       | Path to the kubeconfig file.                                                                                         |
| `--namespace string`        | Restrict access to a single namespace.                                                                               |
| `--no-delete`               | Deny deleting resources while allowing other writes.                                                                 |
| `--preset string`           | Access preset that bundles restrictions (view, observer, debug, open); explicit flags add to it.                     |
| `--read-only`               | Allow read requests only.                                                                                            |
| `--service-account string`  | Limit the guest to the rights of this service account (\[namespace/]name).                                           |
| `-s, --subdomain string`    | Temporary subdomain (default: random temporary subdomain).                                                           |
| `--ttl duration`            | How long the granted access stays valid (0 removes the limit).                                                       |

[Global flags](https://tuna.am/en/docs/cli.md#global-flags) work too.
