Documentation
¶
Index ¶
- func BuildOutOfClusterConfig() (*rest.Config, error)
- func CreateAutoscale(client kubernetes.Interface, hpa v2beta1.HorizontalPodAutoscaler) error
- func CreateFunctionCustomResource(kubelessClient versioned.Interface, f *kubelessApi.Function) error
- func CreateServiceMonitor(smclient monitoringv1alpha1.MonitoringV1alpha1Client, ...) error
- func DeleteAutoscale(client kubernetes.Interface, name, ns string) error
- func DeleteFunctionCustomResource(kubelessClient versioned.Interface, funcName, ns string) error
- func DeleteServiceMonitor(smclient monitoringv1alpha1.MonitoringV1alpha1Client, name, ns string) error
- func DryRunFmt(format string, trigger interface{}) (string, error)
- func EnsureFuncConfigMap(client kubernetes.Interface, funcObj *kubelessApi.Function, ...) error
- func EnsureFuncDeployment(client kubernetes.Interface, funcObj *kubelessApi.Function, ...) error
- func EnsureFuncImage(client kubernetes.Interface, funcObj *kubelessApi.Function, ...) error
- func EnsureFuncService(client kubernetes.Interface, funcObj *kubelessApi.Function, ...) error
- func Exec(client corev1.CoreV1Interface, pod, namespace string, opts v1.PodExecOptions) (*http.Request, error)
- func ExecRoundTripper(conf *rest.Config, f RoundTripCallback) (http.RoundTripper, error)
- func FunctionObjAddFinalizer(kubelessClient versioned.Interface, funcObj *kubelessApi.Function, ...) error
- func FunctionObjHasFinalizer(funcObj *kubelessApi.Function, finalizerString string) bool
- func FunctionObjRemoveFinalizer(kubelessClient versioned.Interface, funcObj *kubelessApi.Function, ...) error
- func GetAPIExtensionsClientInCluster() clientsetAPIExtensions.Interface
- func GetAPIExtensionsClientOutOfCluster() clientsetAPIExtensions.Interface
- func GetAnnotationsFromCRD(clientset clientsetAPIExtensions.Interface, name string) (map[string]string, error)
- func GetClient() kubernetes.Interface
- func GetClientOutOfCluster() kubernetes.Interface
- func GetContentType(filename string) (string, error)
- func GetDefaultNamespace() string
- func GetFunction(funcName, ns string) (kubelessApi.Function, error)
- func GetFunctionClientInCluster() (versioned.Interface, error)
- func GetFunctionCustomResource(kubelessClient versioned.Interface, funcName, ns string) (*kubelessApi.Function, error)
- func GetFunctionPort(clientset kubernetes.Interface, namespace, functionName string) (string, error)
- func GetInClusterConfig() (*rest.Config, error)
- func GetKubelessClientOutCluster() (versioned.Interface, error)
- func GetKubelessConfig(cli kubernetes.Interface, cliAPIExtensions clientsetAPIExtensions.Interface) (*v1.ConfigMap, error)
- func GetLocalHostname(config *rest.Config, funcName string) (string, error)
- func GetOwnerReference(kind, apiVersion, name string, uid types.UID) ([]metav1.OwnerReference, error)
- func GetPodsByLabel(c kubernetes.Interface, ns, k, v string) (*v1.PodList, error)
- func GetRandString(n int) (string, error)
- func GetReadyPod(pods *v1.PodList) (v1.Pod, error)
- func GetSecretsAsLocalObjectReference(secrets ...string) []v1.LocalObjectReference
- func IsJSON(s string) bool
- func MergeDeployments(destinationDeployment *appsv1.Deployment, sourceDeployment *appsv1.Deployment) error
- func ParseContent(file, contentType string) (string, string, error)
- func PatchFunctionCustomResource(kubelessClient versioned.Interface, f *kubelessApi.Function) error
- func UpdateAutoscale(client kubernetes.Interface, hpa v2beta1.HorizontalPodAutoscaler) error
- func UpdateFunctionCustomResource(kubelessClient versioned.Interface, f *kubelessApi.Function) error
- type Cmd
- type ConfigLocation
- type Metric
- type MetricsRetriever
- type PrometheusMetricsHandler
- type RoundTripCallback
- type WebsocketRoundTripper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOutOfClusterConfig ¶
BuildOutOfClusterConfig returns k8s config
func CreateAutoscale ¶ added in v0.2.3
func CreateAutoscale(client kubernetes.Interface, hpa v2beta1.HorizontalPodAutoscaler) error
CreateAutoscale creates HPA object for function
func CreateFunctionCustomResource ¶ added in v0.5.0
func CreateFunctionCustomResource(kubelessClient versioned.Interface, f *kubelessApi.Function) error
CreateFunctionCustomResource will create a custom function object
func CreateServiceMonitor ¶ added in v0.3.2
func CreateServiceMonitor(smclient monitoringv1alpha1.MonitoringV1alpha1Client, funcObj *kubelessApi.Function, ns string, or []metav1.OwnerReference) error
CreateServiceMonitor creates a Service Monitor for the given function
func DeleteAutoscale ¶ added in v0.2.3
func DeleteAutoscale(client kubernetes.Interface, name, ns string) error
DeleteAutoscale deletes an autoscale rule
func DeleteFunctionCustomResource ¶ added in v0.5.0
DeleteFunctionCustomResource will delete custom function object
func DeleteServiceMonitor ¶ added in v0.2.3
func DeleteServiceMonitor(smclient monitoringv1alpha1.MonitoringV1alpha1Client, name, ns string) error
DeleteServiceMonitor cleans the sm if it exists
func EnsureFuncConfigMap ¶ added in v0.2.4
func EnsureFuncConfigMap(client kubernetes.Interface, funcObj *kubelessApi.Function, or []metav1.OwnerReference, lr *langruntime.Langruntimes) error
EnsureFuncConfigMap creates/updates a config map with a function specification
func EnsureFuncDeployment ¶ added in v0.2.4
func EnsureFuncDeployment(client kubernetes.Interface, funcObj *kubelessApi.Function, or []metav1.OwnerReference, lr *langruntime.Langruntimes, prebuiltRuntimeImage, provisionImage string, imagePullSecrets []v1.LocalObjectReference) error
EnsureFuncDeployment creates/updates a function deployment
func EnsureFuncImage ¶ added in v0.5.0
func EnsureFuncImage(client kubernetes.Interface, funcObj *kubelessApi.Function, lr *langruntime.Langruntimes, or []metav1.OwnerReference, imageName, tag, builderImage, registryHost, dockerSecretName, provisionImage string, registryTLSEnabled bool, imagePullSecrets []v1.LocalObjectReference) error
EnsureFuncImage creates a Job to build a function image
func EnsureFuncService ¶ added in v0.2.4
func EnsureFuncService(client kubernetes.Interface, funcObj *kubelessApi.Function, or []metav1.OwnerReference) error
EnsureFuncService creates/updates a function service
func Exec ¶ added in v0.2.4
func Exec(client corev1.CoreV1Interface, pod, namespace string, opts v1.PodExecOptions) (*http.Request, error)
Exec returns an "exec" Request suitable for ExecRoundTripper.
func ExecRoundTripper ¶ added in v0.2.4
func ExecRoundTripper(conf *rest.Config, f RoundTripCallback) (http.RoundTripper, error)
ExecRoundTripper creates a wrapped WebsocketRoundTripper
func FunctionObjAddFinalizer ¶ added in v0.5.0
func FunctionObjAddFinalizer(kubelessClient versioned.Interface, funcObj *kubelessApi.Function, finalizerString string) error
FunctionObjAddFinalizer add specified finalizer string to function object
func FunctionObjHasFinalizer ¶ added in v0.5.0
func FunctionObjHasFinalizer(funcObj *kubelessApi.Function, finalizerString string) bool
FunctionObjHasFinalizer checks if function object already has the Function controller finalizer
func FunctionObjRemoveFinalizer ¶ added in v0.5.0
func FunctionObjRemoveFinalizer(kubelessClient versioned.Interface, funcObj *kubelessApi.Function, finalizerString string) error
FunctionObjRemoveFinalizer removes the finalizer from the function object
func GetAPIExtensionsClientInCluster ¶ added in v0.5.0
func GetAPIExtensionsClientInCluster() clientsetAPIExtensions.Interface
GetAPIExtensionsClientInCluster returns a k8s clientset to access APIExtensions from inside of cluster
func GetAPIExtensionsClientOutOfCluster ¶ added in v0.5.0
func GetAPIExtensionsClientOutOfCluster() clientsetAPIExtensions.Interface
GetAPIExtensionsClientOutOfCluster returns a k8s clientset to access APIExtensions from outside of cluster
func GetAnnotationsFromCRD ¶ added in v0.5.0
func GetAnnotationsFromCRD(clientset clientsetAPIExtensions.Interface, name string) (map[string]string, error)
GetAnnotationsFromCRD gets annotations from a CustomResourceDefinition
func GetClient ¶
func GetClient() kubernetes.Interface
GetClient returns a k8s clientset to the request from inside of cluster
func GetClientOutOfCluster ¶
func GetClientOutOfCluster() kubernetes.Interface
GetClientOutOfCluster returns a k8s clientset to the request from outside of cluster
func GetContentType ¶ added in v1.0.7
GetContentType Gets the content type of a given filename
func GetDefaultNamespace ¶ added in v0.3.0
func GetDefaultNamespace() string
GetDefaultNamespace returns the namespace set in current cluster context
func GetFunction ¶
func GetFunction(funcName, ns string) (kubelessApi.Function, error)
GetFunction returns specification of a function
func GetFunctionClientInCluster ¶ added in v0.4.0
GetFunctionClientInCluster returns function clientset to the request from inside of cluster
func GetFunctionCustomResource ¶ added in v0.5.0
func GetFunctionCustomResource(kubelessClient versioned.Interface, funcName, ns string) (*kubelessApi.Function, error)
GetFunctionCustomResource will delete custom function object
func GetFunctionPort ¶ added in v1.0.0
func GetFunctionPort(clientset kubernetes.Interface, namespace, functionName string) (string, error)
GetFunctionPort returns the port for a function service
func GetInClusterConfig ¶ added in v1.0.0
GetInClusterConfig returns necessary Config object to authenticate k8s clients if env variable is set
func GetKubelessClientOutCluster ¶ added in v0.5.0
GetKubelessClientOutCluster returns kubeless clientset to make kubeless API request from outside of cluster
func GetKubelessConfig ¶ added in v1.0.0
func GetKubelessConfig(cli kubernetes.Interface, cliAPIExtensions clientsetAPIExtensions.Interface) (*v1.ConfigMap, error)
GetKubelessConfig Returns Kubeless ConfigMap
func GetLocalHostname ¶
GetLocalHostname returns hostname
func GetOwnerReference ¶ added in v0.3.1
func GetOwnerReference(kind, apiVersion, name string, uid types.UID) ([]metav1.OwnerReference, error)
GetOwnerReference returns ownerRef for appending to objects's metadata
func GetPodsByLabel ¶
GetPodsByLabel returns list of pods which match the label We use this to returns pods to which the function is deployed or pods running controllers
func GetRandString ¶ added in v0.5.0
GetRandString returns a random string of lenght N
func GetReadyPod ¶
GetReadyPod returns the first pod has passed the liveness probe check
func GetSecretsAsLocalObjectReference ¶ added in v1.0.0
func GetSecretsAsLocalObjectReference(secrets ...string) []v1.LocalObjectReference
GetSecretsAsLocalObjectReference returns a list of LocalObjectReference based on secret names
func MergeDeployments ¶ added in v0.4.0
func MergeDeployments(destinationDeployment *appsv1.Deployment, sourceDeployment *appsv1.Deployment) error
MergeDeployments merges two deployment objects
func ParseContent ¶ added in v1.0.7
ParseContent Parses the content of a file as string
func PatchFunctionCustomResource ¶ added in v0.5.0
func PatchFunctionCustomResource(kubelessClient versioned.Interface, f *kubelessApi.Function) error
PatchFunctionCustomResource applies changes to the function custom object
func UpdateAutoscale ¶ added in v1.0.7
func UpdateAutoscale(client kubernetes.Interface, hpa v2beta1.HorizontalPodAutoscaler) error
UpdateAutoscale updates an existing HPA object for a function
func UpdateFunctionCustomResource ¶ added in v0.5.0
func UpdateFunctionCustomResource(kubelessClient versioned.Interface, f *kubelessApi.Function) error
UpdateFunctionCustomResource applies changes to the function custom object
Types ¶
type Cmd ¶ added in v0.2.4
Cmd stores information relevant to an individual remote command being run
type ConfigLocation ¶ added in v0.5.0
ConfigLocation is a struct to store the location of kubeless configuration specific ConfigMap
type Metric ¶ added in v1.0.0
type Metric struct { FunctionName string `json:"function,omitempty"` Namespace string `json:"namespace,omitempty"` Method string `json:"method,omitempty"` Message string `json:"message,omitempty"` TotalCalls float64 `json:"total_calls,omitempty"` TotalFailures float64 `json:"total_failures,omitempty"` TotalDurationSeconds float64 `json:"total_duration_seconds,omitempty"` AvgDurationSeconds float64 `json:"avg_duration_seconds,omitempty"` }
Metric contains metrics for a functions
func GetFunctionMetrics ¶ added in v1.0.0
func GetFunctionMetrics(apiV1Client kubernetes.Interface, h MetricsRetriever, namespace, functionName string) []*Metric
GetFunctionMetrics returns Prometheus metrics as a slice of *Metrics
type MetricsRetriever ¶ added in v1.0.0
type MetricsRetriever interface {
GetRawMetrics(kubernetes.Interface, string, string) ([]byte, error)
}
MetricsRetriever is an interface for retreiving metrics from an endpoint
type PrometheusMetricsHandler ¶ added in v1.0.0
type PrometheusMetricsHandler struct{}
PrometheusMetricsHandler is a handler for retreiving metrics from Prometheus
func (*PrometheusMetricsHandler) GetRawMetrics ¶ added in v1.0.0
func (h *PrometheusMetricsHandler) GetRawMetrics(apiV1Client kubernetes.Interface, namespace, functionName string) ([]byte, error)
GetRawMetrics returns the raw metrics for a Prometheus endpoint
type RoundTripCallback ¶ added in v0.2.4
A RoundTripCallback is used to process the websocket from an individual command execution.
type WebsocketRoundTripper ¶ added in v0.2.4
type WebsocketRoundTripper struct { TLSConfig *tls.Config Do RoundTripCallback }
WebsocketRoundTripper is an http.RoundTripper that invokes a callback on a websocket connection.