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

Rancher fleet deploy helm charts to multiple namespaces on the same cluster. Is it possible? #503

Closed
Ivan-Lukianov opened this issue Aug 27, 2021 · 4 comments

Comments

@Ivan-Lukianov
Copy link

Hi.

It seems like rancher fleet is doing great in deploying helm chart to multiple clusters. But is there any way to configure rancher fleet to deploy helm to certain namespaces on ONE kubernetes cluster?

For example I have cluster named "testcluster" in cluster group "group1" which is managed by rancher. It has multiple namespaces with labels "env: dev"

apiVersion: v1
kind: Namespace
  labels:
    env: dev
  name: test1
apiVersion: v1
kind: Namespace
labels:
  env: dev
name: test2

GitRepo for example:

kind: GitRepo
apiVersion: fleet.cattle.io/v1alpha1
metadata:
  name: helm
spec:
  repo: https://github.com/rancher/fleet-examples
  paths:
  - single-cluster/helm

The question is, how can I modify next fleet.yaml to deploy helm application to namespaces labeled with "env: dev" on clusters in group "group1" ?

targetCustomizations:
- name: test
   clusterGroup: group1
   # setting to point to namespaces with "env: dev" should be here I guess :)

P. S.

I saw already this issue #210 . But there is kustomize used. And as I understood only way to deploy to multiple namespaces using kustomize is to define their names in config files. But there can be hundreds or thousands of them. I would like to use namespace labels to select namespaces to which deploy applications.

@masterclass363
Copy link

hello,please can u send me your git repo link i need to deploy a helm chart to a cluster in rancher

@kkaempf
Copy link
Collaborator

kkaempf commented Jan 2, 2023

You might have more luck by raising questions on the rancher-users Slack in the #fleet channel 🤞🏻

@kkaempf kkaempf closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2023
@zube zube bot closed this as completed Jan 2, 2023
@zube zube bot removed the [zube]: Done label Apr 3, 2023
@sridhav
Copy link

sridhav commented Jun 10, 2023

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

namespace: lab
targetCustomizations:
- name: dev
  helm:
    values:
      replicas: 1
  clusterSelector:
    matchLabels:
      env: dev

namespace: lab2
targetCustomizations:
- name: dev
  helm:
    values:
      replicas: 3
  clusterSelector:
    matchLabels:
      env: dev

@gthieleb
Copy link

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

namespace: lab
targetCustomizations:
- name: dev
  helm:
    values:
      replicas: 1
  clusterSelector:
    matchLabels:
      env: dev

namespace: lab2
targetCustomizations:
- name: dev
  helm:
    values:
      replicas: 3
  clusterSelector:
    matchLabels:
      env: dev

from a yaml perspective if fleet does not any magic here ;) namespace would be one keyword and any strict yaml parser would raise an exception.

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

6 participants