edgenode

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeletSvcPath   = "/etc/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 = `` /* 1380-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func CopyFile

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

CopyFile copys sourceFile to destinationFile

func DirExists

func DirExists(dirname string) (bool, error)

DirExists determines whether the directory exists

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 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 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