kubernetes: k8s.io/kubernetes/test/e2e/upgrades Index | Files | Directories

package upgrades

import "k8s.io/kubernetes/test/e2e/upgrades"

Package upgrades provides a framework for testing Kubernetes features before, during, and after different types of upgrades.

Index

Package Files

apparmor.go cassandra.go configmaps.go etcd.go horizontal_pod_autoscalers.go kube_proxy_migration.go mysql.go nvidia-gpu.go secrets.go services.go sysctl.go upgrade.go

type AppArmorUpgradeTest Uses

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

AppArmorUpgradeTest tests that AppArmor profiles are enforced & usable across upgrades.

func (AppArmorUpgradeTest) Name Uses

func (AppArmorUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*AppArmorUpgradeTest) Setup Uses

func (t *AppArmorUpgradeTest) Setup(f *framework.Framework)

Setup creates a secret and then verifies that a pod can consume it.

func (AppArmorUpgradeTest) Skip Uses

func (AppArmorUpgradeTest) Skip(upgCtx UpgradeContext) bool

Skip returns true when this test can be skipped.

func (*AppArmorUpgradeTest) Teardown Uses

func (t *AppArmorUpgradeTest) Teardown(f *framework.Framework)

Teardown cleans up any remaining resources.

func (*AppArmorUpgradeTest) Test Uses

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 Uses

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

CassandraUpgradeTest ups and verifies that a Cassandra StatefulSet behaves well across upgrades.

func (CassandraUpgradeTest) Name Uses

func (CassandraUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*CassandraUpgradeTest) Setup Uses

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 Uses

func (CassandraUpgradeTest) Skip(upgCtx UpgradeContext) bool

Skip returns true when this test can be skipped.

func (*CassandraUpgradeTest) Teardown Uses

func (t *CassandraUpgradeTest) Teardown(f *framework.Framework)

Teardown does one final check of the data's availability.

func (*CassandraUpgradeTest) Test Uses

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 Uses

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

ConfigMapUpgradeTest tests that a ConfigMap is available before and after a cluster upgrade.

func (ConfigMapUpgradeTest) Name Uses

func (ConfigMapUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*ConfigMapUpgradeTest) Setup Uses

func (t *ConfigMapUpgradeTest) Setup(f *framework.Framework)

Setup creates a ConfigMap and then verifies that a pod can consume it.

func (*ConfigMapUpgradeTest) Teardown Uses

func (t *ConfigMapUpgradeTest) Teardown(f *framework.Framework)

Teardown cleans up any remaining resources.

func (*ConfigMapUpgradeTest) Test Uses

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 Uses

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

EtcdUpgradeTest tests that etcd is writable before and after a cluster upgrade.

func (EtcdUpgradeTest) Name Uses

func (EtcdUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*EtcdUpgradeTest) Setup Uses

func (t *EtcdUpgradeTest) Setup(f *framework.Framework)

Setup creates etcd statefulset and then verifies that the etcd is writable.

func (EtcdUpgradeTest) Skip Uses

func (EtcdUpgradeTest) Skip(upgCtx UpgradeContext) bool

Skip returns true when this test can be skipped.

func (*EtcdUpgradeTest) Teardown Uses

func (t *EtcdUpgradeTest) Teardown(f *framework.Framework)

Teardown does one final check of the data's availability.

func (*EtcdUpgradeTest) Test Uses

func (t *EtcdUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)

Test waits for upgrade to complete and verifies if etcd is writable.

type HPAUpgradeTest Uses

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 Uses

func (HPAUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*HPAUpgradeTest) Setup Uses

func (t *HPAUpgradeTest) Setup(f *framework.Framework)

Setup creates a resource consumer and an HPA object that autoscales the consumer.

func (*HPAUpgradeTest) Teardown Uses

func (t *HPAUpgradeTest) Teardown(f *framework.Framework)

Teardown cleans up any remaining resources.

func (*HPAUpgradeTest) Test Uses

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 KubeProxyDowngradeTest Uses

type KubeProxyDowngradeTest struct {
}

KubeProxyDowngradeTest tests kube-proxy DaemonSet -> static pods downgrade path.

func (KubeProxyDowngradeTest) Name Uses

func (KubeProxyDowngradeTest) Name() string

Name returns the tracking name of the test.

func (*KubeProxyDowngradeTest) Setup Uses

func (t *KubeProxyDowngradeTest) Setup(f *framework.Framework)

Setup verifies kube-proxy DaemonSet is running before upgrade.

func (*KubeProxyDowngradeTest) Teardown Uses

func (t *KubeProxyDowngradeTest) Teardown(f *framework.Framework)

Teardown does nothing.

func (*KubeProxyDowngradeTest) Test Uses

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 Uses

type KubeProxyUpgradeTest struct {
}

KubeProxyUpgradeTest tests kube-proxy static pods -> DaemonSet upgrade path.

func (KubeProxyUpgradeTest) Name Uses

func (KubeProxyUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*KubeProxyUpgradeTest) Setup Uses

func (t *KubeProxyUpgradeTest) Setup(f *framework.Framework)

Setup verifies kube-proxy static pods is running before upgrade.

func (*KubeProxyUpgradeTest) Teardown Uses

func (t *KubeProxyUpgradeTest) Teardown(f *framework.Framework)

Teardown does nothing.

func (*KubeProxyUpgradeTest) Test Uses

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 Uses

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

MySQLUpgradeTest implements an upgrade test harness that polls a replicated sql database.

func (MySQLUpgradeTest) Name Uses

func (MySQLUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*MySQLUpgradeTest) Setup Uses

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 Uses

func (MySQLUpgradeTest) Skip(upgCtx UpgradeContext) bool

Skip returns true when this test can be skipped.

func (*MySQLUpgradeTest) Teardown Uses

func (t *MySQLUpgradeTest) Teardown(f *framework.Framework)

Teardown performs one final check of the data's availability.

func (*MySQLUpgradeTest) Test Uses

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 NvidiaGPUUpgradeTest Uses

type NvidiaGPUUpgradeTest struct {
}

NvidiaGPUUpgradeTest tests that gpu resource is available before and after a cluster upgrade.

func (NvidiaGPUUpgradeTest) Name Uses

func (NvidiaGPUUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*NvidiaGPUUpgradeTest) Setup Uses

func (t *NvidiaGPUUpgradeTest) Setup(f *framework.Framework)

Setup creates a job requesting gpu.

func (*NvidiaGPUUpgradeTest) Teardown Uses

func (t *NvidiaGPUUpgradeTest) Teardown(f *framework.Framework)

Teardown cleans up any remaining resources.

func (*NvidiaGPUUpgradeTest) Test Uses

func (t *NvidiaGPUUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)

Test waits for the upgrade to complete, and then verifies that the cuda pod started by the gpu job can successfully finish.

type SecretUpgradeTest Uses

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

SecretUpgradeTest test that a secret is available before and after a cluster upgrade.

func (SecretUpgradeTest) Name Uses

func (SecretUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*SecretUpgradeTest) Setup Uses

func (t *SecretUpgradeTest) Setup(f *framework.Framework)

Setup creates a secret and then verifies that a pod can consume it.

func (*SecretUpgradeTest) Teardown Uses

func (t *SecretUpgradeTest) Teardown(f *framework.Framework)

Teardown cleans up any remaining resources.

func (*SecretUpgradeTest) Test Uses

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 Uses

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 Uses

func (ServiceUpgradeTest) Name() string

Name returns the tracking name of the test.

func (*ServiceUpgradeTest) Setup Uses

func (t *ServiceUpgradeTest) Setup(f *framework.Framework)

Setup creates a service with a load balancer and makes sure it's reachable.

func (*ServiceUpgradeTest) Teardown Uses

func (t *ServiceUpgradeTest) Teardown(f *framework.Framework)

Teardown cleans up any remaining resources.

func (*ServiceUpgradeTest) Test Uses

func (t *ServiceUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)

Test runs a connectivity check to the service.

type Skippable Uses

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 Uses

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

SysctlUpgradeTest 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 Uses

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 Uses

func (t *SysctlUpgradeTest) Teardown(f *framework.Framework)

Teardown cleans up any remaining resources.

func (*SysctlUpgradeTest) Test Uses

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 Uses

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 Uses

type UpgradeContext struct {
    Versions []VersionContext
}

UpgradeContext contains information about all the stages of the upgrade that is going to occur.

type UpgradeType Uses

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 Uses

type VersionContext struct {
    Version   version.Version
    NodeImage string
}

VersionContext represents a stage of the upgrade.

Directories

PathSynopsis
apps
storage

Package upgrades imports 32 packages (graph) and is imported by 144 packages. Updated 2019-11-15. Refresh now. Tools for package owners.