-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
helm: Restore namespace
field in templates
#9351
Conversation
In #6635 (f9f3ebe), we removed the `Namespace` resources from the linkerd Helm charts. But this change also removed the `namespace` field from all generated metadata, adding conditional logic to only include it when being installed via the CLI. This conditional logic currently causes spurious whitespace in output YAML. This doesn't cause problems but is aesthetically inconsistent/distracting. This change removes the `partials.namespace` helper and instead inlines the value in our templates. This makes our CLI- and Helm-generated manifests slightly more consistent and removes needless indirection. Signed-off-by: Oliver Gould <ver@buoyant.io>
@alpeb Is there any problem with removing the conditional logic? |
Namespaces were left out of manifests in the helm case just to follow their recommendation, as posted here (unfortunately missing from their docs). helm template linkerd/linkerd-control-plane | kubectl apply -n linkerd -f - My understanding is that there are helm plugins in CD tools rely on |
@alpeb the problem, as i see it, is that we have to encode the namespace in many, many places:
I can't see the benefit from omitting from the metadata if it has to be kept in sync in all of these other places. Specifically, the command you shared will not currently produce a working Linkerd:
This would install the resources in the By pinning the namespace metadata in the manifest, we can at least ensure consistency. |
Ah you're totally right! |
Signed-off-by: Oliver Gould <ver@buoyant.io>
Signed-off-by: Oliver Gould <ver@buoyant.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
#9351 added a namespace field onto some ClusterRole and ClusterRoleBinding resources in the linkerd-multicluster extension. This was causing the resources in the templates to not match the resources installed in the cluster when compared by name/namespace and causing `linkerd mc prune` to flag those resources for deletion even though they exist in the template. We remove the namespace field from cluster scoped resources. Signed-off-by: Alex Leong <alex@buoyant.io>
In #6635 (f9f3ebe), we removed the
Namespace
resources from the linkerd Helm charts. But this change also removed thenamespace
field from all generated metadata, adding conditional logic to only include it when being installed via the CLI.This conditional logic currently causes spurious whitespace in output YAML. This doesn't cause problems but is aesthetically inconsistent/distracting.
This change removes the
partials.namespace
helper and instead inlines the value in our templates. This makes our CLI- and Helm-generated manifests slightly more consistent and removes needless indirection.