Deploy service by Helm in Kubernets

As we know, if you want to deploy a service, you need at first write several yaml files like deployment/service/ingress file and so on.

Then execute several times kubectl create -f <Yaml File> when you create service, also you need delete several times when you destroy service, It’s a little boring…

Although you could write all the configurations in just one yaml file, but it’s hard to maintain. For example you can’t define variable which used in many pods, you can’t upgrade or rollback deployment easily..

By using Helm you will find it’s very easy to solve these problems, just execute one command like helm install <Chart>, then helm will deploy all the pods at meanwhile, you could check deployment’s status by helm list, upgrade service by helm upgrade and so on.

There’s lots of stable charts in Helm repository, you could also define chart yourself if it doesn’t meet your requirement.

Here is chart’s structure from Helm official website:

  Chart.yaml          # A YAML file containing information about the chart
  LICENSE             # OPTIONAL: A plain text file containing the license for the chart           # OPTIONAL: A human-readable README file
  requirements.yaml   # OPTIONAL: A YAML file listing dependencies for the chart
  values.yaml         # The default configuration values for this chart
  charts/             # A directory containing any charts upon which this chart depends.
  templates/          # A directory of templates that, when combined with values,
                      # will generate valid Kubernetes manifest files.
  templates/NOTES.txt # OPTIONAL: A plain text file containing short usage notes