Skip to content

Commit

Permalink
Add max-inflight flag to openfaas
Browse files Browse the repository at this point in the history
Specify max tasks to execute in parallel per queue worker

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed May 1, 2020
1 parent 0e93e38 commit 496f8b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/apps/openfaas_app.go
Expand Up @@ -43,7 +43,8 @@ func MakeInstallOpenFaaS() *cobra.Command {
openfaas.Flags().Bool("clusterrole", false, "Create a ClusterRole for OpenFaaS instead of a limited scope Role")
openfaas.Flags().Bool("direct-functions", true, "Invoke functions directly from the gateway")

openfaas.Flags().Int("queue-workers", 1, "Replicas of queue-worker")
openfaas.Flags().Int("queue-workers", 1, "Replicas of queue-worker for HA")
openfaas.Flags().Int("max-inflight", 1, "Max tasks for queue-worker to process in parallel")
openfaas.Flags().Int("gateways", 1, "Replicas of gateway")

openfaas.Flags().Bool("ingress-operator", false, "Get custom domains and Ingress records via the ingress-operator component")
Expand Down Expand Up @@ -178,6 +179,7 @@ func MakeInstallOpenFaaS() *cobra.Command {
directFunctionsVal = "false"
}
gateways, _ := command.Flags().GetInt("gateways")
maxInflight, _ := command.Flags().GetInt("max_inflight")
queueWorkers, _ := command.Flags().GetInt("queue-workers")

ingressOperator, _ := command.Flags().GetBool("ingress-operator")
Expand All @@ -189,8 +191,9 @@ func MakeInstallOpenFaaS() *cobra.Command {
overrides["faasnetes.imagePullPolicy"] = functionPullPolicy
overrides["basicAuthPlugin.replicas"] = "1"
overrides["gateway.replicas"] = fmt.Sprintf("%d", gateways)
overrides["queueWorker.replicas"] = fmt.Sprintf("%d", queueWorkers)
overrides["ingressOperator.create"] = strconv.FormatBool(ingressOperator)
overrides["queueWorker.replicas"] = fmt.Sprintf("%d", queueWorkers)
overrides["queueWorker.maxInflight"] = fmt.Sprintf("%d", maxInflight)

basicAuth, _ := command.Flags().GetBool("basic-auth")

Expand Down Expand Up @@ -242,12 +245,9 @@ func MakeInstallOpenFaaS() *cobra.Command {
return fmt.Errorf("error applying templated YAML files, error: %s", applyRes.Stderr)
}
}

fmt.Println(openfaasPostInstallMsg)

return nil
}

return openfaas
}

Expand Down

0 comments on commit 496f8b4

Please sign in to comment.