Documentation ¶
Index ¶
- Constants
- Variables
- func AddEdgeWorkerLabelAndAutonomyAnnotation(cliSet kubeclientset.Interface, node *corev1.Node, lVal, aVal string) (*corev1.Node, error)
- func AnnotateNode(cliSet kubeclientset.Interface, node *corev1.Node, key, val string) (*corev1.Node, error)
- func CreateClusterRoleBindingFromYaml(cliSet kubeclientset.Interface, crbTmpl string) error
- func CreateClusterRoleFromYaml(cliSet kubeclientset.Interface, crTmpl string) error
- func CreateConfigMapFromYaml(cliSet kubeclientset.Interface, ns, cmTmpl string) error
- func CreateDeployFromYaml(cliSet kubeclientset.Interface, ns, dplyTmpl string, ctx interface{}) error
- func CreateRoleBindingFromYaml(cliSet kubeclientset.Interface, crbTmpl string) error
- func CreateSecretFromYaml(cliSet kubeclientset.Interface, ns, saTmpl string) error
- func CreateServiceAccountFromYaml(cliSet kubeclientset.Interface, ns, saTmpl string) error
- func CreateServiceFromYaml(cliSet kubeclientset.Interface, ns, svcTmpl string) error
- func CreateYurtManager(client kubeclientset.Interface, yurtManagerImage string) error
- func DeleteYurthubSetting(client kubeclientset.Interface) error
- func DeployYurthubSetting(client kubeclientset.Interface) error
- func GetOrCreateJoinTokenString(cliSet kubeclientset.Interface) (string, error)
- func PrintPodLog(client kubeclientset.Interface, pod *corev1.Pod, w io.Writer) error
- func RunJobAndCleanup(cliSet kubeclientset.Interface, job *batchv1.Job, ...) error
- func RunServantJobs(cliSet kubeclientset.Interface, waitServantJobTimeout time.Duration, ...) error
- func YamlToObject(yamlContent []byte) (k8sruntime.Object, error)
- type Builder
Constants ¶
const ( SystemNamespace = "kube-system" // DefaultWaitServantJobTimeout specifies the timeout value of waiting for the ServantJob to be succeeded DefaultWaitServantJobTimeout = time.Minute * 5 )
Variables ¶
var ( // PropagationPolicy defines the propagation policy used when deleting a resource PropagationPolicy = metav1.DeletePropagationBackground // CheckServantJobPeriod defines the time interval between two successive ServantJob statu's inspection CheckServantJobPeriod = time.Second * 10 )
Functions ¶
func AnnotateNode ¶
func AnnotateNode(cliSet kubeclientset.Interface, node *corev1.Node, key, val string) (*corev1.Node, error)
AnnotateNode add a new annotation (<key>=<val>) to the given node
func CreateClusterRoleBindingFromYaml ¶
func CreateClusterRoleBindingFromYaml(cliSet kubeclientset.Interface, crbTmpl string) error
CreateClusterRoleBindingFromYaml creates the ClusterRoleBinding from the yaml template.
func CreateClusterRoleFromYaml ¶
func CreateClusterRoleFromYaml(cliSet kubeclientset.Interface, crTmpl string) error
CreateClusterRoleFromYaml creates the ClusterRole from the yaml template.
func CreateConfigMapFromYaml ¶
func CreateConfigMapFromYaml(cliSet kubeclientset.Interface, ns, cmTmpl string) error
CreateConfigMapFromYaml creates the ConfigMap from the yaml template.
func CreateDeployFromYaml ¶
func CreateDeployFromYaml(cliSet kubeclientset.Interface, ns, dplyTmpl string, ctx interface{}) error
CreateDeployFromYaml creates the Deployment from the yaml template.
func CreateRoleBindingFromYaml ¶ added in v1.4.0
func CreateRoleBindingFromYaml(cliSet kubeclientset.Interface, crbTmpl string) error
CreateRoleBindingFromYaml creates the RoleBinding from the yaml template.
func CreateSecretFromYaml ¶ added in v1.4.0
func CreateSecretFromYaml(cliSet kubeclientset.Interface, ns, saTmpl string) error
CreateSecretFromYaml creates the Secret from the yaml template.
func CreateServiceAccountFromYaml ¶
func CreateServiceAccountFromYaml(cliSet kubeclientset.Interface, ns, saTmpl string) error
CreateServiceAccountFromYaml creates the ServiceAccount from the yaml template.
func CreateServiceFromYaml ¶
func CreateServiceFromYaml(cliSet kubeclientset.Interface, ns, svcTmpl string) error
CreateServiceFromYaml creates the Service from the yaml template.
func CreateYurtManager ¶
func CreateYurtManager(client kubeclientset.Interface, yurtManagerImage string) error
func DeleteYurthubSetting ¶
func DeleteYurthubSetting(client kubeclientset.Interface) error
DeleteYurthubSetting rm settings for yurthub pod
func DeployYurthubSetting ¶
func DeployYurthubSetting(client kubeclientset.Interface) error
DeployYurthubSetting deploy clusterrole, clusterrolebinding for yurthub static pod.
func GetOrCreateJoinTokenString ¶
func GetOrCreateJoinTokenString(cliSet kubeclientset.Interface) (string, error)
func PrintPodLog ¶
func RunJobAndCleanup ¶
func RunJobAndCleanup(cliSet kubeclientset.Interface, job *batchv1.Job, timeout, period time.Duration, waitForTimeout bool) error
RunJobAndCleanup runs the job, wait for it to be complete, and delete it
func RunServantJobs ¶
func RunServantJobs( cliSet kubeclientset.Interface, waitServantJobTimeout time.Duration, getJob func(nodeName string) (*batchv1.Job, error), nodeNames []string, ww io.Writer, waitForTimeout bool) error
RunServantJobs launch servant jobs on specified nodes and wait all jobs to finish. Succeed jobs will be deleted when finished. Failed jobs are preserved for diagnosis.
func YamlToObject ¶
func YamlToObject(yamlContent []byte) (k8sruntime.Object, error)
YamlToObject deserializes object in yaml format to a runtime.Object