Remote kubectl Kubernetes

Access remote Kubernetes clusters through NFLTR tunnels. Run kubectl, helm, and k9s from anywhere — without VPN, bastion hosts, or exposing the Kubernetes API server to the internet.


Architecture

Deploy an NFLTR agent inside (or next to) your Kubernetes cluster. The agent tunnels port 6443 (kube-apiserver) back to the NFLTR server. From your workstation, run nfltr tcp to create a local port that connects to the remote cluster's API.

YOUR LAPTOP kubectl → :6443 helm → :6443 nfltr tcp --local 6443 Home / coffee shop / airport NFLTR SERVER TCP Tunnel Route Auth + Routing KUBERNETES CLUSTER NFLTR Agent Pod / DaemonSet kube-apiserver :6443 etcd workloads Private VPC / no public IP

Setup

1. Deploy the agent in your cluster

# Using kubectl to run the agent as a Pod
kubectl run nfltr-agent --image=ghcr.io/onpremlink/nfltr \
  -- tcp 6443 \
  --server grpc.nfltr.xyz:443 \
  --api-key $NFLTR_API_KEY \
  --name prod-k8s \
  --forward kubernetes.default.svc:6443

2. Connect from your workstation

# Create local port mapping to the remote cluster
nfltr tcp-connect prod-k8s 6443 --listen :6443

# Now kubectl works as if the cluster is local
kubectl --server=https://localhost:6443 get pods
helm list
k9s

3. Update kubeconfig (optional)

# Add a context pointing to the tunnel
kubectl config set-cluster tunnel-prod \
  --server=https://localhost:6443 \
  --insecure-skip-tls-verify

kubectl config set-context tunnel-prod \
  --cluster=tunnel-prod --user=admin

kubectl config use-context tunnel-prod

What Works Through the Tunnel

Tool Works? Notes
kubectlYesAll subcommands including exec, logs -f, port-forward
helmYesInstall, upgrade, rollback, list
k9sYesFull interactive dashboard
lensYesPoint at localhost:6443
ArgoCD CLIYesManage apps remotely
kustomizeYesApply with kubectl apply -k
💡 Multiple clusters

Deploy an agent per cluster with different agent IDs (prod-k8s, staging-k8s, dev-k8s). Switch between them by changing which agent you tunnel to. Combine with fleet management and labels for organized multi-cluster access.

Security

Use Cases

kubectl from anywhere

Access private Kubernetes clusters through a single tunnel — no VPN required.

CLI Reference On-Premise Access →