Documentation ¶
Index ¶
- Variables
- func CheckPodReady(name, namespace string, logger logr.Logger) bool
- func CheckPolicyIsReload(policy *GetControllerConfigPolicy) bool
- func CreatePod(pod *v1.Pod, logger logr.Logger) error
- func DeleteConfigmap(cm *corev1.ConfigMap, logger logr.Logger) error
- func DeletePod(name, namespace string, ctx context.Context, logger logr.Logger) error
- func ExecInPod(command []string, containerName, podName, namespace string, logger logr.Logger) (string, string, error)
- func ExecInPodWithTimeout(ctx context.Context, command []string, ...) (string, string, error)
- func GetClientIP(hostIP string, logger logr.Logger) (string, error)
- func GetConfigMap(name, namespace string, logger logr.Logger) (*corev1.ConfigMap, error)
- func GetCorev1Client() (corev1.CoreV1Interface, error)
- func GetDynamicClient(group, version, resource string) (dynamic.NamespaceableResourceInterface, error)
- func GetHostIP(clientIP string, logger logr.Logger) (string, error)
- func GetKubeClient() (*kubernetes.Clientset, *rest.Config, error)
- func GetKubeConfig() (*rest.Config, error)
- func GetNode(nodeName string, logger logr.Logger) (*v1.Node, error)
- func GetNodeCondition(node *corev1.Node, conditionType corev1.NodeConditionType) *corev1.NodeCondition
- func GetNodes(logger logr.Logger) ([]v1.Node, error)
- func GetPod(name, namespace string, logger logr.Logger) (*v1.Pod, error)
- func GetPodContainerInfo(pod *corev1.Pod, logger logr.Logger) string
- func GetPodWatchResourceVersion(name string, namespace string, client corev1client.CoreV1Interface, ...) string
- func GetPodWatcher(pod *corev1.Pod, client corev1client.CoreV1Interface, timeout int64, ...) (watch.Interface, error)
- func GetPodsByLabel(labelStr, namespace string, logger logr.Logger) (*v1.PodList, error)
- func GetService(name string, namespace string, logger logr.Logger) (*corev1.Service, error)
- func GetServiceByLabel(labelStr string, namespace string, logger logr.Logger) (*corev1.ServiceList, error)
- func IsNodeReady(node *v1.Node) bool
- func IsPodSchedulerFailed(cond *corev1.PodCondition) bool
- func SetWatchOption(object metav1.ObjectMeta, timeout int64) *metav1.ListOptions
- func StringOfCondition(condition *corev1.NodeCondition) string
- func StringOfPodCondition(condition *corev1.PodCondition) string
- func UpdateConfigMap(configMap *corev1.ConfigMap) error
- func WaitForContainerReady(pod *corev1.Pod, containerName string, ctx context.Context, logger logr.Logger) (*corev1.Pod, error)
- func WaitForPodDeleted(namespace, name string, ctx context.Context, logger logr.Logger) error
- func WaitForPodReady(pod *corev1.Pod, isNewPod bool, ctx context.Context, logger logr.Logger) (*corev1.Pod, error)
- type ControllerConfig
- type GetControllerConfigPolicy
- type NodeClientIP
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientForTest corev1.CoreV1Interface = nil
Functions ¶
func CheckPolicyIsReload ¶
func CheckPolicyIsReload(policy *GetControllerConfigPolicy) bool
func ExecInPodWithTimeout ¶
func GetClientIP ¶
*
- @Description: 根据主机IP获得客户网络IP地址
- @param hostIP
- @param nodeClientIPList
- @return string
func GetConfigMap ¶
func GetCorev1Client ¶
func GetCorev1Client() (corev1.CoreV1Interface, error)
func GetDynamicClient ¶
func GetDynamicClient(group, version, resource string) (dynamic.NamespaceableResourceInterface, error)
GetDynamicClient ...
func GetHostIP ¶
*
- @Description: 根据ClientIP获取HostIP
- @param hostIP
- @param nodeClientIPList
- @return string
func GetKubeClient ¶
func GetKubeClient() (*kubernetes.Clientset, *rest.Config, error)
GetKubeClient ...
func GetNodeCondition ¶
func GetNodeCondition(node *corev1.Node, conditionType corev1.NodeConditionType) *corev1.NodeCondition
func GetPodWatchResourceVersion ¶
func GetPodWatchResourceVersion(name string, namespace string, client corev1client.CoreV1Interface, logger logr.Logger) string
func GetPodWatcher ¶
func GetPodWatcher(pod *corev1.Pod, client corev1client.CoreV1Interface, timeout int64, logger logr.Logger) (watch.Interface, error)
func GetPodsByLabel ¶
func GetService ¶
func GetServiceByLabel ¶
func IsNodeReady ¶
func IsPodSchedulerFailed ¶
func IsPodSchedulerFailed(cond *corev1.PodCondition) bool
func SetWatchOption ¶
func SetWatchOption(object metav1.ObjectMeta, timeout int64) *metav1.ListOptions
func StringOfCondition ¶
func StringOfCondition(condition *corev1.NodeCondition) string
func StringOfPodCondition ¶
func StringOfPodCondition(condition *corev1.PodCondition) string
func UpdateConfigMap ¶
func WaitForContainerReady ¶
func WaitForPodDeleted ¶
Types ¶
type ControllerConfig ¶
type ControllerConfig struct { DisableSanCmd bool HybridDeployment bool CmHybridDeployment bool CanUpdateNotChangeableParams bool // 是否可以更新不可变参数 CowSnapshotSupport bool EnableOnlinePromote bool EnableVip bool EnablePodGc bool EnableCheckSum bool EnableDegrade bool EnableRedline bool DegradeDaemonSet []string DegradeDeployment []string DisabledWfEvents []string SshUser string SshPassword string ControllerNodeLabel string }
func GetControllerConfig ¶
func GetControllerConfig(logger logr.Logger) (*ControllerConfig, error)
func GetControllerConfigWithPolicy ¶
func GetControllerConfigWithPolicy(policy *GetControllerConfigPolicy, logger logr.Logger) (*ControllerConfig, error)
type GetControllerConfigPolicy ¶
type GetControllerConfigPolicy struct { IsInited bool LastQueryTime *time.Time MaxQueryStepTime *time.Duration //如果值为0表示只读一次,此值设置原则上不允许修改,否则会逻辑错乱 LastValue *ControllerConfig //最后一次结果暂存器 }
var ControllerConfigPolicy *GetControllerConfigPolicy
type NodeClientIP ¶
func GetNodeClientIPList ¶
func GetNodeClientIPList(logger logr.Logger) ([]*NodeClientIP, error)
*
- @Description: 获得所有节点的客户网络IP
- @return []*NodeClientIP
- @return error
Click to show internal directories.
Click to hide internal directories.