Documentation
¶
Index ¶
- func AuthService() *authService
- func CacheService() *cacheService
- func ClusterService() *clusterService
- func ConfigService() *configService
- func DeploymentService() *deployService
- func IngressClassService() *ingressClassService
- func IngressService() *ingressService
- func LeaderService() *leaderService
- func NewConfigService() *configService
- func NewOperationLogService() *operationLogService
- func NodeService() *nodeService
- func OperationLogService() *operationLogService
- func PVCService() *pvcService
- func PVService() *pvService
- func PodService() *podService
- func SSOConfigService() *ssoConfigService
- func ShellLogService() *shellLogService
- func StorageClassService() *storageClassService
- func UserService() *userService
- type ClusterConfig
- func (c *ClusterConfig) GetCertificateExpiry() time.Time
- func (c *ClusterConfig) GetClusterID() string
- func (c *ClusterConfig) GetClusterScanResult() *analysis.ResultWithStatus
- func (c *ClusterConfig) GetClusterWatchStatus(watchType string) bool
- func (c *ClusterConfig) GetKubeconfig() string
- func (c *ClusterConfig) GetRestConfig() *rest.Config
- func (c *ClusterConfig) SetClusterScanStatus(result *analysis.ResultWithStatus)
- func (c *ClusterConfig) SetClusterWatchStarted(watchType string, watcher watch.Interface)
- type ClusterConfigSource
- type HeartbeatRecord
- type NodeLabels
- type PodLabels
- type StatusCount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthService ¶ added in v0.26.1
func AuthService() *authService
func CacheService ¶ added in v0.0.117
func CacheService() *cacheService
func ClusterService ¶ added in v0.0.19
func ClusterService() *clusterService
func ConfigService ¶ added in v0.0.74
func ConfigService() *configService
func DeploymentService ¶ added in v0.0.9
func DeploymentService() *deployService
func IngressClassService ¶ added in v0.0.47
func IngressClassService() *ingressClassService
func IngressService ¶ added in v0.0.47
func IngressService() *ingressService
func LeaderService ¶ added in v0.26.1
func LeaderService() *leaderService
LeaderService 中文函数注释:获取 Leader 服务实例。
func NewConfigService ¶ added in v0.0.74
func NewConfigService() *configService
func NewOperationLogService ¶ added in v0.0.78
func NewOperationLogService() *operationLogService
func NodeService ¶ added in v0.0.9
func NodeService() *nodeService
func OperationLogService ¶ added in v0.0.47
func OperationLogService() *operationLogService
func PVCService ¶ added in v0.0.31
func PVCService() *pvcService
func PodService ¶ added in v0.0.2
func PodService() *podService
func SSOConfigService ¶ added in v0.0.92
func SSOConfigService() *ssoConfigService
SSOConfigService 获取SSO配置服务实例
func ShellLogService ¶ added in v0.0.47
func ShellLogService() *shellLogService
func StorageClassService ¶ added in v0.0.30
func StorageClassService() *storageClassService
func UserService ¶ added in v0.0.47
func UserService() *userService
Types ¶
type ClusterConfig ¶ added in v0.0.19
type ClusterConfig struct {
ClusterID string `json:"cluster_id,omitempty"` // 自动生成,不要赋值
ClusterMD string `json:"cluster_md,omitempty"` // 自动生成,不要赋值
FileName string `json:"fileName,omitempty"` // kubeconfig 文件名称
ContextName string `json:"contextName,omitempty"` // context名称
ClusterName string `json:"clusterName,omitempty"` // 集群名称
Server string `json:"server,omitempty"` // 集群地址
ServerVersion string `json:"serverVersion,omitempty"` // 通过这个值来判断集群是否可用
HeartbeatHistory []HeartbeatRecord `json:"heartbeat_history,omitempty"`
HeartbeatMu sync.RWMutex // 保护HeartbeatHistory的读写锁
UserName string `json:"userName,omitempty"` // 用户名
Namespace string `json:"namespace,omitempty"` // kubeconfig 限制Namespace
Err string `json:"err,omitempty"` // 连接错误信息
NodeStatusAggregated bool `json:"nodeStatusAggregated,omitempty"` // 是否已聚合节点状态
PodStatusAggregated bool `json:"podStatusAggregated,omitempty"` // 是否已聚合容器组状态
PVCStatusAggregated bool `json:"pvcStatusAggregated,omitempty"` // 是否已聚合pcv状态
PVStatusAggregated bool `json:"pvStatusAggregated,omitempty"` // 是否已聚合pv状态
IngressStatusAggregated bool `json:"ingressStatusAggregated,omitempty"` // 是否已聚合ingress状态
ClusterConnectStatus constants.ClusterConnectStatus `json:"clusterConnectStatus,omitempty"` // 集群连接状态
IsInCluster bool `json:"isInCluster,omitempty"` // 是否为集群内运行获取到的配置
Source ClusterConfigSource `json:"source,omitempty"` // 配置文件来源
K8sGPTProblemsCount int `json:"k8s_gpt_problems_count,omitempty"` // k8sGPT 扫描结果
K8sGPTProblemsResult *analysis.ResultWithStatus `json:"k8s_gpt_problems,omitempty"` // k8sGPT 扫描结果
NotAfter *time.Time `json:"not_after,omitempty"`
AWSConfig *komaws.EKSAuthConfig `json:"aws_config,omitempty"` // AWS EKS配置信息
IsAWSEKS bool `json:"is_aws_eks,omitempty"` // 标识是否为AWS EKS集群
// kom 集群注册配置项
DBID uint `json:"id,omitempty"` // 数据库ID
ProxyURL string `json:"proxy_url,omitempty"` // HTTP 代理,例如 http://127.0.0.1:7890
Timeout int `json:"timeout,omitempty"` // 请求超时时间,单位为秒,默认为 30 秒
QPS float32 `json:"qps,omitempty"` // 每秒查询数限制,默认为 200
Burst int `json:"burst,omitempty"` // 突发请求数限制,默认为 2000
// contains filtered or unexported fields
}
func (*ClusterConfig) GetCertificateExpiry ¶ added in v0.0.136
func (c *ClusterConfig) GetCertificateExpiry() time.Time
GetCertificateExpiry 获取集群证书的过期时间
func (*ClusterConfig) GetClusterID ¶ added in v0.0.31
func (c *ClusterConfig) GetClusterID() string
GetClusterID 根据ClusterConfig,按照 文件名+context名称 获取clusterID
func (*ClusterConfig) GetClusterScanResult ¶ added in v0.0.67
func (c *ClusterConfig) GetClusterScanResult() *analysis.ResultWithStatus
func (*ClusterConfig) GetClusterWatchStatus ¶ added in v0.0.30
func (c *ClusterConfig) GetClusterWatchStatus(watchType string) bool
GetClusterWatchStatus 获取集群Watch状态
func (*ClusterConfig) GetKubeconfig ¶ added in v0.0.44
func (c *ClusterConfig) GetKubeconfig() string
func (*ClusterConfig) GetRestConfig ¶ added in v0.0.51
func (c *ClusterConfig) GetRestConfig() *rest.Config
func (*ClusterConfig) SetClusterScanStatus ¶ added in v0.0.56
func (c *ClusterConfig) SetClusterScanStatus(result *analysis.ResultWithStatus)
func (*ClusterConfig) SetClusterWatchStarted ¶ added in v0.0.30
func (c *ClusterConfig) SetClusterWatchStarted(watchType string, watcher watch.Interface)
SetClusterWatchStarted 设置集群Watch启动状态
type ClusterConfigSource ¶ added in v0.0.48
type ClusterConfigSource string
var ClusterConfigSourceAWS ClusterConfigSource = "AWS"
var ClusterConfigSourceDB ClusterConfigSource = "DB"
var ClusterConfigSourceFile ClusterConfigSource = "File"
var ClusterConfigSourceInCluster ClusterConfigSource = "InCluster"
type HeartbeatRecord ¶ added in v0.0.182
type HeartbeatRecord struct {
Index int `json:"index"`
Success bool `json:"success"`
Time string `json:"time"`
}
HeartbeatRecord 心跳结果记录条目 中文说明:index 为在当前窗口中的位置(1..N),success 表示本次心跳是否成功,time 为发生时间(本地时区)
type NodeLabels ¶ added in v0.0.49
type NodeLabels struct {
ClusterName string // 集群名称
NodeName string // 节点名称
Labels map[string]string // 标签
}
NodeLabels 定义结构体,
type PodLabels ¶ added in v0.0.49
type PodLabels struct {
ClusterName string // 集群名称
Namespace string // 命名空间
PodName string // Pod名称
Labels map[string]string // 标签
}
PodLabels 定义结构体,用于存储Pod的标签信息
type StatusCount ¶ added in v0.0.38
type StatusCount struct {
ClusterName string // 集群名称
Namespace string
PodCount int // 数量
CPURequest float64 // cpu请求量
CPULimit float64 // cpu上限量
CPURealtime float64 // cpu实时量
MemoryRequest float64 // 内存请求量
MemoryLimit float64 // 内存上限量
MemoryRealtime float64 // 内存实时量
}
StatusCount 定义结构体,以namespace为key进行统计,累计所有的pod数量,以及cpu、内存用量
Click to show internal directories.
Click to hide internal directories.