Documentation
¶
Overview ¶
Package k8s is using for the k8s operation.
Package k8s is using for the k8s operation.
Package k8s is using for the k8s operation.
Package k8s is using for the k8s operation.
Package k8s is using for the k8s operation.
Package k8s is using for the k8s operation.
Index ¶
- func CheckConfigMapIsDeviceInfo(cm *v1.ConfigMap) bool
- func CheckConfigMapIsNodeInfo(cm *v1.ConfigMap) bool
- func CreateOrUpdateConfigMap(k8s kubernetes.Interface, cm *v1.ConfigMap, cmName, nameSpace string) error
- func FakeDeviceInfoCMDataByNode(nodeName string, deviceList map[string]string) *v1.ConfigMap
- func FakeDeviceList() map[string]string
- func FakeNodeInfos() map[string]string
- func FakeSwitchInfos() string
- func GetConfigMap(client kubernetes.Interface, namespace, cmName string) (*v1.ConfigMap, error)
- func GetConfigMapWithRetry(client kubernetes.Interface, namespace, cmName string) (*v1.ConfigMap, error)
- func GetDeviceInfosAndSetInformerStart(nodeList []*api.NodeInfo, useClusterD bool) map[string]NodeDeviceInfoWithID
- func GetNodeDInfos(nodeList []*api.NodeInfo) map[string]NodeDNodeInfo
- func GetSwitchInfos(nodeList []*api.NodeInfo) map[string]SwitchFaultInfo
- func GetTorNodeWithOneMinuteDelay(client kubernetes.Interface, namespace, cmName string) (*v1.ConfigMap, error)
- func InformerConfigmapFilter(obj interface{}) bool
- func InitCmInformer(k8sClient kubernetes.Interface, useClusterD bool)
- func IsConfigMapChanged(k8s kubernetes.Interface, cm *v1.ConfigMap, cmName, nameSpace string) bool
- func UpdateConfigmapIncrementally(kubeClient kubernetes.Interface, ns, name string, newData map[string]string) (map[string]string, error)
- type ClusterInfoWitchCm
- type DeviceInfosWithMutex
- type NodeDNodeInfo
- type NodeDeviceInfo
- type NodeDeviceInfoWithDevPlugin
- type NodeDeviceInfoWithID
- type NodeInfoWithNodeD
- type NodeInfosFromCmWithMutex
- type SwitchFaultInfo
- type SwitchInfosFromCmWithMutex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckConfigMapIsDeviceInfo ¶
CheckConfigMapIsDeviceInfo check configmap is device info
func CheckConfigMapIsNodeInfo ¶
CheckConfigMapIsNodeInfo check whether the configmap is kube-system/node-info-
func CreateOrUpdateConfigMap ¶
func CreateOrUpdateConfigMap(k8s kubernetes.Interface, cm *v1.ConfigMap, cmName, nameSpace string) error
CreateOrUpdateConfigMap Create or update configMap.
func FakeDeviceInfoCMDataByNode ¶
FakeDeviceInfoCMDataByNode fake device info cm data
func GetConfigMap ¶
GetConfigMap Get config map from k8s.
func GetConfigMapWithRetry ¶
func GetConfigMapWithRetry(client kubernetes.Interface, namespace, cmName string) (*v1.ConfigMap, error)
GetConfigMapWithRetry Get config map from k8s.
func GetDeviceInfosAndSetInformerStart ¶
func GetDeviceInfosAndSetInformerStart(nodeList []*api.NodeInfo, useClusterD bool) map[string]NodeDeviceInfoWithID
GetDeviceInfosAndSetInformerStart get device Infos and check Informer health state
func GetNodeDInfos ¶
func GetNodeDInfos(nodeList []*api.NodeInfo) map[string]NodeDNodeInfo
GetNodeDInfos is to get a copy of nodeInfo which is get from configmap of nodeD
func GetSwitchInfos ¶
func GetSwitchInfos(nodeList []*api.NodeInfo) map[string]SwitchFaultInfo
GetSwitchInfos is to get a copy of switchInfo which is get from configmap of switch info
func GetTorNodeWithOneMinuteDelay ¶
func GetTorNodeWithOneMinuteDelay(client kubernetes.Interface, namespace, cmName string) (*v1.ConfigMap, error)
GetTorNodeWithOneMinuteDelay get tor node configMap with one-minute delay
func InformerConfigmapFilter ¶
func InformerConfigmapFilter(obj interface{}) bool
InformerConfigmapFilter is used to filter out cm need to be listened for ascend plugin
func InitCmInformer ¶
func InitCmInformer(k8sClient kubernetes.Interface, useClusterD bool)
InitCmInformer init cm informer, support cluster info manager and device plugin
func IsConfigMapChanged ¶
IsConfigMapChanged judge the cm wither is same. true is no change.
func UpdateConfigmapIncrementally ¶
func UpdateConfigmapIncrementally(kubeClient kubernetes.Interface, ns, name string, newData map[string]string) (map[string]string, error)
UpdateConfigmapIncrementally update configmap Map data but keep the key value pair that new data does not have
Types ¶
type ClusterInfoWitchCm ¶
type ClusterInfoWitchCm struct {
// contains filtered or unexported fields
}
ClusterInfoWitchCm cluster info whit different configmap
func NewClusterInfoWitchCm ¶
func NewClusterInfoWitchCm() ClusterInfoWitchCm
NewClusterInfoWitchCm new empty cluster info with cm
type DeviceInfosWithMutex ¶
type DeviceInfosWithMutex struct {
sync.Mutex
Devices map[string]NodeDeviceInfoWithID
}
DeviceInfosWithMutex information for the current plugin
type NodeDNodeInfo ¶
type NodeDNodeInfo struct {
FaultDevList []struct {
DeviceType string
DeviceId int
FaultCode []string
FaultLevel string
}
NodeStatus string
}
NodeDNodeInfo is node the information reported by noded
type NodeDeviceInfo ¶
NodeDeviceInfo like node annotation.
type NodeDeviceInfoWithDevPlugin ¶
type NodeDeviceInfoWithDevPlugin struct {
DeviceInfo NodeDeviceInfo
CheckCode string
SuperPodID int32 `json:"SuperPodID,omitempty"`
ServerIndex int32 `json:"ServerIndex,omitempty"`
}
NodeDeviceInfoWithDevPlugin a node has one by cm.
type NodeDeviceInfoWithID ¶
type NodeDeviceInfoWithID struct {
NodeDeviceInfo
CacheUpdateTime int64
SuperPodID int32
}
NodeDeviceInfoWithID is node the information reported by cm.
type NodeInfoWithNodeD ¶
type NodeInfoWithNodeD struct {
NodeInfo NodeDNodeInfo
CheckCode string
}
NodeInfoWithNodeD is node the node information and checkCode reported by noded
type NodeInfosFromCmWithMutex ¶
type NodeInfosFromCmWithMutex struct {
sync.Mutex
Nodes map[string]NodeDNodeInfo
}
NodeInfosFromCmWithMutex node info with mutex
type SwitchFaultInfo ¶
type SwitchFaultInfo struct {
FaultCode []string
FaultLevel string
UpdateTime int64
NodeStatus string
}
SwitchFaultInfo Switch Fault Info
type SwitchInfosFromCmWithMutex ¶
type SwitchInfosFromCmWithMutex struct {
sync.Mutex
Switches map[string]SwitchFaultInfo
}
SwitchInfosFromCmWithMutex SwitchInfos From Cm WithMutex