multus

package
v0.0.0-...-331d270 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DedicatedStorageNodeType = "storage-nodes"
	DedicatedWorkerNodeType  = "worker-nodes"
)
View Source
const (
	ClientTypeOSD    = "osd"
	ClientTypeNonOSD = "other"
)
View Source
const (
	DedicatedArbiterNodeType = "arbiter-node"
)
View Source
const DefaultValidationNodeType = "shared-storage-and-worker-nodes"

Variables

View Source
var (
	DefaultValidationNamespace = "rook-ceph"

	DefaultValidationOSDsPerNode = 3

	DefaultValidationOtherDaemonsPerNode = 16

	DefaultValidationNginxImage = "quay.io/nginx/nginx-unprivileged:stable-alpine"

	DefaultValidationResourceTimeout = 3 * time.Minute

	DefaultValidationFlakyThreshold = 30 * time.Second

	DefaultStorageNodeLabelKey   = "storage-node"
	DefaultStorageNodeLabelValue = "true"

	DefaultArbiterNodeLabelKey   = "topology.kubernetes.io/zone"
	DefaultArbiterNodeLabelValue = "arbiter"
	DefaultArbiterTolerationKey  = "node-role.kubernetes.io/control-plane"
)
View Source
var (
	//go:embed config.yaml
	ConfigYaml string
)

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Infof(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Warningf(format string, args ...interface{})
}

Logger defines the log types that this library will use for outputting status information to the user. Because this library may be called interactively by a user or programmatically by another application, we allow the calling application to make a very simple Logger type that will be compatible with this library.

type NodeConfig

type NodeConfig struct {
	// OSD daemons per node
	OSDsPerNode int `yaml:"osdsPerNode"`
	// Non-OSD daemons per node.
	OtherDaemonsPerNode int             `yaml:"otherDaemonsPerNode"`
	Placement           PlacementConfig `yaml:"placement"`
}

type PlacementConfig

type PlacementConfig struct {
	NodeSelector map[string]string `yaml:"nodeSelector"`
	Tolerations  []TolerationType  `yaml:"tolerations"`
}

NodeSelector and Tolerations are intentionally the only configurable parameters here. Affinity/Anti-Affinity is too relaxed of a specification to ensure the validation test runs the exact number of daemons per node that it should be running. Only allow the minimum selection configs that can be used to define nodes this test can run on.

type SimpleStderrLogger

type SimpleStderrLogger struct{}

func (*SimpleStderrLogger) Debugf

func (*SimpleStderrLogger) Debugf(format string, args ...interface{})

func (*SimpleStderrLogger) Infof

func (*SimpleStderrLogger) Infof(format string, args ...interface{})

func (*SimpleStderrLogger) Warningf

func (*SimpleStderrLogger) Warningf(format string, args ...interface{})

type TolerationType

type TolerationType corev1.Toleration

func (*TolerationType) ToJSON

func (t *TolerationType) ToJSON() (string, error)

ToJSON renders a toleration as a single-line JSON string. The JSON rendering is just as easy to read as the YAML rendering and is easier to format in the config.yaml template using Golang text templating compared to YAML. Need to define our own because corev1.Toleration.Marshal() does not render as expected.

type ValidationTest

type ValidationTest struct {
	Clientset kubernetes.Interface

	// The Logger will be used to render ongoing status by this library.
	Logger Logger

	ValidationTestConfig
}

A Multus ValidationTest runs a number of Multus-connected pods to validate that a Kubernetes environment is suitable for Rook to run Ceph in.

func (*ValidationTest) CleanUp

CleanUp cleans up Multus validation test resources. It returns a suggestion for manual action if clean up was unsuccessful.

func (*ValidationTest) Run

Run the Multus validation test.

type ValidationTestConfig

type ValidationTestConfig struct {
	Namespace       string                `yaml:"namespace"`
	PublicNetwork   string                `yaml:"publicNetwork"`
	ClusterNetwork  string                `yaml:"clusterNetwork"`
	ResourceTimeout time.Duration         `yaml:"resourceTimeout"`
	FlakyThreshold  time.Duration         `yaml:"flakyThreshold"`
	NginxImage      string                `yaml:"nginxImage"`
	NodeTypes       map[string]NodeConfig `yaml:"nodeTypes"`
}

ValidationTestConfig is a configuration for a Multus validation test. To prevent documentation for this struct from getting out of date, see the output of ValidationTestConfig.ToYAML() for usage text for each field.

func NewArbiterValidationTestConfig

func NewArbiterValidationTestConfig() *ValidationTestConfig

func NewDedicatedStorageNodesValidationTestConfig

func NewDedicatedStorageNodesValidationTestConfig() *ValidationTestConfig

func NewDefaultValidationTestConfig

func NewDefaultValidationTestConfig() *ValidationTestConfig

NewDefaultValidationTestConfig returns a new ValidationTestConfig with default values. The default test is a converged-node test with no placement.

func NewSharedStorageAndWorkerNodesValidationTestConfig

func NewSharedStorageAndWorkerNodesValidationTestConfig() *ValidationTestConfig

func ValidationTestConfigFromYAML

func ValidationTestConfigFromYAML(y string) (*ValidationTestConfig, error)

ValidationTestConfigFromYAML loads a YAML-formatted string into a new ValidationTestConfig.

func (*ValidationTestConfig) BestNodePlacementForServer

func (c *ValidationTestConfig) BestNodePlacementForServer() (PlacementConfig, error)

func (*ValidationTestConfig) String

func (c *ValidationTestConfig) String() string

String implements the Stringer interface

func (*ValidationTestConfig) ToYAML

func (c *ValidationTestConfig) ToYAML() (string, error)

ToYAML converts the validation test config into a YAML representation with user-readable comments describing how to use the various parameters.

func (*ValidationTestConfig) TotalDaemonsPerNode

func (c *ValidationTestConfig) TotalDaemonsPerNode() int

func (*ValidationTestConfig) TotalOSDsPerNode

func (c *ValidationTestConfig) TotalOSDsPerNode() int

func (*ValidationTestConfig) TotalOtherDaemonsPerNode

func (c *ValidationTestConfig) TotalOtherDaemonsPerNode() int

func (*ValidationTestConfig) Validate

func (c *ValidationTestConfig) Validate() error

Validate reports any validation test configuration problems as errors.

type ValidationTestResults

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

ValidationTestResults contains results from a validation test.

func (*ValidationTestResults) SuggestedDebuggingReport

func (vtr *ValidationTestResults) SuggestedDebuggingReport() string

Jump to

Keyboard shortcuts

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