Documentation
¶
Index ¶
- Constants
- Variables
- type CiliumEndpointsMap
- type CiliumStatusMap
- type ClusterMeshAgentConnectivityStatus
- type ErrorCount
- type ErrorCountMap
- type ErrorCountMapMap
- type K8sStatusCollector
- func (k *K8sStatusCollector) ClusterMeshConnectivity(ctx context.Context, ciliumPod string) (*ClusterMeshAgentConnectivityStatus, error)
- func (k *K8sStatusCollector) KVStoreMeshConnectivity(ctx context.Context, pod string) (*ClusterMeshAgentConnectivityStatus, error)
- func (k *K8sStatusCollector) Status(ctx context.Context) (*Status, error)
- type K8sStatusParameters
- type MapCount
- type MapMapCount
- type PodStateCount
- type PodStateMap
- type PodsCount
- type Status
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 ¶
type CiliumStatusMap ¶
type CiliumStatusMap map[string]*models.StatusResponse
type ClusterMeshAgentConnectivityStatus ¶
type ClusterMeshAgentConnectivityStatus struct {
Clusters map[string]*models.RemoteCluster
Errors ErrorCountMap
}
type ErrorCount ¶
func (*ErrorCount) MarshalJSON ¶
func (e *ErrorCount) MarshalJSON() ([]byte, error)
custom marshaling for ErrorCount
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) KVStoreMeshConnectivity ¶
func (k *K8sStatusCollector) KVStoreMeshConnectivity(ctx context.Context, pod string) (*ClusterMeshAgentConnectivityStatus, 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
// Verbose increases the verbosity of certain output, such as Cilium
// error logs on failure.
Verbose bool
}
type MapMapCount ¶
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 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 ¶
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"`
ConfigErrors []string `json:"config_errors,omitempty"`
// contains filtered or unexported fields
}
Status is the overall status of Cilium
func (*Status) AddAggregatedError ¶
func (*Status) AddAggregatedWarning ¶
func (*Status) CollectionError ¶
func (*Status) SetDisabled ¶
Click to show internal directories.
Click to hide internal directories.