Helm Chart App in Kubernetes using AWS ec2 instances

Launch four instances of ec2, one for Master and 3 for worker nodes:

AMI image containing default kubernetes config.
Ec2-instances launched
logon Master node
Node1 joining the Master Node .
Nodes are ready

Install helm Package Manager in my Master Node:

helm installed

Now the main party comes here how to create custom package/ chart in kubernetes ?

  • For example you can create 3 folders, one for each package/chart:
  • One Chart “myweb” related to all my web program files, “mysql-db” for all the files required to my database mysql and one folder for integration development “jenkins”.
  • Time to write web chart file:
install/
  • One thing before continue is, we have to create a folder “templates” which will contains all the resources, pods, pv.yaml files we have to launch: To do it “mkdir templates”
  • Now Inside this template folder, create a deployment file like:
We haven’t any deployment lauched.
  • Now install the app by helm like:
  • And from the above output, you can see that we only have kubernetes services launched, so let’s launch loadbalancer service through Chart App:
  • Now as we have already created the app and now we want to add more resources, we have to update the version of our app like:
app version updated
  • let’s practice more😁 by updating our deployment by increasing the replicas to three:
  • And upgrade the version of our app to 0.3:
Updating app version after update our deployment
kubectl get pods and you can see that 3 copies of our deployment launched successfully through our App
  • Now let’s see the case we want to parametrize our deployment so that instead of writing every time in deployment file, we can set a file in which we set the count value of our replicas:
  • For that let’s create a variable file called “values.yaml” in app folder like:
  • Inside this file we set the number of replicas of our deployment pods like:
  • After now go to deployment file to add this values.yaml file as a parameter of replicas:
replicas is set for key our values.yaml file
  • Again install the app through helm: helm install <app_name> <package_folder>:
Again helm launch successfully the 3 copies of our pods with the help of file values.yaml

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Edmond Tchamie

Edmond Tchamie

3rd Year CSE Student, Technology Passionate(Docker, AWS, K8s,Rhel Linux,...), Aspiring Security Expert😁