Git Product home page Git Product logo

helm-git's Introduction

Plugin to use github/gitlab as helm repo

This plugin makes it possible to use a private/public repository on github/gitlab as a helm repository also. You can keep the charts beside your code in the same repository.

Why this plugin

Using git repo itself as the helm repo is better in my opinion because

  • It will cut down the need of having one more component to serve the charts. One less webserver to deal with and making it highly available.
  • No need of extra security layer to secure charts. They remain as secure as your code is. They use same authentication and authorisation as of your git repository.
  • No dependence of extra storage layer like EBS, S3 and its security/replication.
  • Charts live beside its code in the same repo and remain tightly version controlled with the code.

Helm allows adding http and https repositories. So public repositories are not a problem. But it does have any authentication/authorisation feature for adding/accessing the charts in the repository yet. Adding a private repo is not straight forward. You have to create private access token (github/gitlab) and embed directly in the URI of the repo. Example: https://gitlab.com/username/repo/raw/master/kubernetes/helm-chart?private_token=2xMusKyEgA7BRw5TaJYA. The problems with this approach are:

  • Security. You will have to make sure that you keep the token secure all the time.
  • Expiry. The token comes with a expiry. You will have to update the token in all repo's URI once it expires.
  • Running helm repo list prints the token in plain text every time. There is no way to hide it.

You will have to make these compromises without this plugin. If you are able to, then there is no need of using the plugin otherwise this plugin solves these problems.

Creating the helm repository

Lets say that this is structure of your repository

.
├── Dockerfile
├── README.md
├── kubernetes
│   └── helm-chart
│       └── myapplication
│           ├── Chart.yaml
│           ├── templates
│           │   ├── NOTES.txt
│           │   ├── _helpers.tpl
│           │   ├── deployment.yaml
│           │   └── service.yaml
│           └── values.yaml
├── src
└── tests

Run the following commands to create repo index

cd ./kubernetes/helm-chart
helm package myapplication # generates myapplication.tgz
helm repo index --url=gitlab://username/project:master/kubernetes/helm-chart . # generates index.yaml

Notice the url flag for helm repo index command. This is key for this plugin to work. The structure of the URI should be provider://username/repository-name:branch/dir-containing-index.yaml

Commit the files generated by the helm commands and push to the repo. Now the repository is setup.

Adding the helm repository

Before using the plugin, you need to setup your machine to access your private/public git repository without manual username-password input. Best is to setup ssh keys in github/gitlab

On same or another computer which has the above requirement fulfilled, install the plugin

helm plugin install https://github.com/diwakar-s-maurya/helm-git

Now add the repo,

helm repo add myhelmrepo gitlab://username/project:master/kubernetes/helm-chart
helm repo list

Now that you have added the repository, start using it as any other regular repository.

helm install myhelmrepo/myapplication

helm-git's People

Contributors

diwakar-s-maurya avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.