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 CassandraUpgradeTest
- func (CassandraUpgradeTest) Name() string
- func (t *CassandraUpgradeTest) Setup(f *framework.Framework)
- func (CassandraUpgradeTest) Skip(upgCtx UpgradeContext) bool
- func (t *CassandraUpgradeTest) Teardown(f *framework.Framework)
- func (t *CassandraUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
- type ConfigMapUpgradeTest
- type EtcdUpgradeTest
- func (EtcdUpgradeTest) Name() string
- func (t *EtcdUpgradeTest) Setup(f *framework.Framework)
- func (EtcdUpgradeTest) Skip(upgCtx UpgradeContext) bool
- func (t *EtcdUpgradeTest) Teardown(f *framework.Framework)
- func (t *EtcdUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
- type GCPResourceStore
- type HPAUpgradeTest
- type IngressUpgradeTest
- type KubeProxyDowngradeTest
- type KubeProxyUpgradeTest
- type MySqlUpgradeTest
- func (MySqlUpgradeTest) Name() string
- func (t *MySqlUpgradeTest) Setup(f *framework.Framework)
- func (MySqlUpgradeTest) Skip(upgCtx UpgradeContext) bool
- func (t *MySqlUpgradeTest) Teardown(f *framework.Framework)
- func (t *MySqlUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
- type SecretUpgradeTest
- type ServiceUpgradeTest
- type Skippable
- 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) Name ¶
func (AppArmorUpgradeTest) Name() string
func (*AppArmorUpgradeTest) Setup ¶
func (t *AppArmorUpgradeTest) Setup(f *framework.Framework)
Setup creates a secret and then verifies that a pod can consume it.
func (AppArmorUpgradeTest) Skip ¶
func (AppArmorUpgradeTest) Skip(upgCtx UpgradeContext) bool
func (*AppArmorUpgradeTest) Teardown ¶
func (t *AppArmorUpgradeTest) Teardown(f *framework.Framework)
Teardown cleans up any remaining resources.
func (*AppArmorUpgradeTest) Test ¶
func (t *AppArmorUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test waits for the upgrade to complete, and then verifies that a pod can still consume the secret.
type CassandraUpgradeTest ¶
type CassandraUpgradeTest struct {
// contains filtered or unexported fields
}
CassandraUpgradeTest ups and verifies that a Cassandra StatefulSet behaves well across upgrades.
func (CassandraUpgradeTest) Name ¶
func (CassandraUpgradeTest) Name() string
Name returns the tracking name of the test.
func (*CassandraUpgradeTest) Setup ¶
func (t *CassandraUpgradeTest) Setup(f *framework.Framework)
Setup creates a Cassandra StatefulSet and a PDB. It also brings up a tester ReplicaSet and associated service and PDB to guarantee availability during the upgrade. It waits for the system to stabilize before adding two users to verify connectivity.
func (CassandraUpgradeTest) Skip ¶
func (CassandraUpgradeTest) Skip(upgCtx UpgradeContext) bool
Skip returns true when this test can be skipped.
func (*CassandraUpgradeTest) Teardown ¶
func (t *CassandraUpgradeTest) Teardown(f *framework.Framework)
Teardown does one final check of the data's availability.
func (*CassandraUpgradeTest) Test ¶
func (t *CassandraUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test is called during the upgrade. It launches two goroutines, one continuously writes to the db and one reads from the db. Each attempt is tallied and at the end we verify if the success ratio is over a certain threshold (0.75). We also verify that we get at least the same number of rows back as we successfully wrote.
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) Name ¶
func (ConfigMapUpgradeTest) Name() string
func (*ConfigMapUpgradeTest) Setup ¶
func (t *ConfigMapUpgradeTest) Setup(f *framework.Framework)
Setup creates a ConfigMap and then verifies that a pod can consume it.
func (*ConfigMapUpgradeTest) Teardown ¶
func (t *ConfigMapUpgradeTest) Teardown(f *framework.Framework)
Teardown cleans up any remaining resources.
func (*ConfigMapUpgradeTest) Test ¶
func (t *ConfigMapUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test waits for the upgrade to complete, and then verifies that a pod can still consume the ConfigMap.
type EtcdUpgradeTest ¶
type EtcdUpgradeTest struct {
// contains filtered or unexported fields
}
func (EtcdUpgradeTest) Name ¶
func (EtcdUpgradeTest) Name() string
func (*EtcdUpgradeTest) Setup ¶
func (t *EtcdUpgradeTest) Setup(f *framework.Framework)
func (EtcdUpgradeTest) Skip ¶
func (EtcdUpgradeTest) Skip(upgCtx UpgradeContext) bool
func (*EtcdUpgradeTest) Teardown ¶
func (t *EtcdUpgradeTest) Teardown(f *framework.Framework)
Teardown does one final check of the data's availability.
func (*EtcdUpgradeTest) Test ¶
func (t *EtcdUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
type GCPResourceStore ¶
type GCPResourceStore struct { Fw *compute.Firewall FwdList []*compute.ForwardingRule UmList []*compute.UrlMap TpList []*compute.TargetHttpProxy TpsList []*compute.TargetHttpsProxy SslList []*compute.SslCertificate BeList []*compute.BackendService Ip *compute.Address IgList []*compute.InstanceGroup }
GCPResourceStore keeps track of the GCP resources spun up by an ingress. Note: Fields are exported so that we can utilize reflection.
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) Name ¶
func (HPAUpgradeTest) Name() string
func (*HPAUpgradeTest) Setup ¶
func (t *HPAUpgradeTest) Setup(f *framework.Framework)
Creates a resource consumer and an HPA object that autoscales the consumer.
func (*HPAUpgradeTest) Teardown ¶
func (t *HPAUpgradeTest) Teardown(f *framework.Framework)
Teardown cleans up any remaining resources.
func (*HPAUpgradeTest) Test ¶
func (t *HPAUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test waits for upgrade to complete and verifies if HPA works correctly.
type IngressUpgradeTest ¶
type IngressUpgradeTest struct {
// contains filtered or unexported fields
}
IngressUpgradeTest adapts the Ingress e2e for upgrade testing
func (IngressUpgradeTest) Name ¶
func (IngressUpgradeTest) Name() string
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. Also keeps track of all load balancer resources for cross-checking during an IngressUpgrade.
func (*IngressUpgradeTest) Teardown ¶
func (t *IngressUpgradeTest) Teardown(f *framework.Framework)
Teardown cleans up any remaining resources.
func (*IngressUpgradeTest) Test ¶
func (t *IngressUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test waits for the upgrade to complete, and then verifies with a connectvity check to the loadbalancer ip.
type KubeProxyDowngradeTest ¶
type KubeProxyDowngradeTest struct { }
KubeProxyDowngradeTest tests kube-proxy DaemonSet -> static pods downgrade path.
func (KubeProxyDowngradeTest) Name ¶
func (KubeProxyDowngradeTest) Name() string
func (*KubeProxyDowngradeTest) Setup ¶
func (t *KubeProxyDowngradeTest) Setup(f *framework.Framework)
Setup verifies kube-proxy DaemonSet is running before uprgade.
func (*KubeProxyDowngradeTest) Teardown ¶
func (t *KubeProxyDowngradeTest) Teardown(f *framework.Framework)
Teardown does nothing.
func (*KubeProxyDowngradeTest) Test ¶
func (t *KubeProxyDowngradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test validates if kube-proxy is migrated from DaemonSet to static pods.
type KubeProxyUpgradeTest ¶
type KubeProxyUpgradeTest struct { }
KubeProxyUpgradeTest tests kube-proxy static pods -> DaemonSet upgrade path.
func (KubeProxyUpgradeTest) Name ¶
func (KubeProxyUpgradeTest) Name() string
func (*KubeProxyUpgradeTest) Setup ¶
func (t *KubeProxyUpgradeTest) Setup(f *framework.Framework)
Setup verifies kube-proxy static pods is running before uprgade.
func (*KubeProxyUpgradeTest) Teardown ¶
func (t *KubeProxyUpgradeTest) Teardown(f *framework.Framework)
Teardown does nothing.
func (*KubeProxyUpgradeTest) Test ¶
func (t *KubeProxyUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test validates if kube-proxy is migrated from static pods to DaemonSet.
type MySqlUpgradeTest ¶
type MySqlUpgradeTest struct {
// contains filtered or unexported fields
}
MySqlUpgradeTest implements an upgrade test harness that polls a replicated sql database.
func (MySqlUpgradeTest) Name ¶
func (MySqlUpgradeTest) Name() string
func (*MySqlUpgradeTest) Setup ¶
func (t *MySqlUpgradeTest) Setup(f *framework.Framework)
Setup creates a StatefulSet, HeadlessService, a Service to write to the db, and a Service to read from the db. It then connects to the db with the write Service and populates the db with a table and a few entries. Finally, it connects to the db with the read Service, and confirms the data is available. The db connections are left open to be used later in the test.
func (MySqlUpgradeTest) Skip ¶
func (MySqlUpgradeTest) Skip(upgCtx UpgradeContext) bool
func (*MySqlUpgradeTest) Teardown ¶
func (t *MySqlUpgradeTest) Teardown(f *framework.Framework)
Teardown performs one final check of the data's availability.
func (*MySqlUpgradeTest) Test ¶
func (t *MySqlUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test continually polls the db using the read and write connections, inserting data, and checking that all the data is readable.
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) Name ¶
func (SecretUpgradeTest) Name() string
func (*SecretUpgradeTest) Setup ¶
func (t *SecretUpgradeTest) Setup(f *framework.Framework)
Setup creates a secret and then verifies that a pod can consume it.
func (*SecretUpgradeTest) Teardown ¶
func (t *SecretUpgradeTest) Teardown(f *framework.Framework)
Teardown cleans up any remaining resources.
func (*SecretUpgradeTest) Test ¶
func (t *SecretUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test waits for the upgrade to complete, and then verifies that a pod can still consume the secret.
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) Name ¶
func (ServiceUpgradeTest) Name() string
func (*ServiceUpgradeTest) Setup ¶
func (t *ServiceUpgradeTest) Setup(f *framework.Framework)
Setup creates a service with a load balancer and makes sure it's reachable.
func (*ServiceUpgradeTest) Teardown ¶
func (t *ServiceUpgradeTest) Teardown(f *framework.Framework)
Teardown cleans up any remaining resources.
func (*ServiceUpgradeTest) Test ¶
func (t *ServiceUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test runs a connectivity check to the service.
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 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.
func (*SysctlUpgradeTest) Teardown ¶
func (t *SysctlUpgradeTest) Teardown(f *framework.Framework)
Teardown cleans up any remaining resources.
func (*SysctlUpgradeTest) Test ¶
func (t *SysctlUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
Test waits for the upgrade to complete, and then verifies that a pod can still consume the ConfigMap.
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. This will // always be called, even if Setup failed. 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 // IngressUpgrade indicates that only ingress is being upgraded. IngressUpgrade )
type VersionContext ¶
VersionContext represents a stage of the upgrade.