Skip to content

shahincsejnu/helm-charts-stuffs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

helm-charts-stuffs

N.B: Always use lower case during naming a helm chart.

How to use this repo in your machine

  • At first add this repo in your local machine by:
    • helm repo add <repo_name> https://shahincsejnu.github.io/helm-charts-stuffs
  • Then update your repo by:
    • helm repo update
  • Check whether it has been added by (it will show all the charts that are in my repo):
    • helm search repo <repo_name>
  • Now install any chart from this repo by:
    • helm install <release_name> <repo_name>/<chart_name>

Helm

The Kubernetes package manager. Helm deploys charts, which you can think of as a packaged application. It is a collection of all your versioned, pre-configured application resources which can be deployed as one unit.

Common actions for Helm:

  • helm search: search for charts
  • helm pull: download a chart to your local directory to view
  • helm install: upload the chart to Kubernetes
  • helm list: list releases of charts
  • To know more use helm or helm --help in the terminal

Charts

Helm uses a packaging format called charts, helm packages are called charts. A Chart is a Helm package, bundle of YAML files. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster.

Helm Chart Directory Structure

For example, helm create foo will create a directory structure that looks something like this:

foo/
|── .helmignore   # Contains patterns to ignore when packaging Helm charts.
├── Chart.yaml    # Information about your chart
├── values.yaml   # The default values for your templates
├── charts/       # Charts that this chart depends on
└── templates/    # The template files
    └── tests/    # The test files

Some techiniques

  • helm install --debug --dry-run <release_name> ./<chart_name>: For checking/testing purpose without installing the chart. This will render the templates. But instead of installing the chart, it will return the rendered template to you so you can see the output.
  • In YAML we can do typecast like: age: !!str 21 or port: !!int "80": !str tells the parser that age is a string, even if it looks like an int. And port is treated as an int, even though it is quoted.
  • helm create <chart_name>: It create a new chart for you with the chart structure by default, also can look this tuto
  • helm package <chart_name>: Helm can package your chart into an archive for you, which can be uploaded in helm hub and people can install it
  • helm repo index <dir>: after the prev command (use this one) then for giving your chart to a remote repository follow this tuto
  • helm lint <chart_name>: You can also use helm to help you find issues with your chart's formatting or information.

How to add your local charts in remote repo

After making the charts in your local machine you can make your remote repo where you can add your charts and other people can add your remote repo in their machine and can install your charts from that repo. To do this follow the below steps.

  • Suppose you have the following directory structure in your local machine, basically you should have this directory structure. You can have one or more chart inside your repo, and you can make avaiable one or more chart for the users, for making avaiable a chart for users in remote repo you need to first make that chart a package (commands are giving below) and overall in the root directory level you need to have a index.yaml (which also will be generated by a command given below) where you need to give your github repo url (which you will generate by doing githube pages of your repo).

      all-charts/
      |── firstchart   # first chart that you have created
      |   └── firstchart-0.1.0.tgz
      ├── secondchart  # second chart that you have created
      |   └── secondchart-0.1.0.tgz
      ├── thirdchart   # third chart that you have created
      ├── index.yaml   # all the info of the charts that are in remote repo
      └── others
    
  • Commands are given below:

    • at first go to your repository in github where you pushed your current chart repository, and then go to settings and in the below of that page you will find a section named github pages, make it and save
    • Now in your local machine go to a chart which you want to make package and do helm package <dir_of_your_chart> for eg: helm package ../firstchart, after this a tar file will be created inside that chart.
    • Now you need to generate a index.yaml in your root path (meaning in the level of "all-charts") by: helm repo index --url <your_remote_repo_url_that_you_got_after_doing_github_pages> . for ex: helm repo index --url https://shahincsejnu.github.io/helm-charts-stuffs/ .
    • Now after pushing this in your github repo (which you made github pages), anyone can use it (i explained how to use it above).

Resources:

About

Resources for learning Helm charts including hands-on.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published