Skip to content

Commit

Permalink
Warn if no external nats configured
Browse files Browse the repository at this point in the history
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
welteki authored and alexellis committed Sep 20, 2022
1 parent 8a8b282 commit 297ab2f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ func main() {
probeFunctions := false
clusterRole := false
jetstream := false
internalNats := false

for _, dep := range deps.Items {

Expand Down Expand Up @@ -370,6 +371,13 @@ func main() {
}
}
}
if dep.Name == "nats" {
for _, container := range dep.Spec.Template.Spec.Containers {
if container.Name == "nats" {
internalNats = true
}
}
}
}

var nsFunctions = make(map[string][]Function)
Expand Down Expand Up @@ -530,6 +538,10 @@ Features detected:
if queueWorkerReplicas < 3 {
fmt.Printf("⚠️ queue-worker replicas want >= %d but got %d, (not Highly Available (HA))\n", 3, queueWorkerReplicas)
}

if internalNats {
fmt.Printf("⚠️ Use external NATS to ensure high-availability and persistence\n")
}
}

if gatewayReplicas < 3 {
Expand Down

0 comments on commit 297ab2f

Please sign in to comment.