Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Add field to enable openfaas operator
Browse files Browse the repository at this point in the history
This commit adds field `enable_openfaas_operator` to deploy OpenFaaS with operator

Signed-off-by: Vivek Singh <[email protected]>
  • Loading branch information
viveksyngh authored and alexellis committed Dec 16, 2020
1 parent 7d1175d commit ea4703f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ k3sup install --ip $IP --user $USER --k3s-extra-args "--no-deploy traefik"
Example with [k3d](https://github.com/rancher/k3d):

```sh
k3d create --server-arg "--no-deploy=traefik"
k3d cluster create --k3s-server-arg "--no-deploy=traefik"
```

Newer k3d versions will require an alternative:
Expand Down
5 changes: 3 additions & 2 deletions cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func process(plan types.Plan, prefs InstallPreferences) error {
log.Println(functionAuthErr.Error())
}

if err := installOpenfaas(plan.ScaleToZero, plan.IngressOperator); err != nil {
if err := installOpenfaas(plan.ScaleToZero, plan.IngressOperator, plan.OpenFaaSOperator); err != nil {
return errors.Wrap(err, "unable to install openfaas")
}

Expand Down Expand Up @@ -531,7 +531,7 @@ func installSealedSecrets() error {
return nil
}

func installOpenfaas(scaleToZero, ingressOperator bool) error {
func installOpenfaas(scaleToZero, ingressOperator, openfaasOperator bool) error {
log.Println("Installing openfaas")

args := []string{"install", "openfaas",
Expand All @@ -551,6 +551,7 @@ func installOpenfaas(scaleToZero, ingressOperator bool) error {
"--set faasnetes.httpProbe=true",
"--set faasnetes.imagePullPolicy=IfNotPresent",
"--set ingressOperator.create=" + strconv.FormatBool(ingressOperator),
"--set operator.create=" + strconv.FormatBool(openfaasOperator),
"--wait",
}

Expand Down
5 changes: 4 additions & 1 deletion example.init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,12 @@ build_branch: master

## This setting, if true, will install the openfaas ingress-operator using the openfaas-fn namespace
## for finding functions, creating Ingress records in the openfaas namespace
enable_ingress_operator: false
ingress_operator: false

## Version of OpenFaaS Cloud from https://github.com/openfaas/openfaas-cloud/releases/
### Usage: release tag, a SHA or branch name
openfaas_cloud_version: 0.14.6

## This setting, if true, will deploy OpenFaaS and use the OpenFaaS operator CRD controller,
## default uses faas-netes as the Kubernetes controller
openfaas_operator: false
3 changes: 2 additions & 1 deletion pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ type Plan struct {
EnableECR bool `yaml:"enable_ecr,omitempty"`
ECRConfig ECRConfig `yaml:"ecr_config,omitempty"`
CustomersSecret bool `yaml:"customers_secret,omitempty"`
IngressOperator bool `yaml:"enable_ingress_operator,omitempty"`
IngressOperator bool `yaml:"ingress_operator,omitempty"`
OpenFaaSOperator bool `yaml:"openfaas_operator,omitempty"`
}

// Deployment is the deployment section of YAML concerning
Expand Down

0 comments on commit ea4703f

Please sign in to comment.