Mokhtar Naamani 247fd5e845 add minikube and kind cluster howto and ingress deployments | 3 years ago | |
---|---|---|
.. | ||
.gitignore | 3 years ago | |
Pulumi.yaml | 3 years ago | |
README.md | 3 years ago | |
configMap.ts | 3 years ago | |
index.ts | 3 years ago | |
ingress.yaml | 3 years ago | |
json_modify.py | 3 years ago | |
nfsVolume.ts | 3 years ago | |
package.json | 3 years ago | |
tsconfig.json | 3 years ago | |
utils.ts | 3 years ago | |
validator.ts | 3 years ago |
Deploys a Joystream node network on EKS Kubernetes cluster
To deploy your infrastructure, follow the below steps.
After cloning this repo, from this working directory, run these commands:
This installs the dependent packages needed for our Pulumi program.
$ npm install
This will initialize the Pulumi program in TypeScript.
$ pulumi stack init
Set the required configuration variables in Pulumi.<stack>.yaml
$ pulumi config set-all --plaintext aws:region=us-east-1 --plaintext aws:profile=joystream-user \
--plaintext numberOfValidators=2 --plaintext isMinikube=true --plaintext networkSuffix=8122 \
--plaintext nodeImage=joystream/node:latest --plaintext encryptionKey=password
If you want to build the stack on AWS set the isMinikube
config to false
$ pulumi config set isMinikube false
Running pulumi up -y
will deploy the EKS cluster. Note, provisioning a
new EKS cluster takes between 10-15 minutes.
Modify the config variable isLoadBalancerReady
$ pulumi config set isLoadBalancerReady true
Run pulumi up -y
to update the Caddy config
pulumi stack output endpoint1
or pulumi stack output endpoint2
The ws-rpc endpoint is https://<ENDPOINT>/ws-rpc
and http-rpc endpoint is https://<ENDPOINT>/http-rpc
minikube service node-network -n $(pulumi stack output namespaceName)
This will setup a proxy for your node-network
service, which can then be accessed at
the URL given in the output
kubectl
To access your new Kubernetes cluster using kubectl
, we need to set up the
kubeconfig
file and download kubectl
. We can leverage the Pulumi
stack output in the CLI, as Pulumi facilitates exporting these objects for us.
$ pulumi stack output kubeconfig --show-secrets > kubeconfig
$ export KUBECONFIG=$PWD/kubeconfig
$ kubectl get nodes
We can also use the stack output to query the cluster for our newly created Deployment:
$ kubectl get deployment $(pulumi stack output deploymentName) --namespace=$(pulumi stack output namespaceName)
$ kubectl get service $(pulumi stack output serviceName) --namespace=$(pulumi stack output namespaceName)
To get logs
$ kubectl config set-context --current --namespace=$(pulumi stack output namespaceName)
$ kubectl get pods
$ kubectl logs <PODNAME> --all-containers
To see complete pulumi stack output
$ pulumi stack output
To execute a command
$ kubectl exec --stdin --tty <PODNAME> -c colossus -- /bin/bash
To get the chain-data and secrets, run the below command
$ kubectl cp $(kubectl get pods | grep rpc-node | awk '{print $1}'):/chain-data/chain-data.7z ./chain-data.7z
Once you've finished experimenting, tear down your stack's resources by destroying and removing it:
$ pulumi destroy --yes
$ pulumi stack rm --yes