openfaas-operator icon indicating copy to clipboard operation
openfaas-operator copied to clipboard

[Feature] Add support for managing multiple-namespaces

Open alexellis opened this issue 6 years ago • 11 comments
trafficstars

Expected Behaviour

Add support for the namespaces endpoint, as per faas-netes

Current Behaviour

Currently unavailable (404)

Possible Solution

  • Quick fix / work-around: implement a stub that returns the default namespace
  • Longer term fix: copy patches from faas-netes, test e2e with the operator

Related: #91

cc @stefanprodan @LucasRoesler

In order to have this working e2e, we may also need (via Bruno):

  • Make the operator watch resources across all Kubernetes namespaces.
  • Introduce the required RBAC policies (cluster role and cluster role binding).
  • Copy whatever faas-netes is doing as per openfaas/faas-netes#511.

alexellis avatar Oct 19 '19 08:10 alexellis

@bmcstdio is this something you would like to work on?

alexellis avatar Nov 01 '19 09:11 alexellis

cc @Waterdrips

alexellis avatar Nov 25 '19 14:11 alexellis

A quick-fix has been implemented to return the default namespace, but we still need to add support for managing/fetching valid namespaces.

alexellis avatar Nov 25 '19 16:11 alexellis

To avoid using a cluster role, we could add a flag with a list of namespaces to the operator cmd. At startup we would create a controller per namespace that runs in is own go routine. I think this way we can bind the operator service account to each namespace with a role binding.

stefanprodan avatar Nov 25 '19 16:11 stefanprodan

@stefanprodan I think that approach is over-complicated and error prone. What is the issue with using a cluster role?

bmcustodio avatar Nov 25 '19 19:11 bmcustodio

We've discussed this and see pros/cons in both approaches. Since the optional ClusterRole is available for faas-netes, we want to copy that approach and then revisit once we have parity.

alexellis avatar Jan 17 '20 14:01 alexellis

/set title: [Feature] Add support for managing multiple-namespaces

alexellis avatar Jan 17 '20 14:01 alexellis

See https://github.com/openfaas/faas-netes/issues/511 for how this was completed in other components.

alexellis avatar Jan 17 '20 14:01 alexellis

I will look look into this over the weekend.

adamjohnson01 avatar Jan 17 '20 14:01 adamjohnson01

@adamjohnson01 did you have any questions? Feel free to coordinate with @stefanprodan and @LucasRoesler

alexellis avatar Jan 19 '20 15:01 alexellis

@alexellis, I did not get much time this weekend but I have started going through the code.

adamjohnson01 avatar Jan 19 '20 23:01 adamjohnson01