Crypto Wallets on Kubernetes
- MacBook Pro (16gb ram)
- 4 x Atomic Pi (x86 Intel, 2gb ram, 32gb ssd)
- Raspberry Pi 4 NFS Server (4gb ram, 1tb ssd)
- k3s
- MetalLB
- Skaffold
- VS Code
- Prepare development environment.
- Install NFS server.
- Install k3s cluster.
- Configure MetalLB.
- Deploy crypto wallets.
- Deploy block explorers.*
- Deploy web wallets.*
* = Incomplete or Not Started
A. Configure Atomic Pi's for k3s.
- OS: Atomic Pi Pre-loaded - https://www.digital-loggers.com/api_faqs.html#OriginalOS
- Give each atomic pi a distinct hostname
sudo nano /etc/hostname
- Disable Swap
- Set Static IP
sudo nano /etc/dhcpcd.conf
- Add the following to the end of file, editing to fit your needs.
interface eth0
static ip_address=192.168.0.87/24
static routers=192.168.0.1
statis domain_name_servers=75.75.75.75
- https://raspberrypi.stackexchange.com/questions/68477/static-ip-configuration-in-dhcpcd-conf-ignored
B. Add host entries to /user/username/.ssh/config
.
- Example ssh config file located on MacBook Pro:
# example atomic pi ssh config
# example path: /user/username/.ssh/config
Host atomic
HostName atomic.local
Port 22
User atomicpi
IdentityFile ~/.ssh/id_openvpn
Host atomic2
HostName atomic2.local
Port 22
User atomicpi
IdentityFile ~/.ssh/id_openvpn
Host atomic3
HostName atomic3.local
Port 22
User atomicpi
IdentityFile ~/.ssh/id_openvpn
Host atomic4
HostName atomic4.local
Port 22
User atomicpi
IdentityFile ~/.ssh/id_rsa
C. Install Ansible and skaffold on MacBook Pro
brew install ansible skaffold
- More Atomic Pi resources
A. Update Raspberry Pi 4 and upgrade.
sudo apt update && sudo apt upgrade -y
B. Install the NFS server packages.
sudo apt-get install nfs-kernel-server portmap nfs-common
C. Create the NFS folder for sharing.
export MOUNT=/media
mkdir -p $MOUNT/nfs && \
sudo chmod -R 777 $MOUNT/nfs
sudo chown nobody:nogroup $MOUNT/nfs
D. Add share folder to /etc/exports
.
sudo echo -e "$MOUNT/nfs 192.168.1.0/24(rw,sync,no_subtree_check,insecure,no_root_squash)" >> /etc/exports
E. Reset exports.
sudo exportfs -a
F. Restart the NFS service.
sudo systemctl restart nfs-kernel-server
A. Use Ansible playbook.
- Download the latest playbook
git clone https://github.com/boyroywax/crypto-k8s
B. Configure the playbook.
- Add your master and nodes to
hosts.ini
, use the Host name from the ssh config file.
# ansible-k3s-atomicpi/hosts.ini
[master]
atomic
[node]
atomic2
atomic3
atomic4
[k3s-cluster:children]
master
node
- Edit
group_vars/all.yml
. Pay attention to the IP of your master.
Full_clean_install
deletes all previous k3s files for a fresh install.
The file is commented with the variables description.
C. Run the Ansible playbook. *
make
D. K3s config file located at ansible-k3s-atomic/files/k3s.yml
export KUBECONFIG=$PWD/ansible-k3s-atomic/files/k3s.yml
kubectl get nodes # test by checking for nodes
A. Edit the IP address range in config.yaml
.
B. Run the run_metal.sh
script.
./run_metal.sh
A. Deploy with scripts.
- Create
crypto
namespace.
kubectl create ns crypto
- Run
deploy_all.sh
script.
./deploy_all.sh
- Clean Up: Remove crypto wallets.
./delete_all.sh
- Getinfo from all the running wallets.
./getinfo_all.sh
B. Deploy with skaffold.
- Individually start a wallet
cd wallet-docker/coinname-wallet-docker
skaffold run --tail
C. Deploy with Helm - NOT COMPLETE