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

Add namespace to templates #1322

Merged
merged 6 commits into from
Dec 5, 2023
Merged

Conversation

rasebo
Copy link
Contributor

@rasebo rasebo commented Nov 28, 2023

Adding namespaces to templates in order to avoid having objects deployed to the default namespace in certain deployment scenarios.

@pb82
Copy link
Collaborator

pb82 commented Nov 28, 2023

@rasebo I'm not familiar with Helm, but wouldn't you set the namespace with the CLI?

@weisdd weisdd self-assigned this Nov 28, 2023
@rasebo rasebo force-pushed the add_namespace_to_templates branch from f29d289 to 346bef5 Compare November 28, 2023 13:22
@rasebo
Copy link
Contributor Author

rasebo commented Nov 28, 2023

@rasebo I'm not familiar with Helm, but wouldn't you set the namespace with the CLI?

It can be, but this chart can also be used as a subchart, in which care you can end-up with a more complicated setup, where you might have some resources deployed to different namespaces, as part of the same parent chart.

In that scenario, it's a good idea to have all manifests specify the namespace where they can be deployed onto because a kubectl -n my-namespace apply -f would generate conflicts.

Copy link
Collaborator

@weisdd weisdd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
I think the RBAC template is a bit off (seems like it's always been the case) as cluster-scope resources should not have "metadata.namespace" field. The rest is good :)

deploy/helm/grafana-operator/templates/rbac.yaml Outdated Show resolved Hide resolved
deploy/helm/grafana-operator/templates/rbac.yaml Outdated Show resolved Hide resolved
@rasebo rasebo requested a review from weisdd November 28, 2023 13:41
Copy link
Collaborator

@weisdd weisdd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@weisdd weisdd requested a review from NissesSenap November 28, 2023 13:47
@pb82 pb82 enabled auto-merge December 5, 2023 13:02
@pb82 pb82 merged commit f2d0937 into grafana:master Dec 5, 2023
9 checks passed
@rasebo rasebo deleted the add_namespace_to_templates branch December 7, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants