kubestr

package
v0.4.44 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MinK8sMajorVersion is the minimum supported Major version
	MinK8sMajorVersion = 1
	// MinK8sMinorVersion is the minimum supported Minor version
	MinK8sMinorVersion = 12
	// MinK8sGitVersion is the minimum supported k8s version
	MinK8sGitVersion = "v1.12.0"
	// RbacGroupName describe hte rbac group name
	RbacGroupName = "rbac.authorization.k8s.io"
)
View Source
const (
	// APIVersionKey describes the APIVersion key
	APIVersionKey = "apiVersion"
	// FeatureGateTestPVCName is the name of the pvc created by the feature gate
	// validation test
	FeatureGateTestPVCName = "kubestr-featuregate-test"
	// DefaultNS describes the default namespace
	DefaultNS = "default"
	// PodNamespaceEnvKey describes the pod namespace env variable
	PodNamespaceEnvKey = "POD_NAMESPACE"
)
View Source
const (
	// ErrorColor formatted color red
	ErrorColor = "\033[1;31m%s\033[0m"
	// SuccessColor formatted color green
	SuccessColor = "\033[1;32m%s\033[0m"
	// YellowColor formatted color yellow
	YellowColor = "\033[1;33m%s\033[0m"
)
View Source
const (
	// StatusOK is the success status code
	StatusOK = StatusCode("OK")
	// StatusWarning is the informational status code
	StatusWarning = StatusCode("Warning")
	// StatusError is the failure status code
	StatusError = StatusCode("Error")
	// StatusInfo is the Info status code
	StatusInfo = StatusCode("Info")
)
View Source

Variables

View Source
var (
	DefaultQPS   = float32(50)
	DefaultBurst = 100
)
View Source
var CSIDriverList = []*CSIDriver{}/* 109 elements not displayed */

Functions

func LoadDynCli added in v0.4.0

func LoadDynCli() (dynamic.Interface, error)

LoadDynCli loads the config and returns a dynamic CLI

func LoadKubeCli added in v0.4.0

func LoadKubeCli() (kubernetes.Interface, error)

LoadKubeCli load the config and returns a kubernetes client NewClient returns a k8 client configured by the kanister environment.

Types

type CSIDriver

type CSIDriver struct {
	NameUrl             string
	DriverName          string
	Versions            string
	Description         string
	Persistence         string
	AccessModes         string
	DynamicProvisioning string
	Features            string
}

func (*CSIDriver) Print

func (c *CSIDriver) Print(prefix string)

func (*CSIDriver) Provider

func (c *CSIDriver) Provider() string

func (*CSIDriver) SupportsSnapshots

func (c *CSIDriver) SupportsSnapshots() bool

func (*CSIDriver) URL

func (c *CSIDriver) URL() string

type Kubestr

type Kubestr struct {
	Fio fio.FIO
	// contains filtered or unexported fields
}

Kubestr is the primary object for running the kubestr tool. It holds all the cluster state information as well.

func NewKubestr

func NewKubestr() (*Kubestr, error)

NewKubestr initializes a new kubestr object to run preflight tests

func (*Kubestr) KubernetesChecks

func (p *Kubestr) KubernetesChecks() []*TestOutput

KubernetesChecks runs all the baseline checks on the cluster

func (*Kubestr) ValidateProvisioners

func (p *Kubestr) ValidateProvisioners(ctx context.Context) ([]*Provisioner, error)

ValidateProvisioners validates the provisioners in a cluster

type Provisioner

type Provisioner struct {
	ProvisionerName       string
	CSIDriver             *CSIDriver
	URL                   string
	StorageClasses        []*SCInfo
	VolumeSnapshotClasses []*VSCInfo
	StatusList            []Status
}

Provisioner holds the important information of a provisioner

func (*Provisioner) Print

func (v *Provisioner) Print()

Print prints the provionsioner specific details

type SCInfo

type SCInfo struct {
	Name       string
	StatusList []Status
	Raw        interface{} `json:",omitempty"`
}

SCInfo stores the info of a StorageClass

type Status

type Status struct {
	StatusCode    StatusCode
	StatusMessage string
	Raw           interface{} `json:",omitempty"`
}

Status is a generic structure to return a status

func (*Status) Print

func (s *Status) Print(prefix string)

Print prints a status message with a given prefix

type StatusCode

type StatusCode string

StatusCode type definition

type TestOutput

type TestOutput struct {
	TestName string
	Status   []Status
	Raw      interface{} `json:",omitempty"`
}

TestOutput is the generic return value for tests

func MakeTestOutput added in v0.4.0

func MakeTestOutput(testname string, code StatusCode, mesg string, raw interface{}) *TestOutput

func (*TestOutput) Print

func (t *TestOutput) Print()

Print prints a TestRetVal as a string output

type VSCInfo

type VSCInfo struct {
	Name          string
	StatusList    []Status
	HasAnnotation bool
	Raw           interface{} `json:",omitempty"`
}

VSCInfo stores the info of a VolumeSnapshotClass

Jump to

Keyboard shortcuts

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