The aim of this project is to have a Kubernetes cluster maintaining Cryptocurrency Mining Containers automatically. This project was not meant for profitability, this was to improve my AWS, Docker and Kubernetes knowledge.
The proof-of-concept cluster is available at https://api.kubernetes.vjeeva.com/ taken down for the time being - cost related.
NOTE: This readme will look raw, lots of work went into getting this working properly. Will clean up documentation as time permits, writing down raw notes for reference purposes.
ZCashMiner Docker Image: https://hub.docker.com/r/vjeeva/zcashminer/
To run local Vagrant Kops Box:
- Install Vagrant: https://www.vagrantup.com/downloads.html
- Have your terminal in the kops-vagrant-box folder and run
vagrant up
.
NOTE: This can change! Plans for upgrades are in section Plans and Upgrades.
Kops Vagrant Box configured to AWS to create and maintain Kubernetes cluster on AWS.
- Zone: US East (North Virginia)
- Node Size: t2.micro
- Number of Nodes: 2
- Master Node Size: t2.micro
- Domain: kubernetes.vjeeva.com
To create Kubernetes cluster on AWS with the Kops Vagrant Box:
kops create cluster --name=MyKubernetesDomain --state=s3://MyAWSS3Bucket --zones=us-east-1c --node-count=2 --node-size=t2.micro --master-size=t2.micro --dns-zone=MyKubernetesDomain
Note that once this runs, to complete you must any further commands with the --state=s3://MyAWSS3Bucket.
To deploy the app, first copy the zcashminer-deployment.yml to your Kops Vagrant Box. Then run:
kubectl create namespace zcashminer
kubectl create -f zcashminer-deployment.yml
Status:
kubectl exec --namespace=zcashminer CONTAINERNAME zcash-cli getinfo
Generate z-address for tranfer:
kubectl exec --namespace=zcashminer CONTAINERNAME zcash-cli z_getnewaddress
Generate z-addresses in wallet:
kubectl exec --namespace=zcashminer CONTAINERNAME zcash-cli z_listaddresses
Get balances:
docker exec CONTAINERID zcash-cli z_getnewaddress ${ADDRESS}
A list of milestones and accomplishments:
- Dockerfile is located in docker-template/Dockerfile. Image is pushed to Docker Hub.
- New Dockerfile replacing old one mines Zcash instead of Ethereum, Ethereum miner literally mined 0 hashes.
- Cluster Deployed on AWS with 2 t2.micro nodes each running one container.
- Kubernetes Dashboard on public domain (associated with my personal domain)
- Updated kops to 1.6.0 (released on May 16, updated by me on May 22)
- Will beef up later and move to spot instances to get on c4.large (exciting)
- CA Certs for Dashboard
- Graphing and Miner Stats on Kubernetes Dashboard