Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

HNC: excluded-namespace and included-namespace #87

Closed
santinoncs opened this issue Sep 30, 2021 · 7 comments
Closed

HNC: excluded-namespace and included-namespace #87

santinoncs opened this issue Sep 30, 2021 · 7 comments

Comments

@santinoncs
Copy link
Contributor

Hi,

I want to use HNC but only in a few specific namespaces. Because of that, it is far more difficult to exclude-namespaces and include few than the other way.
Also it would be great if you can use regexp
Do you think is feasible ? it makes sense?
this would be like

    - args:
      - --webhook-server-port=9443
      - --metrics-addr=:8080
      - --max-reconciles=10
      - --apiserver-qps-throttle=50
      - --enable-internal-cert-management
      - --include-namespaces="tests-.*"
@adrianludwin
Copy link
Contributor

adrianludwin commented Sep 30, 2021 via email

@santinoncs
Copy link
Contributor Author

Problem is , the controller pod was not running and this was the cause that all the operation of Create and Delete were not working

Error from server (InternalError): error when deleting "/tmp/nginx.yaml": Internal error occurred: failed calling webhook "objects.hnc.x-k8s.io": Post "https://hnc-webhook-service.hnc-system.svc:443/validate-objects?timeout=2s": no endpoints available for service "hnc-webhook-service"

If I could prevent this to happen in the most of the namespaces, that would be great.

this is why i wanted this in the first place.

Thanks a lot for your rapid response. I will take a look at your approach.

@adrianludwin
Copy link
Contributor

adrianludwin commented Sep 30, 2021 via email

@santinoncs
Copy link
Contributor Author

santinoncs commented Oct 4, 2021

some insights about the implementation:

  • As for now the operator will treat as included everything that is not in the --exclude-namespaces list

What will happen if we use --included-namespaces?

should from now on treat as included just the namespaces that are in that list and excluded the ones that are in the excluded list?

One approach could be:

  • With these start operator parameters

--excluded-namespaces=kube-system

this would mean, everything not in this list will be included

  • With these parameters:

--included-namespaces=test

this would mean everything except test will be excluded

does this make sense?

@adrianludwin
Copy link
Contributor

I think the most typical way to combine "included" and "excluded" options are: "everything in 'included', unless also in 'excluded'." That lets you do things like:

--included-namespaces="^test.*"
--excluded-namespace="test-system"

That is, include every namespace that starts with test other than test-system.

@santinoncs
Copy link
Contributor Author

What about if only one of the two ( included / excluded ) exists?

I imagine that the logic would be, if only one exists, just everything else is not.

@adrianludwin
Copy link
Contributor

The regex to exclude system namespaces would be... unfortunate. Technically it's possible but I think it would be sufficiently hard to use that I'd rather keep --excluded-namespace the way it is.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants