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

Auth for private Helm registries #120

Closed
shane-davidson opened this issue Oct 9, 2020 · 5 comments
Closed

Auth for private Helm registries #120

shane-davidson opened this issue Oct 9, 2020 · 5 comments
Assignees
Milestone

Comments

@shane-davidson
Copy link

shane-davidson commented Oct 9, 2020

There was nothing in the documentation in regards to using authentication for a helm chart registry.

helm:
    secret: secretName

Can we add the ability to either add a secret or username/password for private registries

gz#14091
gz#14979

@shane-davidson shane-davidson changed the title Helm auth Auth for private Helm registries Oct 9, 2020
@ron1
Copy link
Contributor

ron1 commented Dec 28, 2020

Also add ssh auth for charts with ssh go-getter urls.

@StrongMonkey
Copy link
Contributor

QA: #334 docs PR are here for testing.

@StrongMonkey
Copy link
Contributor

Available to test in v0.3.5-rc4

@bmdepesa
Copy link
Member

bmdepesa commented Apr 15, 2021

rancher/rancher:v2.5.8-rc3
fleet v0.3.5-rc4

Tested 3 scenarios

  • Create a Helm repo requiring basic auth
  • Create a Helm repo with a custom CA and basic auth
  • Reference a Helm chart using ssh protocol (go-getter URL)

For the first two scenarios requiring basic auth:

  • Reference the helm repo in a fleet bundle:
helm:
  releaseName: guestbook
  chart: "guestbook"
  repo: "https://xx.xx.xx.xx.xip.io"
  • Create secrets in the same namespace as the GitRepo object, supplying the user, password, and CA if needed:
kubectl create secret -n fleet-default generic helm-secret \
  --from-literal=username=user1 \
  --from-literal=password=testabc123$%^ \
  --from-file=cacerts=ca.pem
  • In the GitRepo, for helmSecretName, specify the secret
kind: GitRepo
apiVersion: fleet.cattle.io/v1alpha1
metadata:
  name: helm
  namespace: fleet-default
spec:
  branch: helmtest
  # bad secret name
  helmSecretName: helm-secret
  repo: https://git-repo-url
  paths:
  - single-cluster/helm
  targets:
    - clusterSelector: {}
  • Save the GitRepo and the bundle deploys correctly

For the Helm chart using ssh:

  • Tested with both OpenSSH and RSA keys
  • Create the secret in the same namespace as the GitRepo:
kubectl create secret -n fleet-default generic helm-ssh \
  --from-file=ssh-privatekey=key.pem
  • Reference the chart in the bundle:
helm:
  releaseName: guestbook
  chart: "git@github.com:privategit/privaterepo.git/guestbook-0.0.0.tgz"
  repo: ""
  • Save the GitRepo
  • The bundle deploys correctly

Notes / Issues

@timofey-drozhzhin
Copy link
Contributor

For anyone having issues - the top example has an improper chart URL format. The URL should look something like this: git@github.com:privategit/privaterepo.git//guestbook-0.0.0.tgz (note the double trailing-slash //). That's because the field is using a go-getter format.

For more information about the Go-Getter format, refer to https://pkg.go.dev/github.com/hashicorp/go-getter#readme-subdirectories and https://fleet.rancher.io/gitrepo-structure/#reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests