Documentation ¶
Index ¶
- Constants
- Variables
- func AnnotateNode(cliSet *kubernetes.Clientset, node *v1.Node, key, val string) (*v1.Node, error)
- func CreateCRDFromYaml(clientset *kubernetes.Clientset, yurtAppManagerClient dynamic.Interface, ...) error
- func CreateClusterRoleBindingFromYaml(cliSet *kubernetes.Clientset, crbTmpl string) error
- func CreateClusterRoleFromYaml(cliSet *kubernetes.Clientset, crTmpl string) error
- func CreateConfigMapFromYaml(cliSet *kubernetes.Clientset, ns, cmTmpl string) error
- func CreateDaemonSetFromYaml(cliSet *kubernetes.Clientset, dsTmpl string, ctx interface{}) error
- func CreateDeployFromYaml(cliSet *kubernetes.Clientset, ns, dplyTmpl string, ctx interface{}) error
- func CreateMutatingWebhookConfigurationFromYaml(cliSet *kubernetes.Clientset, svcTmpl string) error
- func CreateRoleBindingFromYaml(cliSet *kubernetes.Clientset, ns, crbTmpl string) error
- func CreateRoleFromYaml(cliSet *kubernetes.Clientset, ns, crTmpl string) error
- func CreateSecretFromYaml(cliSet *kubernetes.Clientset, ns, saTmpl string) error
- func CreateServiceAccountFromYaml(cliSet *kubernetes.Clientset, ns, saTmpl string) error
- func CreateServiceFromYaml(cliSet *kubernetes.Clientset, svcTmpl string) error
- func CreateValidatingWebhookConfigurationFromYaml(cliSet *kubernetes.Clientset, svcTmpl string) error
- func GenClientSet(flags *pflag.FlagSet) (*kubernetes.Clientset, error)
- func GenDynamicClientSet(flags *pflag.FlagSet) (dynamic.Interface, error)
- func GetKubeControllerManagerHANodes(cliSet *kubernetes.Clientset) ([]string, error)
- func GetOrCreateJoinTokenString(cliSet *kubernetes.Clientset) (string, error)
- func LabelNode(cliSet *kubernetes.Clientset, node *v1.Node, key, val string) (*v1.Node, error)
- func PrepareKubeConfigPath(flags *pflag.FlagSet) (string, error)
- func RunJobAndCleanup(cliSet *kubernetes.Clientset, job *batchv1.Job, timeout, period time.Duration) error
- func RunServantJobs(cliSet *kubernetes.Clientset, tmplCtx map[string]string, ...) error
- func ValidateServerVersion(cliSet *kubernetes.Clientset) error
- func YamlToObject(yamlContent []byte) (runtime.Object, error)
Constants ¶
const ( // ConvertJobNameBase is the prefix of the convert ServantJob name ConvertJobNameBase = "yurtctl-servant-convert" // RevertJobNameBase is the prefix of the revert ServantJob name RevertJobNameBase = "yurtctl-servant-revert" // DisableNodeControllerJobNameBase is the prefix of the DisableNodeControllerJob name DisableNodeControllerJobNameBase = "yurtctl-disable-node-controller" // EnableNodeControllerJobNameBase is the prefix of the EnableNodeControllerJob name EnableNodeControllerJobNameBase = "yurtctl-enable-node-controller" )
Variables ¶
var ( // PropagationPolicy defines the propagation policy used when deleting a resource PropagationPolicy = metav1.DeletePropagationBackground // WaitServantJobTimeout specifies the timeout value of waiting for the ServantJob to be succeeded WaitServantJobTimeout = time.Minute * 2 // CheckServantJobPeriod defines the time interval between two successive ServantJob statu's inspection CheckServantJobPeriod = time.Second * 10 // ValidServerVersions contains all compatible server version // yurtctl only support Kubernetes 1.12+ - 1.16+ for now ValidServerVersions = []string{ "1.12", "1.12+", "1.13", "1.13+", "1.14", "1.14+", "1.16", "1.16+", "1.18", "1.18+", "1.20", "1.20+"} )
Functions ¶
func AnnotateNode ¶
AnnotateNode add a new annotation (<key>=<val>) to the given node
func CreateCRDFromYaml ¶ added in v0.4.1
func CreateClusterRoleBindingFromYaml ¶
func CreateClusterRoleBindingFromYaml(cliSet *kubernetes.Clientset, crbTmpl string) error
CreateClusterRoleBindingFromYaml creates the ClusterRoleBinding from the yaml template.
func CreateClusterRoleFromYaml ¶
func CreateClusterRoleFromYaml(cliSet *kubernetes.Clientset, crTmpl string) error
CreateClusterRoleFromYaml creates the ClusterRole from the yaml template.
func CreateConfigMapFromYaml ¶
func CreateConfigMapFromYaml(cliSet *kubernetes.Clientset, ns, cmTmpl string) error
CreateConfigMapFromYaml creates the ConfigMap from the yaml template.
func CreateDaemonSetFromYaml ¶
func CreateDaemonSetFromYaml(cliSet *kubernetes.Clientset, dsTmpl string, ctx interface{}) error
CreateDaemonSetFromYaml creates the DaemonSet from the yaml template.
func CreateDeployFromYaml ¶
func CreateDeployFromYaml(cliSet *kubernetes.Clientset, ns, dplyTmpl string, ctx interface{}) error
CreateDeployFromYaml creates the Deployment from the yaml template.
func CreateMutatingWebhookConfigurationFromYaml ¶ added in v0.4.1
func CreateMutatingWebhookConfigurationFromYaml(cliSet *kubernetes.Clientset, svcTmpl string) error
CreateMutatingWebhookConfigurationFromYaml creates the Service from the yaml template.
func CreateRoleBindingFromYaml ¶ added in v0.4.1
func CreateRoleBindingFromYaml(cliSet *kubernetes.Clientset, ns, crbTmpl string) error
CreateRoleBindingFromYaml creates the ClusterRoleBinding from the yaml template.
func CreateRoleFromYaml ¶ added in v0.4.1
func CreateRoleFromYaml(cliSet *kubernetes.Clientset, ns, crTmpl string) error
add by yanyhui at 20210611 CreateRoleFromYaml creates the ClusterRole from the yaml template.
func CreateSecretFromYaml ¶ added in v0.4.1
func CreateSecretFromYaml(cliSet *kubernetes.Clientset, ns, saTmpl string) error
CreateSecretFromYaml creates the Secret from the yaml template.
func CreateServiceAccountFromYaml ¶
func CreateServiceAccountFromYaml(cliSet *kubernetes.Clientset, ns, saTmpl string) error
CreateServiceAccountFromYaml creates the ServiceAccount from the yaml template.
func CreateServiceFromYaml ¶
func CreateServiceFromYaml(cliSet *kubernetes.Clientset, svcTmpl string) error
CreateServiceFromYaml creates the Service from the yaml template.
func CreateValidatingWebhookConfigurationFromYaml ¶ added in v0.4.1
func CreateValidatingWebhookConfigurationFromYaml(cliSet *kubernetes.Clientset, svcTmpl string) error
CreateValidatingWebhookConfigurationFromYaml creates the Service from the yaml template.
func GenClientSet ¶
func GenClientSet(flags *pflag.FlagSet) (*kubernetes.Clientset, error)
GenClientSet generates the clientset based on command option, environment variable or the default kubeconfig file
func GenDynamicClientSet ¶ added in v0.4.1
GenDynamicClientSet generates the clientset based on command option, environment variable or the default kubeconfig file
func GetKubeControllerManagerHANodes ¶ added in v0.4.1
func GetKubeControllerManagerHANodes(cliSet *kubernetes.Clientset) ([]string, error)
find kube-controller-manager deployed through static file
func GetOrCreateJoinTokenString ¶
func GetOrCreateJoinTokenString(cliSet *kubernetes.Clientset) (string, error)
func PrepareKubeConfigPath ¶
PrepareKubeConfigPath returns the path of cluster kubeconfig file
func RunJobAndCleanup ¶
func RunJobAndCleanup(cliSet *kubernetes.Clientset, job *batchv1.Job, timeout, period time.Duration) error
RunJobAndCleanup runs the job, wait for it to be complete, and delete it
func RunServantJobs ¶
func RunServantJobs(cliSet *kubernetes.Clientset, tmplCtx map[string]string, edgeNodeNames []string) error
RunServantJobs launch servant jobs on specified edge nodes
func ValidateServerVersion ¶
func ValidateServerVersion(cliSet *kubernetes.Clientset) error
ValidateServerVersion checks if the target server's version is supported
Types ¶
This section is empty.