mate icon indicating copy to clipboard operation
mate copied to clipboard

Allow watching on a namespace

Open ideahitme opened this issue 8 years ago • 4 comments

Add a flag to enable watching on a certain k8s namespace (e.g. --watch-namespace="test-namespace" [defaults to watching all namespaces]). This should be useful for testing and possible customisation

ideahitme avatar Feb 07 '17 16:02 ideahitme

Sounds good to me.

How about making it similar to how kubectl works for a familiar feel?

  • ./mate
    • runs for default namespace
  • ./mate --namespace foo --namespace bar
    • runs for foo and bar namespace
  • ./mate --all-namespaces
    • runs for all namespaces

linki avatar Feb 08 '17 11:02 linki

hmm, in order to have a testing instance with --namespace mate-test you would also need to run the main instance on all namespaces but mate-test, which wouldn't work with my proposal.

linki avatar Feb 08 '17 11:02 linki

Yeah, it is a good idea to be explicit here about what default namespaces are watched and probably use default namespace. IMO it should not have both --watch and --ignore namespaces and attempt to prevent users from shooting in their foot. In my mind this feature is primarily for testing mate or limiting its scope, and mate should not guarantee safe behaviour in case of another instance running with different configuration. At the end of the day, no one prevents users from running two deployments of mate with different --kubernetes-format and make a mess :)

ideahitme avatar Feb 08 '17 12:02 ideahitme

I think a better approach is to go the route the nginx ingress took, which is to use an annotation to control which services the ingress controller watches: https://github.com/kubernetes/ingress/tree/master/controllers/nginx#running-multiple-ingress-controllers

I've made a suggestion about this here: https://github.com/zalando-incubator/mate/issues/90

chancez avatar Mar 06 '17 21:03 chancez