kubectl ssh-proxy

Proxy OpenSSH client tools through Kubernetes pod

flowchart LR
    subgraph client
        Start[kubectl ssh-proxy]
    end
    subgraph k8s
        kube-api-server <-->|exec| pod(ssh-proxy-pod)
        pod <--> nc
        nc <-->|ssh| End[targetHost]
    end
    Start[kubectl ssh-proxy] <-->|HTTPS| kube-api-server

Prerequisites

Installation

kubectl krew install --manifest-url https://raw.githubusercontent.com/infinite-turtles/kubectl-ssh-proxy/main/deploy/krew/plugin.yaml

Usage

kubectl ssh-proxy [flags] ssh|scp|sftp [flags] [arguments]

# ssh login to remote system
kubectl ssh-proxy ssh [email protected]

# scp secure file copy
kubectl ssh-proxy scp localpath [[email protected]]host:[path]

# sftp secure file transfer
kubectl ssh-proxy sftp [[email protected]]host[:path]

GitHub

View Github