edgenode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeletSvcPath   = "/usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf"
	OpenyurtDir      = "/var/lib/openyurt"
	StaticPodPath    = "/etc/kubernetes/manifests"
	KubeCondfigPath  = "/etc/kubernetes/kubelet.conf"
	KubeCaFile       = "/etc/kubernetes/pki/ca.crt"
	YurthubYamlName  = "yurt-hub.yaml"
	KubeletConfName  = "kubelet.conf"
	KubeletSvcBackup = "%s.bk"

	Hostname               = "/etc/hostname"
	KubeletHostname        = "--hostname-override=[^\"\\s]*"
	KubeletEnvironmentFile = "EnvironmentFile=.*"

	DaemonReload      = "systemctl daemon-reload"
	RestartKubeletSvc = "systemctl restart kubelet"

	ServerHealthzServer  = "127.0.0.1:10267"
	ServerHealthzURLPath = "/v1/healthz"
	OpenyurtKubeletConf  = `` /* 278-byte string literal not displayed */

	YurthubTemplate = `` /* 1677-byte string literal not displayed */

)
View Source
const (
	NODE_NAME     = "NODE_NAME"
	KUBECONFIG    = "KUBECONFIG"
	NodeNameSplit = "="
)

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(sourceFile string, destinationFile string, perm os.FileMode) error

CopyFile copys sourceFile to destinationFile

func EnsureDir

func EnsureDir(dirname string) error

EnsureDir make sure dir is exists, if not create

func Exec

func Exec(cmd *exec.Cmd) error

Exec execs the command

func FileExists

func FileExists(filename string) (bool, error)

FileExists determines whether the file exists

func GenClientSet

func GenClientSet(flags *pflag.FlagSet) (*kubernetes.Clientset, error)

GenClientSet generates the clientset based on command option, environment variable, file in $HOME/.kube or the default kubeconfig file

func GetContentFormFile

func GetContentFormFile(filename string, regularExpression string) ([]string, error)

GetContentFormFile returns all strings that match the regular expression regularExpression

func GetHostname added in v1.0.0

func GetHostname(hostnameOverride string) (string, error)

func GetNodeName

func GetNodeName(kubeadmConfPath string) (string, error)

GetNodeName gets the node name based on environment variable, parameters --hostname-override in the configuration file or hostname

func GetPodManifestPath

func GetPodManifestPath() string

GetPodManifestPath return podManifestPath, use default value of kubeadm/minikube/kind. etc.

func GetSingleContentFromFile

func GetSingleContentFromFile(filename string, regularExpression string) (string, error)

GetSingleContentFromFile determines whether there is a unique string that matches the regular expression regularExpression and returns it

func PrepareKubeConfigPath

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

PrepareKubeConfigPath returns the path of cluster kubeconfig file

func ReplaceRegularExpression

func ReplaceRegularExpression(content string, replace map[string]string) string

ReplaceRegularExpression matchs the regular expression and replace it with the corresponding string

Types

This section is empty.

Jump to

Keyboard shortcuts

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