-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Feature: Add dependency spec to Chart.yaml (was Kubernetesfile) #874
Comments
So that we avoid any potential rabbit trails: Currently, charts do not have to be in their own repos -- they can live alongside source. We got rid of the Helm Classic requirement that charts all exist in one repo. I'd love to see some mocked up examples of what this might look like. The goals stated above are definitely inline with what we want to accomplish with Helm. But I admit that I'm having a hard time mentally mapping between a Dockerfile and Kubernetes manifests or Helm charts. Is this sort of like a special case of a values.yaml file? |
I will write this up as an additional comment. I think another way to look at is to support charts of charts (aka charts with dependencies that are other charts) |
Sure! Also, I am not a "helm" expert - so if this is already possible, please let me know. NOTE I think what I was calling the Let's start by creating a fictitious company called Foobar. Foobar is community site with the following architecture. We'll also call this the "foobar" product.
Our objective is to deploy the entire product in one fell swoop. With one command (e.g. This is possible today, but since charts are downward facing there needs to be one repo that specifies the entire environment. The "frontend" could specify everything that it needs (e.g. backend), but the "frontend" should not be defining the kubernetes resources for the "backend" because the backend service is the right place for it. In a micro-service architecture, there will be dozens if not more projects. What I would propose is creating a new repository for our "product" called "foobar". This repo has a chart that says to install the "redis" chart, "statsd" chart and "memcache" chart by pulling them down from (https://github.com/helm/charts). But it would also be able to specify |
The |
I think |
There is a reason for including the charts statically (in But you've really got me thinking. Here's an idea. Probably, though, a suitable middle ground would be to come up with a file format for a file that goes inside of So I'm thinking that Then a command like The chart repo spec means that we probably wouldn't need to build GitHub-specific logic. @michelleN was working on figuring out how to use GitHub to manage chart releases, but I think that got back-burnered for some other Alpha.2/3 tasks. All of this would give a workflow like this (drawing on your example): $ cd foobar
$ helm chart add myrepo/frontend-1.2.3 myrepo/backend-2.3.4 //...
$ helm install .
fluffy-bunny Then, to update your deps: $ cd foobar
$ helm chart up
Updating to myrepo/backend-2.3.5
$ helm upgrade fluffy-bunny .
Upgraded release fluffy-bunny Does that get closer to meeting the use case you are elaborating above? Does it sound viable? I guess we should mock out a |
@technosophos: wow, yes that looks beautiful. It reminds me a little bit of the interface to |
Just to be extra clear, the
Where everything after the I am not clear on how to express a non-standard |
Kubernetesfile
in App/Project Repos
So @prydonius just suggested that if we added dependency information to Chart.yaml might then look like this: name: wordpress
#...
dependencies:
- name: percona-mysql
version: ">5.7.0" # Human-generated
lock: "5.7.1+eff45" # Computed by Helm, version actually used.
- name: memcached
version: 1.2.3 Chart developers would be able to write the And @osterman's Among the other benefits:
|
My 2 cents regarding the dependencies topic. Dependencies definition
I like @technosophos proposal and share the long term benefits exposed. But as initial version, I would simplify it forcing the user to add an specific version (and maybe name: wordpress
#...
dependencies:
- name: percona-mysql
version: "5.7.0"
- name: memcached
version: "1.2.3" This will not require helm to resolve dependencies nor modify the Installing/ updating dependencies
In my opinion, this will put as in the right track. Acting as base for future helper functions ( |
This feature adds a dependencies section to a chart file. It is a prerequisite for adding automated chart management tooling as described in helm#874.
This feature adds a dependencies section to a chart file. It is a prerequisite for adding automated chart management tooling as described in helm#874.
@technosophos I will file another issue but I would like to see something like:
But, I think to do this we would need to do some work in the provenance specification. |
Elsewhere there has been some confusion over the tl;drThe dependencies section expresses developer intent, not chart state. As such, it should not be included in In detailIf you have not read @sdboyer's excellent blog post on package management, please read it now: https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527#.vma29reij In that post, Sam points out the difference between capturing developer intent and capturing the relevant state. What we're working on as part of this issue is capturing developer intent. So the anticipated workflow that this issue describes goes like this:
Charts can be vendored. But one request has been that for those developing charts, they need not check the dependencies into their VCS tree. The mechanism above is a first step toward supporting that model. The second step (which is not strictly necessary, but is definitely a best practice) is to introduce a lock (either as a lock file I'm suggesting that we remove the Instead, we should put it in a place where it clearly displays itself for what it is: a statement of developer intent. I think we can follow the Python model and put it in Then we end up with a fairly clean separation of concerns like this:
Pros
Cons
|
I agree with the proposal. I do think that you want to be able to point to a particular dependency by digest in both requirements.yaml and requirements.lock though. By offering both I have the option of dev'ing with loose dependencies or very specific pinned dependencies. |
This is kind of related to what I was originally thinking but could not articulate: https://github.com/roboll/helmfile |
what
Kubernetesfile
that can be included with applications to express how the service is deployed. It would contain the YAML or JSON of kubernetes resources.git
URL to a repo containing a top-levelKubernetesfile
why
As applications change or evolve, the way they are instantiated may change. For example, new environment variables may be introduced or removed, new command line arguments may be accepted, additional ports exposed, etc. From a maintenance perspective, it would be convenient if the author of the app could keep the
Kubernetesfile
updated as the code evolves rather than try to keep multiple repositories (e.g. external Helm Charts) current.This is similar to what the
Dockerfile
expresses for building an application, theJenkinsfile
for integrating it with CI/CD pipelines and (once-upon-a-time) theVagrantfile
for setting up a local environment.our use-case
We have a product that is composed of a dozen proprietary micro-services as well as other off-the-shelf components like statsd. We want to use a repository that maps out the
Chart
for how to deploy our product in our Kubernetes cluster (the way it works now), but we want service owners to "own" the definitions of how to deploy their service much the way they "own" theirDockerfiles
for building them.We like the way it works now, but would like this alternative approach for including services that we own.
The text was updated successfully, but these errors were encountered: