How to Deploy application in k8s using Helm

How to Deploy application in k8s using Helm

What We need to done before starting project:

  1. Ubuntu Operating system
  2. 8GB RAM
  3. 256GB SSD
  4. Install minikube on machine
  5. Create project repository on GitHub
  6. Install helm on machine [ link click here]
  7. Clone Github Repository

Starting Project;

Create custom repository on GitHub

How to Deploy application in k8s using Helm

Clone your own Repository –

Create new custome helm chart by using

$ helm create helmproject3
How to Deploy application in k8s using Helm

Here you can see helm chart created successfully

How to Deploy application in k8s using Helm

Create Dockerfile for your application .. I am creating for tomcat application..

Edite Chart.yaml , deployment.yaml, service.yaml, values.yaml file as per your project requirement.

Chart.yaml

#values.yaml

image:

repository: kishordhangar/tomcat

pullPolicy: IfNotPresent

# Overrides the image tag whose default is the chart appVersion.
  tag: "9.0.20"

service:
  type: NodePort
  port: 8029
  targetport: 8080

You can Build Your docker image.. navigate your dockerfile dir and run command

$ docker build -t dockerhub_repository/tomat:9.0.20 .

Push docker image to dockerhub

$ doker login

$ docker push dockerhub_repository/tomcat:9.0.20

Edite service.yaml file

navigate project dir and run

$ helm repo index .

To check any errors run command

$ helm lint
$ helm lint

==> Linting .

[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed

that means everything are correct

Push edited files to your github repository

after commited successfully then try to install the chart

first create your own namespace

$ kubectl create ns helmproject3
$ helm install helmrelease2 helmproject3 -n helmproject3
$ helm list

$ helm list -A
$ kubectl get pod

$ kubectl get pod -A

$ kubectl get svc

$ kubectl get svc -A
$ minikube service helmrelease2-helmproject3

$ minikube service helmrelease2-helmproject3 -n helmproject3 --url

Tag –

How to Deploy application in k8s using Helm,How to Deploy application in k8s using Helm,How to Deploy application in k8s using Helm,How to Deploy application in k8s using Helm

Mahesh Wabale

Leave a Comment