-
Notifications
You must be signed in to change notification settings - Fork 260
Manage Helm chart repositories using custom resources #142
Comments
Proposal: decoupling chart/git repositories from HelmReleases Features:
Chart repository with basic auth: apiVersion: helm.fluxcd.io/v1
kind: ChartRepository
metadata:
name: azurecr
namespace: fluxcd
spec:
url: https://<repository>.azurecr.io/helm/v1/repo #required
secretRef: #optional
name: azurecr-auth #required Chart repository basic auth secret format: apiVersion: v1
kind: Secret
metadata:
name: azurecr-auth
namespace: fluxcd
type: Opaque
data:
username: <BASE64> #required
password: <BASE64> #required
caFile: <BASE64> #optional (path to file inside the helm-op container)
certFile: <BASE64> #optional (path to file inside the helm-op container)
keyFile: <BASE64> #optional (path to file inside the helm-op container) Reference ChartRepository in HelmRelease with cross-namespace support: apiVersion: helm.fluxcd.io/v2
kind: HelmRelease
metadata:
name: podinfo
namespace: demo
spec:
chart:
name: podinfo #required (either name or path)
version: 3.1.0 #required (when using chartRepositoryRef)
chartRepositoryRef: #required (either chartRepositoryRef or gitRepositoryRef)
name: azurecr #required
namespace: fluxcd #optional (defaults to HelmRelease ns) HTTPS Git repository with basic auth: apiVersion: helm.fluxcd.io/v1
kind: GitRepository
metadata:
name: git-https-repo
namespace: fluxcd
spec:
url: https://github.com/myrepo.git #required (either url or git)
ref: master #optional (defaults to master)
secretRef: #optional
name: git-basic-auth #required HTTPS Git repository basic auth secret format: apiVersion: v1
kind: Secret
metadata:
name: git-basic-auth
namespace: fluxcd
type: Opaque
data:
username: <BASE64> #required
password: <BASE64> #required Git repository with SSH auth: apiVersion: helm.fluxcd.io/v1
kind: GitRepository
metadata:
name: git-ssh-repo
namespace: fluxcd
spec:
git: ssh://git@gitsrv/git-server/repos/cluster.git #required (either url or git)
ref: master #optional (defaults to master)
secretRef: #optional
name: git-ssh-key #required Git repository SSH secret format: apiVersion: v1
kind: Secret
metadata:
name: git-ssh-key
namespace: fluxcd
type: Opaque
data:
identity: <BASE64> #required Reference GitRepository in HelmRelease with cross-namespace support: apiVersion: helm.fluxcd.io/v2
kind: HelmRelease
metadata:
name: podinfo
namespace: demo
spec:
chart:
path: charts/podinfo #required (either name or path)
gitRepositoryRef: #required (either chartRepositoryRef or gitRepositoryRef)
name: https-repo
namespace: fluxcd #optional (defaults to HelmRelease ns) HelmRelease v2 The above changes would require a new major release of the HelmRelease CRD. Chart repo changes: kind: HelmRelease
spec:
chart:
repository: # replaced with chartRepositoryRef
name: # no changes
version: # no changes Git repo changes: kind: HelmRelease
spec:
chart:
git: # replaced with gitRepositoryRef
ref: master # moved to GitRepository.spec.ref
path: charts/ghost # no changes |
@stefanprodan can you extend the examples to show how one would provide custom certificates for the |
@hiddeco I've added the cert fields to the secret as file paths. |
Hello, as I understood basic HTTPS implemented only for git? not for regular private char repo? |
For CRD naming:
Taking those into consideration, what about something like: chart:
path: ...
gitSourceRef:
namespace: ...
name: ... chart:
name: ...
version: ...
repoSourceRef:
namespace: ...
name: ... chart:
name: ...
# future extension
registrySourceRef:
namespace: ...
name: ... Relating this to chart:
name: ...
version: ...
# inline source
gitSource: # or repoSource or registrySource (same content as reference CR specs)
git: ssh://git@gitsrv/git-server/repos/cluster.git #required (either url or git)
ref: master #optional (defaults to master)
secretRef: #optional
name: git-ssh-key #required |
Implemented in helm-controller, see https://toolkit.fluxcd.io/guides/helmreleases/ |
Edit: This has been implemented in helm-controller the successor of helm-operator, please see https://toolkit.fluxcd.io/
In #124 and #141 boilerplate was added to manage Helm chart repositories for Helm
v2
andv3
. The current implementation is however extremely limited and still requires the user to provide (and manage) a repository index file.It would be more user friendly, and declarative, to introduce a new custom resource definition called i.e.
HelmChartRepository
to make it possible to manage the repositories using Kubernetes resources.The text was updated successfully, but these errors were encountered: