Documentation ¶
Index ¶
- Constants
- Variables
- func CordonUnCordon(k8sClient *kubernetes.Clientset, nodeName string, cordoned bool) error
- func EvictNodePods(nodeName string, k8sClient *kubernetes.Clientset) error
- func EvictPod(k8sClient *kubernetes.Clientset, pod v1.Pod, policyGroupVersion string) error
- func GetNodeByName(k8sClient *kubernetes.Clientset, nodeName string) (node *v1.Node, err error)
- func GetNodeIPByLabel(k8sClient *kubernetes.Clientset, label string) ([]string, error)
- func GetNodeIPByName(k8sClient *kubernetes.Clientset, nodeName string) (ip string, err error)
- func GetNodeList(k8sClient *kubernetes.Clientset) (*v1.NodeList, error)
- func GetNodeListByLabel(k8sClient *kubernetes.Clientset, label string) (*v1.NodeList, error)
- func IsIpv4(ip string) bool
- func IsNodeReady(node v1.Node) bool
- func NewClient(kubeConfigPath string, k8sWrapTransport transport.WrapperFunc) (*kubernetes.Clientset, error)
- func TransToIP(k8sClient *kubernetes.Clientset, label string, hostname []string) ([]string, error)
Constants ¶
View Source
const ( EvictionKind = "Eviction" PolicyGroupVersion = "policy/v1beta1" )
View Source
const ( HostnameLabel = "kubernetes.io/hostname" NodeRoleLabel = "node-role.kubernetes.io/master" MaxRetries = 5 RetryInterval = 5 WrapTransportTimeout = 30 )
Variables ¶
View Source
var (
KubeDefaultConfigPath = getUserHome() + "/.supkube/admin.conf"
)
Functions ¶
func CordonUnCordon ¶
func CordonUnCordon(k8sClient *kubernetes.Clientset, nodeName string, cordoned bool) error
func EvictNodePods ¶
func EvictNodePods(nodeName string, k8sClient *kubernetes.Clientset) error
func GetNodeByName ¶
GetNodeByName is get node internalIp by nodeName
func GetNodeIPByLabel ¶
func GetNodeIPByLabel(k8sClient *kubernetes.Clientset, label string) ([]string, error)
GetNodeIPByLabel is is get node ip by label
func GetNodeIPByName ¶
func GetNodeIPByName(k8sClient *kubernetes.Clientset, nodeName string) (ip string, err error)
GetNodeIPByName is get node internalIp by nodeName
func GetNodeList ¶
func GetNodeList(k8sClient *kubernetes.Clientset) (*v1.NodeList, error)
GetNodeList is get all nodes
func GetNodeListByLabel ¶
GetNodeListByLabel is get node list by label
func NewClient ¶
func NewClient(kubeConfigPath string, k8sWrapTransport transport.WrapperFunc) (*kubernetes.Clientset, error)
NewClient is get clientSet by kubeConfig
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.