-
Notifications
You must be signed in to change notification settings - Fork 165
/
Copy pathzedkubetypes.go
83 lines (71 loc) · 3.13 KB
/
zedkubetypes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright (c) 2024 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
package types
import "time"
// KubeNodeStatus - Enum for the status of a Kubernetes node
type KubeNodeStatus int8
const (
KubeNodeStatusUnknown KubeNodeStatus = iota // KubeNodeStatusUnknown - Node status is unknown
KubeNodeStatusReady // KubeNodeStatusReady - Node is in ready status
KubeNodeStatusNotReady // KubeNodeStatusNotReady - Node is in not ready status
KubeNodeStatusNotReachable // KubeNodeStatusNotReachable - Node is not reachable
)
// KubeNodeInfo - Information about a Kubernetes node
type KubeNodeInfo struct {
Name string
Status KubeNodeStatus
IsMaster bool
UsesEtcd bool
CreationTime time.Time
LastTransitionTime time.Time
KubeletVersion string
InternalIP string
ExternalIP string
Schedulable bool
}
// KubePodStatus - Enum for the status of a Kubernetes pod
type KubePodStatus int8
const (
KubePodStatusUnknown KubePodStatus = iota // KubePodStatusUnknown - Pod status is unknown
KubePodStatusPending // KubePodStatusPending - Pod is in pending status
KubePodStatusRunning // KubePodStatusRunning - Pod is in running status
KubePodStatusSucceeded // KubePodStatusSucceeded - Pod is in succeeded status
KubePodStatusFailed // KubePodStatusFailed - Pod is in failed status
)
// KubePodInfo - Information about a Kubernetes pod
type KubePodInfo struct {
Name string
Status KubePodStatus
RestartCount int32
RestartTimestamp time.Time
CreationTimestamp time.Time
PodIP string
NodeName string
}
// KubeVMIStatus - Enum for the status of a VirtualMachineInstance
type KubeVMIStatus int8
const (
KubeVMIStatusUnset KubeVMIStatus = iota // KubeVMIStatusUnset - UnSet VMI status
KubeVMIStatusPending // KubeVMIStatusPending - VMI in pending status
KubeVMIStatusScheduling // KubeVMIStatusScheduling - VMI in Scheduling status
KubeVMIStatusScheduled // KubeVMIStatusScheduled - VMI in Scheduled status
KubeVMIStatusRunning // KubeVMIStatusRunning - VMI in Running status
KubeVMIStatusSucceeded // KubeVMIStatusSucceeded - VMI in Succeeded status
KubeVMIStatusFailed // KubeVMIStatusFailed - VMI in Failed status
KubeVMIStatusUnknown // KubeVMIStatusUnknown - VMI in Unknown status
)
// KubeVMIInfo - Information about a VirtualMachineInstance
type KubeVMIInfo struct {
Name string
Status KubeVMIStatus
CreationTime time.Time
LastTransitionTime time.Time
IsReady bool
NodeName string
}
// KubeClusterInfo - Information about a Kubernetes cluster
type KubeClusterInfo struct {
Nodes []KubeNodeInfo // List of nodes in the cluster
AppPods []KubePodInfo // List of EVE application pods
AppVMIs []KubeVMIInfo // List of VirtualMachineInstance
}