{"id":13452423,"url":"https://github.com/diwakar-s-maurya/helm-git","last_synced_at":"2025-03-23T19:34:21.811Z","repository":{"id":93367084,"uuid":"111186618","full_name":"diwakar-s-maurya/helm-git","owner":"diwakar-s-maurya","description":"use private git repo as helm repo","archived":false,"fork":false,"pushed_at":"2023-10-28T10:31:59.000Z","size":7,"stargazers_count":25,"open_issues_count":0,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-31T07:18:53.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diwakar-s-maurya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-11-18T07:45:09.000Z","updated_at":"2023-12-15T20:29:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce768ead-5d38-4e35-a0c9-e1eaf436296a","html_url":"https://github.com/diwakar-s-maurya/helm-git","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwakar-s-maurya%2Fhelm-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwakar-s-maurya%2Fhelm-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwakar-s-maurya%2Fhelm-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwakar-s-maurya%2Fhelm-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diwakar-s-maurya","download_url":"https://codeload.github.com/diwakar-s-maurya/helm-git/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221900949,"owners_count":16898994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:01:23.773Z","updated_at":"2024-10-28T18:31:20.565Z","avatar_url":"https://github.com/diwakar-s-maurya.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Plugin to use github/gitlab/bitbucket as helm repo\n\nThis plugin makes it possible to use a private/public repository on github/gitlab/bitbucket as a helm repository also. You can keep the charts beside your code in the same repository.\n\n## Why this plugin\n\nUsing git repo itself as the helm repo is better in my opinion because\n- 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.\n- 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.\n- No dependence of extra storage layer like EBS, S3 and its security/replication.\n- Charts live beside its code in the same repo and remain tightly version controlled with the code.\n\nHelm allows adding http and https repositories. So public repositories are not a problem. But it does not 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](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)/[gitlab](https://docs.gitlab.com/ee/api/README.html#personal-access-tokens)) 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:\n- Security. You will have to make sure that you keep the token secure all the time.\n- Expiry. The token comes with a expiry. You will have to update the token in all repo's URI once it expires.\n- Running `helm repo list` prints the token in plain text every time. There is no way to hide it.\n\nYou 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.\n\n## Creating the helm repository\n\nLets say that this is structure of your repository\n```\n.\n├── Dockerfile\n├── README.md\n├── kubernetes\n│   └── helm-chart\n│       └── myapplication\n│           ├── Chart.yaml\n│           ├── templates\n│           │   ├── NOTES.txt\n│           │   ├── _helpers.tpl\n│           │   ├── deployment.yaml\n│           │   └── service.yaml\n│           └── values.yaml\n├── src\n└── tests\n```\n\nRun the following commands to create repo index\n```bash\ncd ./kubernetes/helm-chart\nhelm package myapplication # generates myapplication.tgz\nhelm repo index --url=gitlab://username/project:master/kubernetes/helm-chart . # generates index.yaml\n```\n\nNotice the url flag for `helm repo index` command. This is key for this plugin to work. The structure of the URI should be\nprovider://username/repository-name:branch/dir-containing-index.yaml\n\nCommit the files generated by the helm commands and push to the repo. Now the repository is setup.\n\nThe `provider` in the url can be\n- github\n- gitlab\n- bitbucket\n\nHere are some examples of URI\n- github://diwakar-s-maurya/myapp:master/kubernetes/helm-chart\n- gitlab://diwakar-s-maurya/myproject:dev/kubernetes/helm-chart\n- bitbucket://diwakar-s-maurya/myoperator:prod/kubernetes/helm-chart\n\n## Adding the helm repository\n\nBefore 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](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/)/[gitlab](https://www.packtpub.com/mapt/book/application_development/9781783986842/2/ch02lvl1sec20/adding-your-ssh-key-to-gitlab)\n\nOn same or another computer which has the above requirement fulfilled, install the plugin\n\n```bash\nhelm plugin install https://github.com/diwakar-s-maurya/helm-git\n```\n\nNow add the repo,\n```bash\nhelm repo add myhelmrepo gitlab://username/project:master/kubernetes/helm-chart\nhelm repo list\n```\n\nNow that you have added the repository, start using it as any other regular repository.\n\n```bash\nhelm install myhelmrepo/myapplication\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiwakar-s-maurya%2Fhelm-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiwakar-s-maurya%2Fhelm-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiwakar-s-maurya%2Fhelm-git/lists"}