Skip to content

awslabs/kubectl-connect

kubectl-connect

 _        _            _   _                           _
| |___  _| |__  ___ __| |_| |  __ ___ _ _  _ _  ___ __| |_
| / / || | '_ \/ -_) _|  _| | / _/ _ \ ' \| ' \/ -_) _|  _|
|_\_\\_,_|_.__/\___\__|\__|_| \__\___/_||_|_||_\___\__|\__|

Usage

Command Flags

Usage:
  kubectl connect [flags]
  kubectl [command]

Flags:
  -d, --destination string   Destination pod name
  -h, --help                 help for kubectl
  -n, --namespace string     Namespace (default "default")
  -p, --port int             Port (default 22)
  -s, --source string        Source pod name
  -t, --timeout int          Timeout in seconds (default 10)

Usage Example

% kubectl connect -d pod02 -s pod01 -n default -p 22
Checking connectivity from pod01 to pod02 on port 22 in namepsace default....
SUCCESS!
Connectivity between pod01 and pod02 is OK.  Took 5.95197872s.

Installation

You can install kubectl connect either via source, or by using the Krew plugin manager.

Installation from Source:

## Clone This Repo
% git clone git@github.com:awslabs/kubectl-connect && cd kubectl-connect

## Pull Necessary Dependencies
% go get kubectl-connect

## Build Package
% go build .

## Move Plug-In Binary Into System Path
% sudo mv kubectl-connect /usr/local/bin

Note that if you need to compile this package for a non-native system architecture, such as building for x86_64/Linux from aarch64/macOS for example; modify the above go build . command as follows: GOOS=linux GOARCH=x86_64 go build .

Installation using Krew Plug-In Manager:

## Install Package
% kubectl krew install kubectl-connect

Dependencies

  • kubectl - Kubernetes CLI Tool
  • krew - Plug-In Package Manager for kubectl
  • Go - Version 1.21

Bug Reports, Contributing and Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.