-
Notifications
You must be signed in to change notification settings - Fork 229
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
Deploy the same repo to the same namespace with different values via fleet.yaml #344
Comments
I just saw this line: https://github.com/rancher/fleet/blame/master/docs/gitrepo-structure.md#L124. What is the reason for that? Why not scanning the entire file for more possible deployments e.g same cluster different namespace or even same cluster, same namespace different @ibuildthecloud maybe you would know? Saw your name in the history log of this file. |
I have a similar need; a Helm chart that is deployed to a single cluster multiple times (each in their own namespace / with their own values file) - The only way I can come up with that Rancher/Fleet can support this currently would be to create multiple GitRepos and point them to separate branches (with each branch customizing the fleet.yaml for that particular release); not a sustainable solution.
This is the behavior that I was expecting; what's the possibility of supporting this in the future? I see mention of the ability to specify multiple |
@Shaked Have you tried setting the release name under
I believe that might be why there is a conflict, since that's the value we reference when identifying what release to deploy onto the cluster fleet/modules/agent/pkg/deployer/manager.go Lines 51 to 54 in 5a141a6
|
@aiyengar2 I will have to test this. Following these comments https://github.com/rancher/fleet/blame/master/docs/gitrepo-structure.md#L143-L144 I am not sure it will work, because AFAIU, once the cluster has been found in fleet.yaml/targetCustomizations then it won't continue to the next possible deployment. I am not sure about the details behind scene, so my assumptions might be wrong here. |
@aiyengar2 I have tested the following fleet.yaml on Rancher 2.6.5 and 2.5.8:
Following your example above, I'd expect to have 3 deployments with 2 namespace, i.e
and
But, the actual result is different:
Rancher UI shows as if everything has been installed: 2.5.82.6.5So AFAIU the suggested solution doesn't solve the problem of deploying a chart to the same cluster more than once. As I stated above, I tend to assume that this happens due to https://github.com/rancher/fleet/blame/master/docs/gitrepo-structure.md#L143-L144. Also, notice that in To sum up, multiple deployments in the same cluster are crucial, is there a way to overcome this issue? Thank you EDIT: Any chance this is why fleet allows one deployment per cluster? https://cs.github.com/rancher/fleet/blob/a28fee1d8763cf3aa2b86acffca015909e4f2e67/pkg/bundle/match.go?q=Targets+language%3AGo#L102. |
@Shaked thanks for your response and tests! I've added this issue to be triaged so we can investigate. |
Hey @aiyengar2 is there any workaround for this? I find it quite strange that there aren't lots of issues about this topic. Deploying multiple versions to the same cluster sounds very reasonable and a common thing, isn't it? |
any update plan? |
Hello, What is the status if this enhancement? It would be great to have this function Kind Regards |
Interesting use case. Do many people need that? I don't think you can use target customizations to multiply a bundle into bundle deployments for the same cluster. The basic idea of a bundle is that it represents a folder in your git repo:
Target customization is described here:
So, what you should be able to do, is to add folders, each with a However, helm multiple chart will only work with external helm charts. Otherwise you would have to duplicate the chart, too. Relative paths are not allowed in GitRepo's And you need to make sure resources don't conflict, Fleet will happily adopt existing resources. Additionally, I'm not sure Fleet will behave nicely when deploying multiple bundles into the same namespace, maybe Fleet will delete the namespace when one of the bundles is removed? One good news, though, this bug should be fixed in recent versions:
|
Just found a solution to this problem. may be try doing the following in your fleet.yaml to get same deployment working in multiple nameaspaces or same namespaces. this worked for me on fleet 0..6. hope this can be helpful for you guys as well
|
One gitrepo resource cannot deploy the same path/bundle to the same cluster multiple times. |
This does not work (anymore). And it isn't valid YAML because it contains certain keys ( But I must say @manno s comment and closing this issue as "not planned" is not very customer friendly. I hear Argo CD would support such use cases. |
I have a setup of a service that can run in different modes. Each mode requires a different deployment/pod but at the end it's all about the different helm values I supply to it.
Currently I want to use the same fleet deployment (GitRepo via Rancher) to deploy the different modes to the same cluster within the same namespace.
At first,I thought that it would be quite simple and the only thing I'd have to do is change
fleet.yaml
to something like:I expected it to set two deployments, one for the
c1
and another for thec1-gpu
. However, this didn't work.I thought that it would work by overriding the name of the deployment, as maybe there was some issue with the same naming convention, so I even added the following under
c1-gpu
:Unfortunately, that didn't do the job.
I think that the main issue here is that fleet/rancher deploys helm once and therefore doesn't know how to handle multiple deployments to the same namespace. I haven't checked, but I assume that if I'd work with different namespaces, it will be installed correctly. I base this assumption mainly on my intuition but also saw that #210 might be related.
Is this something that could work somehow?
Currently I have solved this on templating level. This means that I have N
deployment-<mode>.yaml
and I have a flag that enables/disables them e.gThe text was updated successfully, but these errors were encountered: