Documentation ¶
Overview ¶
Package check provides set of checks to verify cluster readiness.
Package check provides set of checks to verify cluster readiness.
Package check provides set of checks to verify cluster readiness.
Package check provides set of checks to verify cluster readiness.
Index ¶
- Variables
- func AllNodesBootedAssertion(ctx context.Context, cluster ClusterInfo) error
- func AllNodesDiskSizes(ctx context.Context, cluster ClusterInfo) error
- func AllNodesMemorySizes(ctx context.Context, cluster ClusterInfo) error
- func ApidReadyAssertion(ctx context.Context, cluster ClusterInfo) error
- func DaemonSetPresent(ctx context.Context, cluster cluster.K8sProvider, ...) (bool, error)
- func EtcdConsistentAssertion(ctx context.Context, cl ClusterInfo) error
- func EtcdControlPlaneNodesAssertion(ctx context.Context, cl ClusterInfo) error
- func K8sAllNodesReadyAssertion(ctx context.Context, cluster cluster.K8sProvider) error
- func K8sAllNodesReportedAssertion(ctx context.Context, cl ClusterInfo) error
- func K8sAllNodesSchedulableAssertion(ctx context.Context, cluster cluster.K8sProvider) error
- func K8sControlPlaneStaticPods(ctx context.Context, cl ClusterInfo) error
- func K8sFullControlPlaneAssertion(ctx context.Context, cl ClusterInfo) error
- func K8sPodReadyAssertion(ctx context.Context, cluster cluster.K8sProvider, ...) error
- func NewDiscoveredClusterInfo(members []*clussterres.Member) (cluster.Info, error)
- func ReplicaSetPresent(ctx context.Context, cluster cluster.K8sProvider, ...) (bool, error)
- func ServiceHealthAssertion(ctx context.Context, cl ClusterInfo, service string, setters ...Option) error
- func ServiceStateAssertion(ctx context.Context, cl ClusterInfo, service string, states ...string) error
- func Wait(ctx context.Context, cluster ClusterInfo, checks []ClusterCheck, ...) error
- type ClusterCheck
- type ClusterInfo
- type ConditionReporter
- type DiscoveredClusterInfo
- type Option
- type Options
- type Reporter
Constants ¶
This section is empty.
Variables ¶
var ErrOldTalosVersion = fmt.Errorf("old Talos version")
ErrOldTalosVersion is returned when the node is running an old version of Talos.
var ErrServiceNotFound = fmt.Errorf("service not found")
ErrServiceNotFound is an error that indicates that a service was not found.
Functions ¶
func AllNodesBootedAssertion ¶
func AllNodesBootedAssertion(ctx context.Context, cluster ClusterInfo) error
AllNodesBootedAssertion checks whether nodes reached end of 'Boot' sequence.
func AllNodesDiskSizes ¶
func AllNodesDiskSizes(ctx context.Context, cluster ClusterInfo) error
AllNodesDiskSizes checks that all nodes have enough disk space.
func AllNodesMemorySizes ¶
func AllNodesMemorySizes(ctx context.Context, cluster ClusterInfo) error
AllNodesMemorySizes checks that all nodes have enough memory.
func ApidReadyAssertion ¶
func ApidReadyAssertion(ctx context.Context, cluster ClusterInfo) error
ApidReadyAssertion checks whether apid is responsive on all the nodes.
func DaemonSetPresent ¶
func DaemonSetPresent(ctx context.Context, cluster cluster.K8sProvider, namespace, labelSelector string) (bool, error)
DaemonSetPresent returns true if there is at least one DaemonSet matching given label selector.
func EtcdConsistentAssertion ¶
func EtcdConsistentAssertion(ctx context.Context, cl ClusterInfo) error
EtcdConsistentAssertion checks that etcd membership is consistent across nodes.
func EtcdControlPlaneNodesAssertion ¶
func EtcdControlPlaneNodesAssertion(ctx context.Context, cl ClusterInfo) error
EtcdControlPlaneNodesAssertion checks that etcd nodes are control plane nodes.
func K8sAllNodesReadyAssertion ¶
func K8sAllNodesReadyAssertion(ctx context.Context, cluster cluster.K8sProvider) error
K8sAllNodesReadyAssertion checks whether all the nodes are Ready.
func K8sAllNodesReportedAssertion ¶
func K8sAllNodesReportedAssertion(ctx context.Context, cl ClusterInfo) error
K8sAllNodesReportedAssertion checks whether all the nodes show up in node list.
func K8sAllNodesSchedulableAssertion ¶
func K8sAllNodesSchedulableAssertion(ctx context.Context, cluster cluster.K8sProvider) error
K8sAllNodesSchedulableAssertion checks whether all the nodes are schedulable (not cordoned).
func K8sControlPlaneStaticPods ¶
func K8sControlPlaneStaticPods(ctx context.Context, cl ClusterInfo) error
K8sControlPlaneStaticPods checks whether all the controlplane nodes are running required Kubernetes static pods.
func K8sFullControlPlaneAssertion ¶
func K8sFullControlPlaneAssertion(ctx context.Context, cl ClusterInfo) error
K8sFullControlPlaneAssertion checks whether all the controlplane nodes are k8s controlplane nodes.
func K8sPodReadyAssertion ¶
func K8sPodReadyAssertion(ctx context.Context, cluster cluster.K8sProvider, namespace, labelSelector string) error
K8sPodReadyAssertion checks whether all the pods matching label selector are Ready, and there is at least one.
func NewDiscoveredClusterInfo ¶
func NewDiscoveredClusterInfo(members []*clussterres.Member) (cluster.Info, error)
NewDiscoveredClusterInfo returns a new cluster.Info populated from the discovery service.
func ReplicaSetPresent ¶
func ReplicaSetPresent(ctx context.Context, cluster cluster.K8sProvider, namespace, labelSelector string) (bool, error)
ReplicaSetPresent returns true if there is at least one ReplicaSet matching given label selector.
func ServiceHealthAssertion ¶
func ServiceHealthAssertion(ctx context.Context, cl ClusterInfo, service string, setters ...Option) error
ServiceHealthAssertion checks whether service reached some specified state.
func ServiceStateAssertion ¶
func ServiceStateAssertion(ctx context.Context, cl ClusterInfo, service string, states ...string) error
ServiceStateAssertion checks whether service reached some specified state.
func Wait ¶
func Wait(ctx context.Context, cluster ClusterInfo, checks []ClusterCheck, reporter Reporter) error
Wait run the checks against the cluster and waits for the full set to succeed.
Context ctx might have a timeout set to limit overall wait time. Each check might define its own timeout.
Types ¶
type ClusterCheck ¶
type ClusterCheck func(ClusterInfo) conditions.Condition
ClusterCheck implements a function which returns condition based on ClusterAccess.
func DefaultClusterChecks ¶
func DefaultClusterChecks() []ClusterCheck
DefaultClusterChecks returns a set of default Talos cluster readiness checks.
func ExtraClusterChecks ¶
func ExtraClusterChecks() []ClusterCheck
ExtraClusterChecks returns a set of additional Talos cluster readiness checks which work only for newer versions of Talos.
ExtraClusterChecks can't be used reliably in upgrade tests, as older versions might not pass the checks.
type ClusterInfo ¶
type ClusterInfo interface { cluster.ClientProvider cluster.K8sProvider cluster.Info }
ClusterInfo is interface requires by checks.
type ConditionReporter ¶
type ConditionReporter struct {
// contains filtered or unexported fields
}
ConditionReporter is a reporter that reports conditions to a reporter.Reporter.
func StderrReporter ¶
func StderrReporter() *ConditionReporter
StderrReporter returns console reporter with stderr output.
func (*ConditionReporter) Update ¶
func (r *ConditionReporter) Update(condition conditions.Condition)
Update reports a condition to the reporter.
type DiscoveredClusterInfo ¶
type DiscoveredClusterInfo struct {
// contains filtered or unexported fields
}
DiscoveredClusterInfo represents a cluster.Info populated using the discovery service.
func (*DiscoveredClusterInfo) Nodes ¶
func (d *DiscoveredClusterInfo) Nodes() []cluster.NodeInfo
Nodes returns list of all node infos.
func (*DiscoveredClusterInfo) NodesByType ¶
func (d *DiscoveredClusterInfo) NodesByType(m machine.Type) []cluster.NodeInfo
NodesByType return list of node endpoints by type.
type Option ¶
Option represents functional option.
func WithNodeTypes ¶
WithNodeTypes sets the node types for a check.
type Reporter ¶
type Reporter interface {
Update(condition conditions.Condition)
}
Reporter presents wait progress.
It is supposed that reporter drops duplicate messages.