Skip to content

Latest commit

 

History

History

nodejs-k8s

Upgrade Application with Helm3

Pre-requisites:

- Install Git
- Install npm
- Install Docker
- EKS-Cluster
- Install helm

Install Git:

yum install git -y

Install npm:

sudo yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_13.x | sudo -E bash -
sudo yum install -y nodejs

Install Docker:

yum install docker -y
service docker start

Install helm:

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh

Now edit get_helm.sh file

vi get_helm.sh

1

./get_helm.sh

Clone code from github:

git clone https://github.com/VamsiTechTuts/kubernetes.git
cd kubernetes/nodejs-k8s

Build Maven Artifact:

npm install

Build Docker image for Springboot Application

docker build -t naresh240/nodejs-k8s:v1 .

Docker login

docker login

Push docker image to dockerhub

docker push naresh240/nodejs-k8s:v1

Create helm chart:

helm create nodejs

Edit values.yml file

vi nodejs/values.yaml

Edit image as shown below:

2

Edit Service and port as show below:

3

Edit deployment.yml file as shown below 4 Deploy nodejs Application using helm:

helm install nodejs nodejs

Check pods and services:

kubectl get pods
kubectl get svc

Goto Web UI and check whether we are getting output or not: 2

Check history of nodejs Application:

5

Upgrading for nodejs Application:

Edit our our application and Build docker image with new tag:

docker build -t naresh240/nodejs-k8s:v2 .

Push Docker image to docker hub with tag v2:

docker push naresh240/nodejs-k8s:v2

Edit values.yml file with new tag v2:

6

upgrade nodejs application with tag v2:

helm upgrade nodejs ./nodejs

Check history of nodejs Application:

helm history nodejs

7

Goto Web UI and check whether we are getting upgraded output or not: 8

How to Rollback using helm:

helm rollback nodejs 1

1

Goto Web UI and check whether we are getting rollback output or not: 2