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

Commit ea4703f

Browse files
viveksynghalexellis
authored andcommitted
Add field to enable openfaas operator
This commit adds field `enable_openfaas_operator` to deploy OpenFaaS with operator Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
1 parent 7d1175d commit ea4703f

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

USER_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ k3sup install --ip $IP --user $USER --k3s-extra-args "--no-deploy traefik"
2727
Example with [k3d](https://github.com/rancher/k3d):
2828

2929
```sh
30-
k3d create --server-arg "--no-deploy=traefik"
30+
k3d cluster create --k3s-server-arg "--no-deploy=traefik"
3131
```
3232

3333
Newer k3d versions will require an alternative:

cmd/apply.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func process(plan types.Plan, prefs InstallPreferences) error {
323323
log.Println(functionAuthErr.Error())
324324
}
325325

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

@@ -531,7 +531,7 @@ func installSealedSecrets() error {
531531
return nil
532532
}
533533

534-
func installOpenfaas(scaleToZero, ingressOperator bool) error {
534+
func installOpenfaas(scaleToZero, ingressOperator, openfaasOperator bool) error {
535535
log.Println("Installing openfaas")
536536

537537
args := []string{"install", "openfaas",
@@ -551,6 +551,7 @@ func installOpenfaas(scaleToZero, ingressOperator bool) error {
551551
"--set faasnetes.httpProbe=true",
552552
"--set faasnetes.imagePullPolicy=IfNotPresent",
553553
"--set ingressOperator.create=" + strconv.FormatBool(ingressOperator),
554+
"--set operator.create=" + strconv.FormatBool(openfaasOperator),
554555
"--wait",
555556
}
556557

example.init.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,12 @@ build_branch: master
328328

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

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

337+
## This setting, if true, will deploy OpenFaaS and use the OpenFaaS operator CRD controller,
338+
## default uses faas-netes as the Kubernetes controller
339+
openfaas_operator: false

pkg/types/types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ type Plan struct {
6969
EnableECR bool `yaml:"enable_ecr,omitempty"`
7070
ECRConfig ECRConfig `yaml:"ecr_config,omitempty"`
7171
CustomersSecret bool `yaml:"customers_secret,omitempty"`
72-
IngressOperator bool `yaml:"enable_ingress_operator,omitempty"`
72+
IngressOperator bool `yaml:"ingress_operator,omitempty"`
73+
OpenFaaSOperator bool `yaml:"openfaas_operator,omitempty"`
7374
}
7475

7576
// Deployment is the deployment section of YAML concerning

0 commit comments

Comments
 (0)