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
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.
Run following commands in your terminal to install Klone:
git clone git@github.com:zerok-ai/kubectl-klone.git
cd kubectl-klone
export PATH=$PATH:$(pwd)
sh$ kubectl klone
sh$ kubectl klone duplicate pod <pod-name> -n external
sh$ kubectl klone connect service klone-pod -n external
clean up:
kubectl klone clean -n external