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 metadata option in templates #247

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MannerMan
Copy link

This sets the namespace key in metadata for all kubernetes manifests. The .Release.Namespace is a built-in variable in helm, that can be passed with --namespace on install or template step. If not set it defaults to default.

Why?

When using helm install with the --namespace argument the templates are applied into the chosen namespace.

When using helm only as a template engine, in combination with GitOps tools like Flux, the namespace property must be set in the rendered manifests to be applied. For --namespace to have an effect when using helm template, it must be present like this in the templates.

This change should not have any effect/change for helm install approach as far as I know.

Pull Request

Related issue

Possibly a fix for #230

What does this PR do?

  • Sets the namespace key in metadata for all kubernetes manifests

PR checklist

Please check if your PR fulfills the following requirements:

  • [ x ] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • [ x ] Have you read the contributing guidelines?
  • [ x ] Have you made sure that the title is accurate and descriptive of the changes?

This sets the namespace key in metadata for all kubernetes manifests.
The `.Release.Namespace` is a built-in variable in helm, that can be
passed with` --namespace` on `install` or `template` step. If not set
it defaults to `default`.

*Why?*

When using `helm install` with the `--namespace` argument the templates
are applied into the chosen namespace.

When using helm only as a template engine, in combination with GitOps
tools like Flux, the namespace property must be set in the rendered
manifests to be applied. For `--namespace` to have an effect when using
`helm template`, it must be present like this in the templates.

This change should not have any effect/change for `helm install`
approach as far as I know.
@curquiza curquiza requested a review from brunoocasali January 29, 2025 13:56
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.

1 participant