Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Deploying Private Helm Repository Hosted on Github #2005

Closed
ghost opened this issue Jun 25, 2024 · 5 comments
Closed

Document Deploying Private Helm Repository Hosted on Github #2005

ghost opened this issue Jun 25, 2024 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 25, 2024

When I deployed a private helm repository using flux, I first ran the following command:

flux help create source helm

... and I was given the following example:

  # Create a source for an HTTPS Helm repository using basic authentication
  flux create source helm podinfo \
    --url=https://stefanprodan.github.io/podinfo \
    --username=username \
    --password=password

The url in the address above is a Github Pages address. This led me down a rabbit hole. After lots of research, I realized that private Github Pages does not support basic auth. However, Github does host a raw endpoint that does, https://raw.githubusercontent.com. This article explains how this endpoint can be used for private Helm repositories, Stuart Blackler .

TLDR: The URL needs to be in the following format: https://raw.githubusercontent.com/<organization>/<repo-path>/<branch>/

The URL above, including the trailing slash should be passed as the parameter to the above command.

Why does FluxCD need to document this? Shouldn't developers refer to Github to document Github endpoints? In an ideal world, yes, but Github has already declined to do so. See this closed issue: github/docs#8031 (comment)

I suggest replacing the example in the CLI at minimum, like the modified version, below. Discussing the format of the URL in the HelmRepository docs on the FluxCD website would be even better.

  # Create a source for an HTTPS Helm repository using basic authentication
  flux create source helm podinfo \
    --url=https://raw.githubusercontent.com/stefanprodan/podinfo/main/ \
    --username=username \
    --password=password

Also, I tested Stuart's solution and it does work.

@stefanprodan
Copy link
Member

With Helm OCI fully supported in GitHub Container Registry, I really hope Flux users have moved away from HTTP Helm repos.

@ghost
Copy link
Author

ghost commented Jun 25, 2024

@stefanprodan , storing helm charts in OCI registries is really cool, but it is still fairly new.

My use case was extremely simple. I just had one value to template in one file, so I just wanted to make the simplest Helm repository possible. If there was a way to embed the helm template directly into the HelmChart resource of the source.toolkit.fluxcd.io/v1 API, that would have been ideal. Then my helm resources could coreside with the rest of my code pulled in from a GitRepository resource. This is totally unrelated to documentation, but it would resolve my original problem that led to my low-effort helm struggle.

@stefanprodan
Copy link
Member

@ghost
Copy link
Author

ghost commented Jun 28, 2024

Thank you. I think this is sufficient. I wanted to see the example URL of a private helm git repository updated so developers didn't expect a github page to accept basic authentication. The fact that Github hasn't publicly documented the https://raw.githubusercontent.com, which does accept basic auth, makes me hesitate to put it in the documentation.
Again, my concern was just with the example URL in the CLI for private HTTP helm repositories.

@ghost
Copy link
Author

ghost commented Jul 2, 2024

I will go ahead and close this issue. Thank you for your time and consideration.

@ghost ghost closed this as completed Jul 2, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant