Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) AdminServerAddress(ctx context.Context, t *testing.T) string
- func (c *Cluster) ClearMetadataRepositoryNodeData(ctx context.Context, t *testing.T)
- func (c *Cluster) ClearStorageNodeData(ctx context.Context, t *testing.T)
- func (c *Cluster) Close(context.Context, *testing.T)
- func (c *Cluster) Controller() *controller.Controller
- func (c *Cluster) GetMetadataRepositoryNodeName(ctx context.Context, t *testing.T, nid types.NodeID) string
- func (c *Cluster) GetStorageNodeName(ctx context.Context, t *testing.T, snid types.StorageNodeID) string
- func (c *Cluster) ListAdminPods(ctx context.Context, t *testing.T) []core.Pod
- func (c *Cluster) ListMetadataRepositoryNodes(ctx context.Context, t *testing.T) []core.Node
- func (c *Cluster) ListMetadataRepositoryPods(ctx context.Context, t *testing.T) []core.Pod
- func (c *Cluster) ListStorageNodeNodes(ctx context.Context, t *testing.T) []core.Node
- func (c *Cluster) ListStorageNodePods(ctx context.Context, t *testing.T) []core.Pod
- func (c *Cluster) MetadataRepositoryAddress(ctx context.Context, t *testing.T) string
- func (c *Cluster) SetNumMetadataRepositories(ctx context.Context, t *testing.T, desired int)
- func (c *Cluster) Setup(ctx context.Context, t *testing.T)
- func (c *Cluster) StartAdminServer(ctx context.Context, t *testing.T)
- func (c *Cluster) StartMetadataRepositoryNodes(ctx context.Context, t *testing.T, desired int)
- func (c *Cluster) StartStorageNode(ctx context.Context, t *testing.T, nodeName string) bool
- func (c *Cluster) StartStorageNodes(ctx context.Context, t *testing.T, desired int)
- func (c *Cluster) StopAdminServer(ctx context.Context, t *testing.T)
- func (c *Cluster) StopMetadataRepositoryNodes(ctx context.Context, t *testing.T)
- func (c *Cluster) StopStorageNode(ctx context.Context, t *testing.T, snid types.StorageNodeID) (nodeName string)
- func (c *Cluster) StopStorageNodes(ctx context.Context, t *testing.T)
- func (c *Cluster) String() string
- type Option
- func WithAdminServiceResourceName(serviceName string) Option
- func WithAsyncTestCheckInterval(asyncTestCheckInterval time.Duration) Option
- func WithAsyncTestWaitDuration(asyncTestWaitDuration time.Duration) Option
- func WithCommonConfig(commonConfig cluster.Config) Option
- func WithIngressNamespace(ingressNamespace string) Option
- func WithMetadataRepositoryServiceResourceName(serviceName string) Option
- func WithVarlogNamespace(varlogNamespace string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster represents a controller for the cluster on which test suites run.
func (*Cluster) AdminServerAddress ¶
AdminServerAddress returns the address of the admin server.
func (*Cluster) ClearMetadataRepositoryNodeData ¶
ClearMetadataRepositoryNodeData wipes out data from metadata repositories. This method cleans up all nodes in the node group varlogmr regardless of whether the metadata repositories are running or not.
func (*Cluster) ClearStorageNodeData ¶
ClearStorageNodeData wipes out data from storage nodes. This method cleans up all nodes in the node group varlogsn regardless of whether the storage nodes are running or not.
func (*Cluster) Controller ¶
func (c *Cluster) Controller() *controller.Controller
func (*Cluster) GetMetadataRepositoryNodeName ¶
func (c *Cluster) GetMetadataRepositoryNodeName(ctx context.Context, t *testing.T, nid types.NodeID) string
GetMetadataRepositoryNodeName returns a Kubernetes node name of the repository node specified by the argument nid.
Note that the metadata repository should use the hostNetwork of Kubernetes. To get a node name, this method compares the host IP and container port of the metadata repository pods to the RPC address of the metadata repository.
func (*Cluster) GetStorageNodeName ¶
func (*Cluster) ListAdminPods ¶
func (*Cluster) ListMetadataRepositoryNodes ¶
ListMetadataRepositoryNodes returns a list of Kubernetes nodes labeled the node group varlogmr. Note that there can be no running pods in the result nodes.
func (*Cluster) ListMetadataRepositoryPods ¶
ListMetadataRepositoryPods returns a list of all pods running varlogmr.
func (*Cluster) ListStorageNodeNodes ¶
ListStorageNodeNodes returns a list of Kubernetes nodes labeled the node group varlogsn. Note that there can be no running pods in the result nodes.
func (*Cluster) ListStorageNodePods ¶
ListStorageNodePods returns a list of all pods running varlogsn.
func (*Cluster) MetadataRepositoryAddress ¶
func (*Cluster) SetNumMetadataRepositories ¶
SetNumMetadataRepositories sets the number of running metadata repositories to the given number. It can either shrink or expand the number of metadata repositories.
func (*Cluster) Setup ¶
Setup initializes test cluster.
It stops the admin server, metadata repositories, and storage nodes if they are running yet. It also wipes out data from metadata repositories and storage nodes. To start up the cluster, a metadata repository starts at first. The admin server, then, starts. The remaining metadata repositories start after beginning the admin server. At last, the storage nodes are created.
func (*Cluster) StartAdminServer ¶
StartAdminServer starts the admin server on the node group varlogadm of the cluster.
It sets the number of desired replicas of the varlogadm to one and waits until the pod runs.
func (*Cluster) StartMetadataRepositoryNodes ¶
StartMetadataRepositoryNodes will result in the given number of running metadata repositories on the node group varlogmr of the cluster. If there are already nodes in the cluster more than the given number, this method will fail.
func (*Cluster) StartStorageNode ¶
func (*Cluster) StartStorageNodes ¶
StartStorageNodes will result in the given number of running storage nodes on the node group varlogsn of the cluster. If there are already nodes in the cluster more than the given number, this method will fail.
Note that the DaemonSet varlogsn should have a proper nodeAffinity setting since it sets the node label `varlogsn-status` of the node group varlogsn to `started`.
func (*Cluster) StopAdminServer ¶
StopAdminServer stops the admin server.
It sets the number of desired replicas of the varlogadm to zero and waits until the pod stops.
func (*Cluster) StopMetadataRepositoryNodes ¶
StopMetadataRepositoryNodes stops all metadata repositories.
func (*Cluster) StopStorageNode ¶
func (c *Cluster) StopStorageNode(ctx context.Context, t *testing.T, snid types.StorageNodeID) (nodeName string)
StopStorageNode stops the storage node specified by the argument snid and returns the Kubernetes node name that had run the storage node.
func (*Cluster) StopStorageNodes ¶
StopStorageNodes stops all storage nodes. It changes the node label DefaultNodeStatusLabelStorageNode from DefaultNodeStatusStarted to DefaultNodeStatusStopped.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}