Tool: kubectl-klone

| Dec 27, 2023 min read

More:

kubectl-klone

Klone is a tool that creates a replica of any Kubernetes pod in the same environment as the original.

The replica retains the following characteristics of the original

  • Egress connections
  • Resourcing
  • Configurations
  • Flags

Differences from the original pod

  • Klone creates a separate port forward tunnel to the ingress of the replica. The replica can only be accessed through this tunnel.
  • The port forward tunnels can be used to send a request to this duplicate pod (using Curl/ Postman) or to connect to the pod directly from IDE and debug remotely

Klone is language-agnostic

About

kubectl klone extension helps create an isolated pod for a deployment. Newly created pod has a new service and ingress path created for it. The egress dependencies remain same as other deployment pods.

How To

Install

Run following commands in your terminal to install Klone:

git clone [email protected]:zerok-ai/kubectl-klone.git
cd kubectl-klone
export PATH=$PATH:$(pwd)

Confirming installation

sh$ kubectl klone

Confirm installation

Klone Commands

Duplicate a pod

sh$ kubectl klone duplicate pod <pod-name> -n external

Duplicate a pod

Connect to duplicated pod

sh$ kubectl klone connect service klone-pod -n external

Connect services to the duplicated pod

clean up:

kubectl klone clean -n external

Clean up klone