How to add github private repo to my Helm environment

1/4/2020

I have a github private repo ( containing valid index.yaml file) and I want to add it to my local helm environment without using the github token but I can use my gihub credentials.I have tried something like

helm repo add <reponame> --username <username> --password xxxx https://<username>.github.io/reponame

Error Message

Error: Looks like "https://username.github.io/reponame" is not a valid chart repository or cannot be reached: Failed to fetch https://username.github.io/reponame/index.yaml : 404 Not Found

But the above command worked with public repo even without passing the credentials of my github account I have also tried with https://raw.githubusercontent.com/username/reponame/branch raw url but the error still exists.

-- Pycoder
github
kubernetes-helm

1 Answer

1/5/2020

https://<username>.github.io/reponame looks like a GitHub page URL, which you can compare with fluxcd/helm-operator-get-started issue 28.
It points out to a valid chart side

Its repository includes the relevant yaml files.

Following "Using a private github repo as helm chart repo (https access)", using a token seems to be mandatory.
It certainly is if you have 2FA activated.

The OP Pycoder confirms in the comments:

I can:

  • either pass the personal access token in URL
    'https://<token>@raw.githubusercontent.com/<username>/<reponame>/master/',
  • or pass the token in password flag
    helm add repo --username <username> --password <token> url.
-- VonC
Source: StackOverflow