-
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
Linkerd chart anti-patterns around namespace #6463
Comments
That's a great point. The reason we set the namespace by default is because it requires metadata that Helm has no way of declaring. We could have gone the other way, and not provide the namespace by default and give instructions about adding that metadata. But that's an additional step that would make things a little bit more complicated for users. Instead, we opted for making things simpler and working out of the box without extra config, while leaving the door open to operators adopting a more "correct" Helm pattern via those params you pointed out. Also, all this was designed under Helm v2's paradigm (see #3211), so it might be time to take another look and better align with v3's way of doing things. For starters, we should think about ways of no longer depending on that metadata. There's a section in our Helm docs about Customizing the Namespace. One first thing we could do is better explain how that is a preferred approach, in order to better integrate with other Helm tools. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
I believe this is in progress at #6635 |
@alpeb this is done, right? |
Yep, addressed in #6635 |
If the namespace
linkerd
already exists, the chart fails. Thus the helm chart is not idempotent, which makes it difficult to manage changes on an existing infrastructure. It is true that this can be overridden (e.g.installNamespace: false
), but the helm chart by default is not idempotent.Embedded namespaces in a helm chart is an anti-pattern as it removes the ability to manage the kubernetes cluster away from the Kubernetes operator, and makes the chart not idempotent.
Further, explicit definition of
namespace: linkerd
is also an anti-pattern, as this value is set during deployment with.Release.Namespace
. Templates can use.Release.Namespace
to set values likelinkerd.io/control-plane-ns
for example.Steps to Reproduce
Additionally, when using downstream tools
helmfile
, this also reproduces:Actual Results
The deployment will fail with the following error.
Expected Results
I expected this chart to be idempotent. If the namespace linkerd already exists, the chart should not error out. Forcing namespace is an anti-pattern, this should be under the control of the operator.
The text was updated successfully, but these errors were encountered: