chainlink-cluster

module
v0.0.0-...-d11b691 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: MIT

README

Example CL nodes cluster for system level tests

Install kubefwd (no nixpkg for it yet, planned)

brew install txn2/tap/kubefwd

If you want to build images you need docker service running

Enter the shell (from the root project dir)

nix develop

Develop

New cluster

We are using devspace

Configure the cluster, see deployments.app.helm.values and values.yaml comments for more details

Set up your K8s access

export DEVSPACE_IMAGE="..."
./setup.sh ${my-personal-namespace-name-crib}

Create a .env file based on the .env.sample file

cp .env.sample .env
# Fill in the required values in .env

Build and deploy the current state of your repository

devspace deploy

Default ttl is 72h, use ttl command to update if you need more time

Valid values are 1h, 2m, 3s, etc. Go time format is invalid 1h2m3s

devspace run ttl ${namespace} 120h

If you want to deploy an image tag that is already available in ECR, use:

devspace deploy --override-image-tag "<image-tag>"

If you want to deploy an image tag from a public ECR repo, use:

export DEVSPACE_IMAGE=public.ecr.aws/chainlink/chainlink
devspace deploy --override-image-tag 2.9.0

Forward ports to check UI or run tests

devspace run connect ${my-personal-namespace-name-crib}

List ingress hostnames

devspace run ingress-hosts

Destroy the cluster

devspace purge

Running load tests

Check this doc

If you used devspace dev ... always use devspace reset pods to switch the pods back

Helm

If you would like to use helm directly, please uncomment data in values.yaml

Install from local files

helm install -f values.yaml cl-cluster .

Forward all apps (in another terminal)

sudo kubefwd svc -n cl-cluster

Then you can connect and run your tests

Install from release

Add the repository

helm repo add chainlink-cluster https://raw.githubusercontent.com/smartcontractkit/chainlink/helm-release/
helm repo update

Set default namespace

kubectl create ns cl-cluster
kubectl config set-context --current --namespace cl-cluster

Install

helm install -f values.yaml cl-cluster .

Create a new release

Bump version in Chart.yml add your changes and add helm_release label to any PR to trigger a release

Helm Test

helm test cl-cluster

Uninstall

helm uninstall cl-cluster

Grafana dashboard

We are using Grabana lib to create dashboards programmatically

You can also select dashboard platform in INFRA_PLATFORM either kubernetes or docker

export LOKI_TENANT_ID=promtail
export LOKI_URL=...
export GRAFANA_URL=...
export GRAFANA_TOKEN=...
export PROMETHEUS_DATA_SOURCE_NAME=Thanos
export LOKI_DATA_SOURCE_NAME=Loki
export INFRA_PLATFORM=kubernetes
export GRAFANA_FOLDER=CRIB
export DASHBOARD_NAME=CL-Cluster

devspace run dashboard_deploy

Open Grafana folder DashboardCoreDebug and find dashboard ChainlinkClusterDebug

Testing

Deploy your dashboard and run soak/load tests, check README for further explanations

devspace run dashboard_deploy
devspace run workload
devspace run dashboard_test

Local Testing

Go to dashboard-lib and link the modules locally

cd dashboard
pnpm link --global
cd charts/chainlink-cluster/dashboard/tests
pnpm link --global dashboard-tests

Then run the tests with commands mentioned above

Directories

Path Synopsis
dashboard
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL