-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add option to limit helm-op to a single namespace #1664
Conversation
- add namespace restriction to Kubernetes informer and chart sync component
Is there a reason for it being no restriction vs exactly one namespace, rather than no restriction vs some namespaces? |
@squaremo the |
I also feel that it'd be a good idea to match what Flux does, i.e. a list of namespaces, however Tiller can only be used in a context of a single names or the entire cluster, and I don't think making operator support |
chart/flux/values.yaml
Outdated
@@ -21,6 +21,8 @@ helmOperator: | |||
repository: quay.io/weaveworks/helm-operator | |||
tag: 0.5.3 | |||
pullPolicy: IfNotPresent | |||
# Limit the operator scope to a single namespace | |||
namespace: |
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.
should this be namespace: ""
?
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.
If the namespace is not set then the default from the pflag
is applied. I've added the namespace in the values.yaml to document the option not to provide a default value for it.
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 overall. Once it's in master I'll be happy to test in the project where we use it this way.
For the purpose of understanding the consequences of this PR better, lets say in the repo 1.I set the helmop namespace to 2.I set the helmop namespace to |
@stephenmoloney if you set helm-op namespace to |
@stefanprodan ok, thanks. So is the motivation for this PR to allow having one flux/helm operator per namespace ? Also, would it make sense to allow the option of a list of namespaces ? |
@stephenmoloney the motivation is to be able to run one flux/helm-op/tiller per namespace and since Tiller can't target a list of namespaces it doesn't make sense for the helm-op to do so. |
However flux is soon going to support proper multi-namespace filtering soon (#1668) and it seems that mutiple namespaces are (or were) in the plans for Tiller too helm/helm#838 (comment) |
See helm/helm#2060 (comment) and helm/helm#2060 (comment) as well |
@stefanprodan thanks. |
@2opremio Tiller is going away with Helm v3. Once v3 is out and Tiller is gone we can revisit the multi-namespace issue. |
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.
Tiller can only be used in a context of a single names or the entire cluster
Is the argument to Tiller also --namespace
? If so there's a fair argument for mirroring that. Otherwise I'd prefer --include-namespace
, or --allow-namespace
.
Nitpicks in the code itself :-)
- delete getNamespaces func from chart sync
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.
An important improvement, thanks Stefan
What about this use case - I want a "cluster owner" flux / op / helm that monitors all, and then 'namespace owner' flux / op / helm that watches a specific namespace. I don't see a practical way to make the cluster-level operator ignore that namespace & leave it to the helm that lives there. |
Fix #1406