Istio integration (#421)
This the very first step for fission to integrate with Istio, which is an open platform to connect, manage, and secure microservices. With Istio, users are able to monitor functions usage and trace requests latency through dashboards. For more information, please visit http://fission.io/docs/
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gorilla/handlers"
|
||||
@@ -41,6 +42,8 @@ type (
|
||||
storageServiceUrl string
|
||||
builderManagerUrl string
|
||||
workflowApiUrl string
|
||||
functionNamespace string
|
||||
useIstio bool
|
||||
}
|
||||
|
||||
logDBConfig struct {
|
||||
@@ -74,6 +77,21 @@ func MakeAPI() (*API, error) {
|
||||
api.workflowApiUrl = "http://workflows-apiserver"
|
||||
}
|
||||
|
||||
fnNs := os.Getenv("FISSION_FUNCTION_NAMESPACE")
|
||||
if len(fnNs) > 0 {
|
||||
api.functionNamespace = fnNs
|
||||
} else {
|
||||
api.functionNamespace = "fission-function"
|
||||
}
|
||||
|
||||
if len(os.Getenv("ENABLE_ISTIO")) > 0 {
|
||||
istio, err := strconv.ParseBool(os.Getenv("ENABLE_ISTIO"))
|
||||
if err != nil {
|
||||
log.Println("Failed to parse ENABLE_ISTIO")
|
||||
}
|
||||
api.useIstio = istio
|
||||
}
|
||||
|
||||
return api, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user