Telepresence can be used to make a connection from the cluster to your local machine. Telepresence is designed to intercept cluster commmunication and forward it to your local machine so we will have to install a dummy pod and service to receive the traffic that will get forwarded.
warnet deploy path/to/network/directory
Install the open source version of Telepresence.
# find path to most recent release for your architecture and OS
# https://github.com/telepresenceio/telepresence/releases
wget [URL of release]
# assuming AMD64 linux binary (replace as needed)
sudo mv telepresence-linux-amd64 /usr/local/bin/telepresence
sudo chmod +x /usr/local/bin/telepresence
telepresence version
If on Mac OS you may need to remove telepresence from quarantine
sudo xattr -d com.apple.quarantine /usr/local/bin/telepresence
telepresence helm install
telepresence connect
telepresence version
should now show something like this:
OSS Client : v2.19.1
OSS Root Daemon : v2.19.1
OSS User Daemon : v2.19.1
OSS Traffic Manager: v2.19.1
Traffic Agent : docker.io/datawire/tel2:2.19.1
In this example we are installing a nginx pod but any image should work as the network traffic will not actually arrive at this pod and will instead be redirected to your local machine.
# Image here can be anything. Just picking a popular image.
kubectl create deploy local-bitcoind --image=registry.k8s.io/nginx
kubectl expose deploy local-bitcoind --port 18444 --target-port 18444
The intercept command starts the process that will recieve the traffic. In this case, bitcoind process.
mkdir /tmp/connect
# Assumes you have bitcoind installed and available on the PATH
telepresence intercept local-bitcoind --port 18444 -- bitcoind --regtest --datadir=/tmp/connect
warnet bitcoin rpc 0 addnode "local-bitcoind:18444" "onetry"
# Check that the local node was added
warnet bitcoin rpc 0 getpeerinfo
# Disconnect from the cluster
telepresence quit -s
# Remove Telepresence from the cluster
telepresent helm uninstall
# Remove Telepresence from your computer
sudo rm /usr/local/bin/telepresence