Documentation
¶
Overview ¶
Package upgrades provides a framework for testing Kubernetes features before, during, and after different types of upgrades.
Index ¶
- type AppArmorUpgradeTest
- func (AppArmorUpgradeTest) Name() string
- func (t *AppArmorUpgradeTest) Setup(f *framework.Framework)
- func (AppArmorUpgradeTest) Skip(upgCtx UpgradeContext) bool
- func (t *AppArmorUpgradeTest) Teardown(f *framework.Framework)
- func (t *AppArmorUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
- type ConfigMapUpgradeTest
- type DaemonSetUpgradeTest
- type DeploymentUpgradeTest
- type HPAUpgradeTest
- type IngressUpgradeTest
- type JobUpgradeTest
- type PersistentVolumeUpgradeTest
- type SecretUpgradeTest
- type ServiceUpgradeTest
- type Skippable
- type StatefulSetUpgradeTest
- func (StatefulSetUpgradeTest) Name() string
- func (t *StatefulSetUpgradeTest) Setup(f *framework.Framework)
- func (StatefulSetUpgradeTest) Skip(upgCtx UpgradeContext) bool
- func (t *StatefulSetUpgradeTest) Teardown(f *framework.Framework)
- func (t *StatefulSetUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
- type SysctlUpgradeTest
- type Test
- type UpgradeContext
- type UpgradeType
- type VersionContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppArmorUpgradeTest ¶
type AppArmorUpgradeTest struct {
// contains filtered or unexported fields
}
AppArmorUpgradeTest tests that AppArmor profiles are enforced & usable across upgrades.
func (*AppArmorUpgradeTest) Setup ¶
func (t *AppArmorUpgradeTest) Setup(f *framework.Framework)
Setup creates a secret and then verifies that a pod can consume it.
type ConfigMapUpgradeTest ¶
type ConfigMapUpgradeTest struct {
// contains filtered or unexported fields
}
ConfigMapUpgradeTest tests that a ConfigMap is available before and after a cluster upgrade.
func (*ConfigMapUpgradeTest) Setup ¶
func (t *ConfigMapUpgradeTest) Setup(f *framework.Framework)
Setup creates a ConfigMap and then verifies that a pod can consume it.
type DaemonSetUpgradeTest ¶
type DaemonSetUpgradeTest struct {
// contains filtered or unexported fields
}
DaemonSetUpgradeTest tests that a DaemonSet is running before and after a cluster upgrade.
func (*DaemonSetUpgradeTest) Setup ¶
func (t *DaemonSetUpgradeTest) Setup(f *framework.Framework)
Setup creates a DaemonSet and verifies that it's running
type DeploymentUpgradeTest ¶
type DeploymentUpgradeTest struct {
// contains filtered or unexported fields
}
DeploymentUpgradeTest tests that a deployment is using the same replica sets before and after a cluster upgrade.
func (*DeploymentUpgradeTest) Setup ¶
func (t *DeploymentUpgradeTest) Setup(f *framework.Framework)
Setup creates a deployment and makes sure it has a new and an old replica set running.
type HPAUpgradeTest ¶
type HPAUpgradeTest struct {
// contains filtered or unexported fields
}
HPAUpgradeTest tests that HPA rescales target resource correctly before and after a cluster upgrade.
func (*HPAUpgradeTest) Setup ¶
func (t *HPAUpgradeTest) Setup(f *framework.Framework)
Creates a resource consumer and an HPA object that autoscales the consumer.
type IngressUpgradeTest ¶
type IngressUpgradeTest struct {
// contains filtered or unexported fields
}
IngressUpgradeTest adapts the Ingress e2e for upgrade testing
func (*IngressUpgradeTest) Setup ¶
func (t *IngressUpgradeTest) Setup(f *framework.Framework)
Setup creates a GLBC, allocates an ip, and an ingress resource, then waits for a successful connectivity check to the ip.
type JobUpgradeTest ¶
type JobUpgradeTest struct {
// contains filtered or unexported fields
}
JobUpgradeTest is a test harness for batch Jobs.
func (*JobUpgradeTest) Setup ¶
func (t *JobUpgradeTest) Setup(f *framework.Framework)
Setup starts a Job with a parallelism of 2 and 2 completions running.
type PersistentVolumeUpgradeTest ¶
type PersistentVolumeUpgradeTest struct {
// contains filtered or unexported fields
}
PersistentVolumeUpgradeTest test that a pv is available before and after a cluster upgrade.
func (*PersistentVolumeUpgradeTest) Setup ¶
func (t *PersistentVolumeUpgradeTest) Setup(f *framework.Framework)
Setup creates a pv and then verifies that a pod can consume it. The pod writes data to the volume.
type SecretUpgradeTest ¶
type SecretUpgradeTest struct {
// contains filtered or unexported fields
}
SecretUpgradeTest test that a secret is available before and after a cluster upgrade.
func (*SecretUpgradeTest) Setup ¶
func (t *SecretUpgradeTest) Setup(f *framework.Framework)
Setup creates a secret and then verifies that a pod can consume it.
type ServiceUpgradeTest ¶
type ServiceUpgradeTest struct {
// contains filtered or unexported fields
}
ServiceUpgradeTest tests that a service is available before and after a cluster upgrade. During a master-only upgrade, it will test that a service remains available during the upgrade.
func (*ServiceUpgradeTest) Setup ¶
func (t *ServiceUpgradeTest) Setup(f *framework.Framework)
Setup creates a service with a load balancer and makes sure it's reachable.
type Skippable ¶
type Skippable interface {
// Skip should return true if test should be skipped. upgCtx
// provides information about the upgrade that is going to
// occur.
Skip(upgCtx UpgradeContext) bool
}
Skippable is an interface that an upgrade test can implement to be able to indicate that it should be skipped.
type StatefulSetUpgradeTest ¶
type StatefulSetUpgradeTest struct {
// contains filtered or unexported fields
}
StatefulSetUpgradeTest implements an upgrade test harness for StatefulSet upgrade testing.
func (*StatefulSetUpgradeTest) Setup ¶
func (t *StatefulSetUpgradeTest) Setup(f *framework.Framework)
Setup creates a StatefulSet and a HeadlessService. It verifies the basic SatefulSet properties
type SysctlUpgradeTest ¶
type SysctlUpgradeTest struct {
// contains filtered or unexported fields
}
SecretUpgradeTest tests that a pod with sysctls runs before and after an upgrade. During a master upgrade, the exact pod is expected to stay running. A pod with unsafe sysctls is expected to keep failing before and after the upgrade.
func (*SysctlUpgradeTest) Setup ¶
func (t *SysctlUpgradeTest) Setup(f *framework.Framework)
Setup creates two pods: one with safe sysctls, one with unsafe sysctls. It checks that the former launched and the later is rejected.
type Test ¶
type Test interface {
// Name should return a test name sans spaces.
Name() string
// Setup should create and verify whatever objects need to
// exist before the upgrade disruption starts.
Setup(f *framework.Framework)
// Test will run during the upgrade. When the upgrade is
// complete, done will be closed and final validation can
// begin.
Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
// TearDown should clean up any objects that are created that
// aren't already cleaned up by the framework.
Teardown(f *framework.Framework)
}
Test is an interface for upgrade tests.
type UpgradeContext ¶
type UpgradeContext struct {
Versions []VersionContext
}
UpgradeContext contains information about all the stages of the upgrade that is going to occur.
type UpgradeType ¶
type UpgradeType int
UpgradeType represents different types of upgrades.
const (
// MasterUpgrade indicates that only the master is being upgraded.
MasterUpgrade UpgradeType = iota
// NodeUpgrade indicates that only the nodes are being upgraded.
NodeUpgrade
// ClusterUpgrade indicates that both master and nodes are
// being upgraded.
ClusterUpgrade
// EtcdUpgrade indicates that only etcd is being upgraded (or migrated
// between storage versions).
EtcdUpgrade
)
type VersionContext ¶
type VersionContext struct {
Version version.Version
NodeImage string
}
VersionContext represents a stage of the upgrade.