utils

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2017 License: Apache-2.0 Imports: 29 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOutOfClusterConfig

func BuildOutOfClusterConfig() (*rest.Config, error)

BuildOutOfClusterConfig returns k8s config

func CreateIngress

func CreateIngress(client kubernetes.Interface, ingressName, funcName, hostname, ns string, enableTLSAcme bool) error

CreateIngress creates ingress rule for a specific function

func CreateK8sCustomResource

func CreateK8sCustomResource(tprClient rest.Interface, f *spec.Function) error

CreateK8sCustomResource will create a custom function object

func DeleteIngress

func DeleteIngress(client kubernetes.Interface, name, ns string) error

DeleteIngress deletes an ingress rule

func DeleteK8sCustomResource

func DeleteK8sCustomResource(tprClient *rest.RESTClient, funcName, ns string) error

DeleteK8sCustomResource will delete custom function object

func DeleteK8sResources

func DeleteK8sResources(ns, name string, client kubernetes.Interface) error

DeleteK8sResources removes k8s objects of the function

func EnsureK8sResources

func EnsureK8sResources(funcObj *spec.Function, client kubernetes.Interface) error

EnsureK8sResources creates/updates k8s objects (deploy, svc, configmap) for the function

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 GetFunction

func GetFunction(funcName, ns string) (spec.Function, error)

GetFunction returns specification of a function

func GetFunctionFileNames added in v0.2.2

func GetFunctionFileNames(runtime, modName string) (fileName, depName string)

GetFunctionFileNames returns the function and dependencies filename

func GetFunctionImage added in v0.2.2

func GetFunctionImage(runtime, ftype string) (imageName string, err error)

GetFunctionImage returns the image ID depending on the runtime, its version and function type

func GetLocalHostname

func GetLocalHostname(config *rest.Config, funcName string) (string, error)

GetLocalHostname returns hostname

func GetPodsByLabel

func GetPodsByLabel(c kubernetes.Interface, ns, k, v string) (*v1.PodList, error)

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 GetReadyPod

func GetReadyPod(pods *v1.PodList) (v1.Pod, error)

GetReadyPod returns the first pod has passed the liveness probe check

func GetRestClient

func GetRestClient() (*rest.RESTClient, error)

GetRestClient returns a k8s restclient to the request from inside of cluster

func GetRuntimes added in v0.2.2

func GetRuntimes() []string

GetRuntimes returns the list of available runtimes as strings

func GetTPRClient

func GetTPRClient() (*rest.RESTClient, error)

GetTPRClient returns tpr client to the request from inside of cluster

func GetTPRClientOutOfCluster

func GetTPRClientOutOfCluster() (*rest.RESTClient, error)

GetTPRClientOutOfCluster returns tpr client to the request from outside of cluster

func UpdateK8sCustomResource

func UpdateK8sCustomResource(f *spec.Function) error

UpdateK8sCustomResource applies changes to the function custom object

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL