kubernetes

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemNamespace = "kube-system"
	// DefaultWaitServantJobTimeout specifies the timeout value of waiting for the ServantJob to be succeeded
	DefaultWaitServantJobTimeout = time.Minute * 5
)

Variables

View Source
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 AddEdgeWorkerLabelAndAutonomyAnnotation added in v0.7.0

func AddEdgeWorkerLabelAndAutonomyAnnotation(cliSet *kubernetes.Clientset, node *corev1.Node, lVal, aVal string) (*corev1.Node, error)

func AnnotateNode

func AnnotateNode(cliSet *kubernetes.Clientset, node *corev1.Node, key, val string) (*corev1.Node, error)

AnnotateNode add a new annotation (<key>=<val>) to the given node

func CreateCRDFromYaml added in v0.4.1

func CreateCRDFromYaml(clientset *kubernetes.Clientset, yurtAppManagerClient dynamic.Interface, nameSpace string, filebytes []byte) error

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, ns, 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, ns, 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 DeleteYurthubSetting added in v0.5.0

func DeleteYurthubSetting(client *kubernetes.Clientset) error

DeleteYurthubSetting rm settings for yurthub pod

func DeployYurtAppManager added in v0.5.0

func DeployYurtAppManager(
	client *kubernetes.Clientset,
	yurtappmanagerImage string,
	yurtAppManagerClient dynamic.Interface,
	systemArchitecture string) error

func DeployYurtControllerManager added in v0.5.0

func DeployYurtControllerManager(client *kubernetes.Clientset, yurtControllerManagerImage string) error

func DeployYurthubSetting added in v0.5.0

func DeployYurthubSetting(client *kubernetes.Clientset) error

DeployYurthubSetting deploy clusterrole, clusterrolebinding for yurthub static pod.

func DeployYurttunnelAgent added in v0.5.0

func DeployYurttunnelAgent(
	client *kubernetes.Clientset,
	tunnelServerAddress string,
	yurttunnelAgentImage string) error

func DeployYurttunnelServer added in v0.5.0

func DeployYurttunnelServer(
	client *kubernetes.Clientset,
	certIP string,
	yurttunnelServerImage string,
	systemArchitecture string) error

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 GetOrCreateJoinTokenString

func GetOrCreateJoinTokenString(cliSet *kubernetes.Clientset) (string, error)

func PrepareKubeConfigPath

func PrepareKubeConfigPath(flags *pflag.FlagSet) (string, error)

PrepareKubeConfigPath returns the path of cluster kubeconfig file

func RunJobAndCleanup

func RunJobAndCleanup(cliSet *kubernetes.Clientset, 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 *kubernetes.Clientset,
	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

Types

This section is empty.

Jump to

Keyboard shortcuts

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