Documentation
¶
Overview ¶
Package pods provides pod status for a namespace using kubectl. It supports both a snapshot as well as a continuous stream.
Index ¶
Constants ¶
View Source
const ( PodPending = corev1.PodPending // Accepted but not all containers have started. PodRunning = corev1.PodRunning // All containers have started and at least one is running. PodSucceeded = corev1.PodSucceeded // All containers terminated without error. PodFailed = corev1.PodFailed // All containers terminated with at least one error. )
Values for Phase. These constants are copied from k8s.io/api/core/v1 as a convenience.
Variables ¶
This section is empty.
Functions ¶
func WatchPodStatus ¶
func WatchPodStatus(ctx context.Context, client kubernetes.Interface, namespace string) (chan *PodStatus, func(), error)
WatchPodStatus returns a channel on which the status of the pods in the supplied namespace are written.
Types ¶
type ContainerStatus ¶
type ContainerStatus struct {
Name string
Image string // path of requested image
Ready bool // true if ready
Reason string // if not empty, the reason it isn't ready
Message string // human readable reason
Raw *corev1.ContainerStatus
}
A ContainerStatus contains the status of a single container in the pod.
func (*ContainerStatus) Equal ¶
func (c *ContainerStatus) Equal(oc *ContainerStatus) bool
func (*ContainerStatus) String ¶
func (c *ContainerStatus) String() string
type PodStatus ¶
type PodStatus struct {
Name string // name of pod
UID types.UID
Namespace string
Phase corev1.PodPhase // current phase
Containers []ContainerStatus
InitContainers []ContainerStatus
Pod corev1.Pod // copy of the raw pod
}
A PodStatus represents the status of a single Pod.
func GetPodStatus ¶
func GetPodStatus(ctx context.Context, client kubernetes.Interface, namespace string) ([]*PodStatus, error)
GetPodStatus returns the status of the pods found in the supplied namespace.
func PodToStatus ¶
PodToStatus returns a pointer to a new PodStatus for pod.
Click to show internal directories.
Click to hide internal directories.