Upload helm chart in S3

Upload helm chart package in 0chain-helm-chart S3 Bucket

For development purpose , we use development branch of 0helm.

dev => dev helm charts are based on the staging branch of all the repositories.

  • Helm charts inside s3 stable repositories are loadBalancer, zchain, zdns, blobber, zbox, cleanDir, authorizer , znft , zs3server , zswap , zchainDel , blobberDel , graphNode , loadtest , magicblock & keygen .

Pre-requisites

  1. Install the AWS CLI on client/local.

    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install
  2. Configure AWS on client/local with the following command and input the ACCESS_KEY, SECRET_KEY & REGION.

    aws configure
  3. Install & validate Helm v3 on client/local.

    sudo curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
  4. Install the helm-s3 plugin for Amazon S3.

    helm plugin install https://github.com/hypnoglow/helm-s3.git

Helm Repo

1. Add the Amazon S3 repository to Helm on the client/local machine.

  • Use the following command inorder to add s3 repository to client/local. Below commands are an example to update helm charts over s3 dev. As there are 16 helm charts, any/all commands can be used to add s3 repo to client/local according to the requirements.

  • Note: In the same way we can add the repository for s3 staging repos also. Just specify the staging in s3 directory path i.e. s3://0chain-helm-chart/staging/zchain etc.

2. Clone 0helm repository to client/local machine

  • Clone the repo on client/local machine. Checkout to the branch for updation.

  • There are two branches for helm charts that are used for deployment over the s3 bucket -

    • staging ==> staging helm charts are based on the staging branch of all the repositories. It also refers to s3 staging repository.

    NOTE - staging branch of 0helm is not up-to-date right now we are using development branch and dev s3.

    • development ==> development helm charts are also based on the staging branch of all the repositories. However development branch is used to test most recent changes made in all staging branch of all repos. when development branch code become stable, same is also updated in 0helm staging branch and s3 staging helm repository also.

  1. Upgrading the helm charts versions

  • Semantic versioning is used for upgrading the helm charts for example: major.minor.patch-->1.2.0. If there is any patch, we increment the patch count. If there is any minor release, we increment the miner count. If there is any major release, we increment the major count.

  • Helm charts version can be modified from there respective directories from key version: 0.2.4 inside Charts.yaml.

  • Example after cloning 0helm repo on client/local machine & checkout to specific branch as in step 2.

    1. Edit/Update any file/files inside 0chain directory.

    2. Check for templates if they getting rendered without an error using the command below:

    3. Check by dry running to check if there is any error on run time or not.

    4. If above steps ii & iii are fine, check and verify by installing on your local. You can also refer to link, if any other issue occurs.

    5. If step iv is also successful, change the chart version from Charts.yaml file.

    6. Create a new helm package by using below command. It will create a new zchain0.2.4.tgz inside dist folder.

  • Note: In the same way other helm charts can also be updated/upgraded by moving into the specific directories & following the same above steps i to vi. Please change the chart name 0chain to directory name. For example: When inside 0dns directory helm install -n helm 0dns ./ --dry-run.

4. Pushing new helm charts versions to S3

  • Push the helm package to s3 repo i.e. generated inside dist folder from step 3 by using the below command: Repo i.e. added in step 1 will be used here for pushing it to the s3.

  • If you have changed the version inside Charts.yml, you must also update the index.yaml file i.e. located inside s3://0chain-helm-chart/staging/index.yaml.

  • Note: In the same way other helm charts can also be pushed into their specific directories & by following the same as above.

4. Helm other useful commands.

  • Helm add command to add s3 repo.

  • Helm update repositories.

  • Verify the updated Helm chart.

  • Helm upgrade command for deployments.

  • Roll back to a previous version.

Last updated