Documentation ¶
Index ¶
- Constants
- func MakeDeleteHandler(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc
- func MakeDeployHandler(functionNamespace string, factory k8s.FunctionFactory) http.HandlerFunc
- func MakeFunctionReader(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc
- func MakeHealthHandler() http.HandlerFunc
- func MakeInfoHandler(version, sha string) http.HandlerFunc
- func MakeNamespacesLister(defaultNamespace string, clientset kubernetes.Interface) http.HandlerFunc
- func MakeReplicaReader(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc
- func MakeReplicaUpdater(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc
- func MakeSecretHandler(defaultNamespace string, kube kubernetes.Interface) http.HandlerFunc
- func MakeUpdateHandler(defaultNamespace string, factory k8s.FunctionFactory) http.HandlerFunc
- func ProcessErrorReasons(err error) (int, metav1.StatusReason)
- func ValidateDeployRequest(request *types.FunctionDeployment) error
- type NamespaceResolver
Constants ¶
const ( //OrchestrationIdentifier identifier string for provider orchestration OrchestrationIdentifier = "kubernetes" //ProviderName name of the provider ProviderName = "faas-netes" )
Variables ¶
This section is empty.
Functions ¶
func MakeDeleteHandler ¶
func MakeDeleteHandler(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc
MakeDeleteHandler delete a function
func MakeDeployHandler ¶
func MakeDeployHandler(functionNamespace string, factory k8s.FunctionFactory) http.HandlerFunc
MakeDeployHandler creates a handler to create new functions in the cluster
func MakeFunctionReader ¶
func MakeFunctionReader(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc
MakeFunctionReader handler for reading functions deployed in the cluster as deployments.
func MakeHealthHandler ¶
func MakeHealthHandler() http.HandlerFunc
MakeHealthHandler returns 200/OK when healthy
func MakeInfoHandler ¶
func MakeInfoHandler(version, sha string) http.HandlerFunc
MakeInfoHandler creates handler for /system/info endpoint
func MakeNamespacesLister ¶
func MakeNamespacesLister(defaultNamespace string, clientset kubernetes.Interface) http.HandlerFunc
MakeNamespacesLister builds a list of namespaces with an "openfaas" tag, or the default name
func MakeReplicaReader ¶
func MakeReplicaReader(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc
MakeReplicaReader reads the amount of replicas for a deployment
func MakeReplicaUpdater ¶
func MakeReplicaUpdater(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc
MakeReplicaUpdater updates desired count of replicas
func MakeSecretHandler ¶
func MakeSecretHandler(defaultNamespace string, kube kubernetes.Interface) http.HandlerFunc
MakeSecretHandler makes a handler for Create/List/Delete/Update of secrets in the Kubernetes API
func MakeUpdateHandler ¶
func MakeUpdateHandler(defaultNamespace string, factory k8s.FunctionFactory) http.HandlerFunc
MakeUpdateHandler update specified function
func ProcessErrorReasons ¶
func ProcessErrorReasons(err error) (int, metav1.StatusReason)
ProcessErrorReasons maps k8serrors.ReasonForError to http status codes
func ValidateDeployRequest ¶
func ValidateDeployRequest(request *types.FunctionDeployment) error
ValidateDeployRequest validates that the service name is valid for Kubernetes
Types ¶
type NamespaceResolver ¶
NamespaceResolver is a method that determines the requested namespace corresponding to an HTTP request. It then validates that OpenFaaS is permitted to operate in that the namespace.
func NewNamespaceResolver ¶
func NewNamespaceResolver(defaultNamespace string, kube kubernetes.Interface) NamespaceResolver
NewNamespaceResolver returns a generic namespace resolver that will inspect both the GET query parameters and the request body. It looks for the query param or json key "namespace".