Documentation ¶
Index ¶
- Constants
- func CopyFile(sourceFile string, destinationFile string, perm os.FileMode) error
- func DirExists(dirname string) (bool, error)
- func Exec(cmd *exec.Cmd) error
- func FileExists(filename string) (bool, error)
- func GenClientSet(flags *pflag.FlagSet) (*kubernetes.Clientset, error)
- func GetContentFormFile(filename string, regularExpression string) ([]string, error)
- func GetNodeName(kubeadmConfPath string) (string, error)
- func GetSingleContentFromFile(filename string, regularExpression string) (string, error)
- func PrepareKubeConfigPath(flags *pflag.FlagSet) (string, error)
- func ReplaceRegularExpression(content string, replace map[string]string) string
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 FileExists ¶
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 ¶
GetContentFormFile returns all strings that match the regular expression regularExpression
func GetNodeName ¶
GetNodeName gets the node name based on environment variable, parameters --hostname-override in the configuration file or hostname
func GetSingleContentFromFile ¶
GetSingleContentFromFile determines whether there is a unique string that matches the regular expression regularExpression and returns it
func PrepareKubeConfigPath ¶
PrepareKubeConfigPath returns the path of cluster kubeconfig file
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.