Buildben Trial Version Amazon EKS Cluster Installation Guide - buildben/docs GitHub Wiki

Introduction

The document's purpose is to provide the step-by-step guide for Buildben Trial Version EKS Cluster installation in the AWS environment using an ec2 instance with Amazon Linux 2 operating system.

Buildben Trial Version is limited to a maximum of 3 parallel execution processes.

Buildben Trial Version EKS cluster consists of backend service, PostgreSQL database, MinIO cluster, and 3 worker agents.

Prerequisites

The executor should have the full admin permissions for the AWS account resources and log in and execute sudo commands on the dedicated ec2 instance. Access key to be generated for the executor admin user to be used in aws-cli configuration on the ec2 instance and Jenkins pipeline script.

The following software is to be installed on the ec2 instance:

  • eksctl
  • kubectl
  • helm

aws-cli on ec2 insurance to be configured with executor admin user credentials. Appendix A describes in detail the required steps/commands/settings for each requirement.

Buildben Trial Version EKS Cluster Installation

EKS Cluster Setup

1. Login to ec2 instance with executor admin user

2. Run the following command to create Amazon EKS cluster:

eksctl create cluster --name=buildben-eks --instance-types=m5.large --nodes-min=3 --nodes-max=3

The command will create an EKS cluster named buildben-eks in the default eu-central-1 region with 3 nodes of m5.large type. The process can take up to 15 mins.

3. After the cluster creation was completed run the following command to label the created nodes to be used in Buildben agents management process

ITER=1; for i in $(kubectl get nodes --no-headers | awk '{printf "%s ",}'); do kubectl label nodes "$i" number=$ITER; ((ITER++)); done

4. Run the following command to create a dev namespace

kubectl create namespace dev

Download BuildBen helm chart

1. Create directory to store BuildBen helm chart

mkdir ~/buildben

2. Change to new directory

cd ~/buildben

3. Download the latest BuildBen helm chart

curl https://buildben-trial.s3.eu-central-1.amazonaws.com/helm_charts/buildben-helm-latest.tar.gz

4. Unarchive the helm chart files

tar -xvf buildben-helm-latest.tgz

Edit BuildBen helm chart values.yaml file

1. Open ~/buildben/values.yaml file for editing

2. For BUILDBEN_LICENSE_KEY key provide the value received from BuildBen support

Deploy BuildBen helm chart

1. From the same directory, run the following command to install BuildBen helm chart

helm upgrade --install -n <k8s_namespace_name> buildben -f values.yaml .

2. Validate the process completion by the following command

kubectl -n <k8s_namespace_name> get pods

The expected output example: all pods are in RUNNING status.

Post deployment steps

1. Run the following command to get the BuildBen backend link

kubectl get svc -n <k8s_namespace_name> | grep 'buildben-backend ' | awk '{printf "http://%s:8080",}'

Copy the printed link to be used in section Usage Steps, step #3.a of the Using BuildBen Agent in CI/CD Scripts document (BUILDBEN_HOST_URL environment variable value).

2. Run the following command to get the BuildBen MinIO cluster link

kubectl get svc -n <k8s_namespace_name> | grep 'buildben-minio ' | awk '{printf "http://%s:9000",}'

Copy the printed link to be used in section Usage Steps, step #3.b of the Using BuildBen Agent in CI/CD Scripts document (BUILDBEN_MINIO_URL environment variable value).

3. Run the following command to get the link to BuildBen agent used in CI platforms

kubectl get svc -n <k8s_namespace_name> | grep 'bb-init-agent ' | awk '{printf "http://%s:8081",}'

Copy the printed link to be used in section Usage Steps", step #1 of the Using BuildBen Agent in CI/CD Scripts document (replace <BUILDBEN_CI_AGENT_URL> placeholder).