Skip to content

Commit

Permalink
Document openfaas_gateway_namespace
Browse files Browse the repository at this point in the history
Added docs for "openfaas_gateway_namespace" - thanks for
feedback @ajaegle. Re: #6

Signed-off-by: Alex Ellis <[email protected]>
  • Loading branch information
alexellis committed Jul 1, 2019
1 parent 7faae14 commit 7a457de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ Remember to configure DNS for `nodeinfo.myfaas.club` or edit `/etc/hosts` and po
This project follows the [OpenFaaS contributing guide](./CONTRIBUTING.md)
## Configuration via Environment Variable
| Option | Usage |
|---------------------|-------------------------------------------------------------------------------------------------|
| `openfaas_gateway_namespace` | Namespace for the OpenFaaS gateway, default: `openfaas` |
## LICENSE
MIT
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ func main() {
glog.Fatalf("Error building cert-manager clientset: %s", err.Error())
}

functionNamespace := "openfaas"
if namespace, exists := os.LookupEnv("function_namespace"); exists {
functionNamespace = namespace
ingressNamespace := "openfaas"
if namespace, exists := os.LookupEnv("openfaas_gateway_namespace"); exists {
ingressNamespace = namespace
}

defaultResync := time.Second * 30

kubeInformerOpt := kubeinformers.WithNamespace(functionNamespace)
kubeInformerOpt := kubeinformers.WithNamespace(ingressNamespace)
kubeInformerFactory := kubeinformers.
NewSharedInformerFactoryWithOptions(kubeClient, defaultResync, kubeInformerOpt)

faasInformerOpt := informers.WithNamespace(functionNamespace)
faasInformerOpt := informers.WithNamespace(ingressNamespace)
faasInformerFactory := informers.
NewSharedInformerFactoryWithOptions(faasClient, defaultResync, faasInformerOpt)

Expand Down

0 comments on commit 7a457de

Please sign in to comment.