Deploy and manage pocket nodes on Kubernetes clusters.
This operator was built with operator-builder.
To install the custom resource/s for this operator, make sure you have a kubeconfig set up for a test cluster, then install the CRDs.
make installTo run the controller locally against your test cluster.
make runYou can then test the operator by creating the sample manifests in another terminal.
kubectl apply -f config/samplesGive the validators some time to come up. The validator nodes will go into a crashloop. First because the database pod is not yet up, and then because it is failing password authentication when connecting to the DB. This is a issue that will be fixed soon. In the meantime, we have a workaround.
Stop the controller by hitting Ctrl-C in the terminal where you ran make run.
Then run the following commands.
cd .operator-builder/hack
for v in $(cat validators); do ./update-db-pass.sh $v; done
for v in $(cat validators); do kubectl delete po $v-0; doneRun the dev client in the pocket client container. See the pocket development docs for more info on using the dev client.
kubectl exec -it pocket-v1-client -- go run app/client/main.goFinally, once testing is complete you can clean up. Note: you will need to run
the controller to finalize resource deletion with make run if you stopped it.
make uninstallThe following steps will re-generate the codebase from scratch after making changes to the configurations, source manifests and/or markers.
Caution: These steps will permanently delete any changes you have made directly to the codebase.
Delete the existing codebase.
cd .operator-builder
make operator-cleanRe-build the codebase from the existing configurations and source manifests.
make operator-init
make operator-createInstall the dependencies (postgres operator) in your test cluster.
make operator-dependenciesCopy the modified sample manifests into the config/samples directory of the
codebase.
make operator-samples
cd ../You can now re-test the operator using the Local Development & Testing instructions above.
First, set the image name.
export IMG=myrepo/myproject:v0.1.0Now you can build and push the image.
make docker-build
make docker-pushThen deploy.
make deployTo clean up.
make undeployTo build the companion CLI.
make build-cliThe CLI binary will get saved to the bin directory. You can see the help message with the following.
./bin/pocketctl help