status

package
v0.16.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Red     = "\033[31m"
	Yellow  = "\033[33m"
	Blue    = "\033[34m"
	Green   = "\033[32m"
	Magenta = "\033[35m"
	Cyan    = "\033[36m"
	Reset   = "\033[0m"
)
View Source
const (
	OutputJSON    = "json"
	OutputSummary = "summary"
)
View Source
const (
	// DefaultWorkerCount is the number of the max workers used to gather the status
	DefaultWorkerCount int = 5
)

Variables

View Source
var ErrClusterMeshStatusNotAvailable = errors.New("ClusterMesh status is not available")

ErrClusterMeshStatusNotAvailable is a sentinel.

Functions

This section is empty.

Types

type CiliumEndpointsMap added in v0.16.0

type CiliumEndpointsMap map[string][]*models.Endpoint

type CiliumStatusMap

type CiliumStatusMap map[string]*models.StatusResponse

type ClusterMeshAgentConnectivityStatus

type ClusterMeshAgentConnectivityStatus struct {
	GlobalServices int64
	Clusters       map[string]*models.RemoteCluster
	Errors         ErrorCountMap
}

type ErrorCount

type ErrorCount struct {
	Errors   []error
	Warnings []error
	Disabled bool
}

type ErrorCountMap

type ErrorCountMap map[string]*ErrorCount

type ErrorCountMapMap

type ErrorCountMapMap map[string]ErrorCountMap

type K8sStatusCollector

type K8sStatusCollector struct {
	// contains filtered or unexported fields
}

func NewK8sStatusCollector

func NewK8sStatusCollector(client k8sImplementation, params K8sStatusParameters) (*K8sStatusCollector, error)

func (*K8sStatusCollector) ClusterMeshConnectivity

func (k *K8sStatusCollector) ClusterMeshConnectivity(ctx context.Context, ciliumPod string) (*ClusterMeshAgentConnectivityStatus, error)

func (*K8sStatusCollector) Status

func (k *K8sStatusCollector) Status(ctx context.Context) (*Status, error)

type K8sStatusParameters

type K8sStatusParameters struct {
	Namespace    string
	Wait         bool
	WaitDuration time.Duration
	// WarningFreePods specifies a list of pods which are required to be
	// warning free. This takes precedence over IgnoreWarnings and is only
	// used if Wait is true.
	WarningFreePods []string
	// IgnoreWarnings will, if set to true, ignore any warnings on pods to
	// determine the readiness. This is only used if Wait is true and
	// WarningFreePods is empty. If WarningFreePods is non-empty, the value
	// of this flag is meaningless.
	IgnoreWarnings bool

	// The number of workers to use.
	WorkerCount int

	// The output format
	Output string

	HelmReleaseName string

	// Interactive specifies whether the summary output refreshes after each
	// retry when --wait flag is specified.
	Interactive bool
}

type MapCount

type MapCount map[string]int

MapCount is a map to count number of occurrences of a string

type MapMapCount

type MapMapCount map[string]MapCount

MapMapCount is a map of MapCount indexed by string

type PodStateCount

type PodStateCount struct {
	// Type is the type of deployment ("Deployment", "DaemonSet", ...)
	Type string

	// Desired is the number of desired pods to be scheduled
	Desired int

	// Ready is the number of ready pods
	Ready int

	// Available is the number of available pods
	Available int

	// Unavailable is the number of unavailable pods
	Unavailable int
}

PodStateCount counts the number of pods in a particular state

func (PodStateCount) Format

func (c PodStateCount) Format() string

type PodStateMap

type PodStateMap map[string]PodStateCount

type PodsCount added in v0.9.0

type PodsCount struct {
	// All is the number of all pods in the k8s cluster
	All int `json:"all"`

	// ByCilium is the number of all the pods in the k8s cluster
	ByCilium int `json:"by_cilium"`
}

PodStateCount counts the number of pods in the k8s cluster

type Status

type Status struct {
	// ImageCount is a map counting the number of images in use indexed by
	// the image name
	ImageCount MapMapCount `json:"image_count,omitempty"`

	// PhaseCount is a map counting the number of pods in each phase
	// (running, failing, scheduled, ...)
	PhaseCount MapMapCount `json:"phase_count,omitempty"`

	// PodState counts the number of pods matching conditions such as
	// desired, ready, available, and unavailable
	PodState PodStateMap `json:"pod_state,omitempty"`

	// PodsCount is the number of pods in the k8s cluster
	// all pods, and pods managed by cilium
	PodsCount PodsCount `json:"pods_count,omitempty"`

	CiliumStatus CiliumStatusMap `json:"cilium_status,omitempty"`

	// CiliumEndpoints contains the information about the endpoints managed
	// by each Cilium agent.
	CiliumEndpoints CiliumEndpointsMap `json:"cilium_endpoints,omitempty"`

	// Errors is the aggregated errors and warnings of all pods of a
	// particular deployment type
	Errors ErrorCountMapMap `json:"errors,omitempty"`

	// CollectionErrors is the errors that accumulated while collecting the
	// status
	CollectionErrors []error `json:"collection_errors,omitempty"`

	// HelmChartVersion is the Helm chart version that is currently installed.
	// For Helm mode only.
	HelmChartVersion string `json:"helm_chart_version,omitempty"`
	// contains filtered or unexported fields
}

Status is the overall status of Cilium

func (*Status) AddAggregatedError

func (s *Status) AddAggregatedError(deployment, pod string, err error)

func (*Status) AddAggregatedWarning

func (s *Status) AddAggregatedWarning(deployment, pod string, warning error)

func (*Status) CollectionError

func (s *Status) CollectionError(err error)

func (*Status) Format

func (s *Status) Format() string

func (*Status) SetDisabled

func (s *Status) SetDisabled(deployment, pod string, disabled bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL