upgrades

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2017 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

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

Index

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

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

func (AppArmorUpgradeTest) Skip

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 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) Setup

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 DaemonSetUpgradeTest

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

DaemonSetUpgradeTest tests that a DaemonSet is running before and after a cluster upgrade.

func (DaemonSetUpgradeTest) Name

func (*DaemonSetUpgradeTest) Setup

Setup creates a DaemonSet and verifies that it's running

func (*DaemonSetUpgradeTest) Teardown

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

Teardown cleans up any remaining resources.

func (*DaemonSetUpgradeTest) Test

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

Test waits until the upgrade has completed and then verifies that the DaemonSet is still 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) Name

func (*DeploymentUpgradeTest) Setup

Setup creates a deployment and makes sure it has a new and an old replica set running. This calls in to client code and should not be expected to work against a cluster more than one minor version away from the current version.

func (DeploymentUpgradeTest) Skip added in v1.7.0

func (*DeploymentUpgradeTest) Teardown

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

Teardown cleans up any remaining resources.

func (*DeploymentUpgradeTest) Test

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

Test checks whether the replica sets for a deployment are the same after an upgrade.

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.

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 JobUpgradeTest

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

JobUpgradeTest is a test harness for batch Jobs.

func (JobUpgradeTest) Name

func (JobUpgradeTest) Name() string

func (*JobUpgradeTest) Setup

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

Setup starts a Job with a parallelism of 2 and 2 completions running.

func (*JobUpgradeTest) Teardown

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

Teardown cleans up any remaining resources.

func (*JobUpgradeTest) Test

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

Test verifies that the Jobs Pods are running after the an upgrade

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) Name

func (*PersistentVolumeUpgradeTest) Setup

Setup creates a pv and then verifies that a pod can consume it. The pod writes data to the volume.

func (*PersistentVolumeUpgradeTest) Teardown

Teardown cleans up any remaining resources.

func (*PersistentVolumeUpgradeTest) Test

func (t *PersistentVolumeUpgradeTest) 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 pv and that the volume data persists.

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 StatefulSetUpgradeTest

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

StatefulSetUpgradeTest implements an upgrade test harness for StatefulSet upgrade testing.

func (StatefulSetUpgradeTest) Name

func (*StatefulSetUpgradeTest) Setup

Setup creates a StatefulSet and a HeadlessService. It verifies the basic SatefulSet properties

func (StatefulSetUpgradeTest) Skip

func (*StatefulSetUpgradeTest) Teardown

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

Deletes all StatefulSets

func (*StatefulSetUpgradeTest) Test

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

Waits for the upgrade to complete and verifies the StatefulSet basic functionality

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
)

type VersionContext

type VersionContext struct {
	Version   version.Version
	NodeImage string
}

VersionContext represents a stage of the upgrade.

Jump to

Keyboard shortcuts

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