AKubernetes-nativewayofdeployingMoneronodes,networks,andminers:expressyourintentionandletKubernetesrunitforyou.
you:"Hi,I'dliketwopublicnodes,andthreeminersplease".
k8s:"Surething"
k8s:"Itlookslikeyouwanttwopublicnodes,butIsee0running-letmecreatethemforyou."
k8s:"Itlookslikeyouwantthreeminers,butIsee0running-letmecreatethemforyou."
you:"Actually,Ichangedmymind-Idon'twanttomineonminexmr,Iwantcryptonode.social".
k8s:"Goodchoice,poolconcentrationsucks-letmeupdateyourminersforyou:)"
See./docsfordetaileddocumentationabouteachresource.
ExampleFullnodeMiningclusterPrivatenetworkInstallLicenseExampleFullnodeTorunasinglefullnode,allyouneedtodoiscreateasingle-replicaMoneroNodeSet.
kind:MoneroNodeSetapiVersion:utxo.com.br/v1alpha1metadata:name:full-nodespec:replicas:1WithaMoneroNodeSetyouexpresstheintentionofhavingasetofmonerodnodesrunningwithaparticularconfiguration:youexpressyourintent,andmonero-operatortakescareofmakingithappen.
Forinstance,withkubectl-treewecanseethattheoperatortookcareofinstantiatingaStatefulSet
$kubectltreemoneronodeset.utxo.com.brfull-nodeNAMESPACENAMEREADYdefaultMoneroNodeSet/full-nodeTruedefault├─Service/full-node-default│└─EndpointSlice/full-node-d2crv-default└─StatefulSet/full-node-default├─ControllerRevision/full-node-856644d54d-default└─Pod/full-node-0Truewithapre-configuredsetofflags
$kubectlgetpodfull-node-0-ojsonpath={.spec.containers[*].command}|jq'.'["monerod","--data-dir=/data","--log-file=/dev/stdout","--no-igd","--no-zmq","--non-interactive","--p2p-bind-ip=0.0.0.0","--p2p-bind-port=18080","--rpc-restricted-bind-ip=0.0.0.0","--rpc-restricted-bind-port=18089"]andaPersistentVolumeClaimattachedwithenoughdiskspaceforit.
$kubectlgetpvckubectlgetpvcNAMESTATUSVOLUMECAPACITYdata-full-node-0Boundpvc-1c60e835-d5f9-41c9-8509-b0e4b3b71f6b200GiWiththatallbeingdeclarative,updatingournodeisamatterofexpressingournewintentbyupdatingtheMoneroNodeSetdefinition,andlettingtheoperatortakecareofupdatingthingsbehindthescene.
Forinstance,assumingwewanttonowmakeitpublic,acceptinglotsofpeers,havingahigherbandwidthlimitandusingdnsblocklistandcheckpointing,we'dpatchtheobjectwiththefollowing:
kind:MoneroNodeSetapiVersion:utxo.com.br/v1alpha1metadata:name:full-setspec:replicas:1monerod:args:---public---enable-dns-blocklist---enforce-dns-checkpointing---out-peers=1024---in-peers=1024---limit-rate=128000Whichwouldthenleadtoanupdatetothenode(Kubernetestakescareofsignallingthemonerod,waitingforittofinishgracefully-didImentionthatithasproperlysetreadinessprobestoo?-,detachingthedisk,etcetc).
MiningclusterSimilartoMoneroNodeSet,withaMoneroMiningNodeSetyouexpresstheintentionofhavingaclusteroxreplicasrunning,andthentheoperatortakescareofmakingthathappen.
Forinstance,torunasetof5minersspreadacrossdifferentKubernetesnodes:
kind:MoneroMiningNodeSetapiVersion:utxo.com.br/v1alpha1metadata:name:minersspec:replicas:5hardAntiAffinity:truexmrig:args:--o-cryptonote.social:5556--u-891B5keCnwXN14hA9FoAzGFtaWmcuLjTDT5aRTp65juBLkbNpEhLNfgcBn6aWdGuBqBnSThqMPsGRjWVQadCrhoAT6CnSL3.node-$(id)---tlsps.:$(id)isindeedathing-whereveryouputit,it'sgoingtobeinterpolatedwithanintegerthatidentifiesthereplicapps.:xmrigisusedunderthehood
PrivatenetworkWithaMoneroNetworkyouexpresstheintentionofhavinganetworkofinter-connectedMoneronodes,takingcareofnotonlybringingmonerodupforyou,butalsoprovidingtheproperflagsforeachdaemonsothattheyareexclusivenodesofthemselves.
Forinstance,considerthefollowingprivateregtestsetup:
kind:MoneroNetworkapiVersion:utxo.com.br/v1alpha1metadata:name:regtestspec:replicas:3template:spec:monerod:args:---regtest---fixed-difficulty=1Underthehood,thefollowingtreeofobjectsgetsformed:
$kubectltreemoneronetwork.utxo.com.brregtestNAMEMoneroNetwork/regtest├─MoneroNodeSet/regtest-0│├─Service/regtest-0││└─EndpointSlice/regtest-0-plf9m│└─StatefulSet/regtest-0│├─ControllerRevision/regtest-0-6dc6799f4b│└─Pod/regtest-0-0├─MoneroNodeSet/regtest-1│├─Service/regtest-1││└─EndpointSlice/regtest-1-7sd9z│└─StatefulSet/regtest-1│├─ControllerRevision/regtest-1-5b5c6b7b8d│└─Pod/regtest-1-0└─MoneroNodeSet/regtest-2├─Service/regtest-2│└─EndpointSlice/regtest-2-rhmd9└─StatefulSet/regtest-2├─ControllerRevision/regtest-2-7fdbcdb57b└─Pod/regtest-2-0witheachnodewiththeflagsproperlysetsothattheyareinterconnected:
$kubectlgetpods-ojsonpath={.items[*].spec.containers[*].command}|jq'.'["monerod","--add-exclusive-node=regtest-1","--add-exclusive-node=regtest-2","--fixed-difficulty=1",...]["monerod","--add-exclusive-node=regtest-0","--add-exclusive-node=regtest-2","--fixed-difficulty=1",...]["monerod","--add-exclusive-node=regtest-0","--add-exclusive-node=regtest-1","--fixed-difficulty=1",...]Installinstall#submitthecustomresourcedefinitionobjects,deployment,role-baseaccess#controlconfigs,etc.#kubectlapply-f./config/release.yamlLicenseSee./LICENSE
评论