k8s

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sProvider

type K8sProvider struct {
	Recorder record.EventRecorder
	Pod      *v1.Pod
	// contains filtered or unexported fields
}

func NewK8sProvider

func NewK8sProvider(cs kubernetes.Interface, ns string, stats stats.Stats, recordHistory bool) *K8sProvider

NewK8sProvider abstracts operation performed against Kubernetes resources such as syncing deployments config maps etc

func (*K8sProvider) CVWorkload

func (k *K8sProvider) CVWorkload(cv *cv1.ContainerVersion) ([]*Resource, error)

CVWorkload generates details about current workload resources managed by CVManager

func (*K8sProvider) SyncVersionConfig

func (k *K8sProvider) SyncVersionConfig(cv *cv1.ContainerVersion, version string) error

SyncVersionConfig sync the config map referenced by CV resource - creates if absent and updates if required The controller is not responsible for managing the config resource it reference but only for updating and ensuring its present. If the reference to config was removed from CV resource its not the responsibility of controller to remove it .. it assumes the configMap is external resource and not owned by cv resource

func (*K8sProvider) SyncWorkload

func (k *K8sProvider) SyncWorkload(cv *cv1.ContainerVersion, version string) error

SyncWorkload checks if container version of all workload that matches CV selector is up to date with the version thats requested, if not its performs a rollout with specified roll-out strategy on deployment

type Resource

type Resource struct {
	Namespace     string
	Name          string
	Type          string
	Container     string
	Version       string
	AvailablePods int32

	CV  string
	Tag string
}

Resource maintains a high level status of deployments managed by CV resources including version of current deploy and number of available pods from this deployment/replicaset

Jump to

Keyboard shortcuts

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