deploy

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BearerTokenRetriever

type BearerTokenRetriever interface {
	RetrieveToken() string
}

BearerTokenRetriever represents any struct that can return a Bearer token. This supports both long-lived tokens (say from an environment variable) or short-lived tokens that need to be refreshed regularly.

type Deployer

type Deployer interface {
	Deploy(containerTag string) error
}

Deployer represents any struct that can deploy a container

type KubernetesClusterNamespace

type KubernetesClusterNamespace struct {
	Description  string
	PodRetriever PodListRetriever
	DeployMaker  Deployer
}

KubernetesClusterNamespace is a struct used to connect to a Kubernetes cluster.

func (*KubernetesClusterNamespace) Deploy

func (n *KubernetesClusterNamespace) Deploy(containerTag string) error

Deploy changes the image for an existing deployment and Kubernetes rebuilds the pods

func (*KubernetesClusterNamespace) GetPodList

func (n *KubernetesClusterNamespace) GetPodList() (*PodList, error)

GetPodList retrieves all the pods running in a deployment

type KubernetesDeployer

type KubernetesDeployer struct {
	Client             *http.Client
	Endpoint           string
	Namespace          string
	DeploymentName     string
	ContainerName      string
	ContainerImage     string
	BearerTokenService BearerTokenRetriever
}

KubernetesDeployer updates a deployment via Kubernetes API

func (*KubernetesDeployer) Deploy

func (d *KubernetesDeployer) Deploy(containerTag string) error

Deploy a container via Kubernetes API

type KubernetesPodListRetriever

type KubernetesPodListRetriever struct {
	Client             *http.Client
	Endpoint           string
	Namespace          string
	BearerTokenService BearerTokenRetriever
}

KubernetesPodListRetriever retrieves pods via Kubernetes API

func (*KubernetesPodListRetriever) PodInformation

func (p *KubernetesPodListRetriever) PodInformation() (*PodList, error)

PodInformation retrieved from Kubernetes API

type PodContainerStatuses

type PodContainerStatuses struct {
	State PodContainerStatusesState `json:"state"`
	Image string                    `json:"image,omitempty"`
}

PodContainerStatuses used for determining what state the container is in.

type PodContainerStatusesState

type PodContainerStatusesState struct {
	Running *PodContainerStatusesStateRunning `json:"running,omitempty"`
	Waiting *PodContainerStatusesStateWaiting `json:"waiting,omitempty"`
}

PodContainerStatusesState is part of PodList response coming back from Kubernetes

type PodContainerStatusesStateRunning

type PodContainerStatusesStateRunning struct {
	StartedAt time.Time `json:"startedAt"`
}

PodContainerStatusesStateRunning is part of PodList response coming back from Kubernetes

type PodContainerStatusesStateWaiting

type PodContainerStatusesStateWaiting struct {
	Reason string `json:"reason"`
}

PodContainerStatusesStateWaiting is part of PodList response coming back from Kubernetes

type PodDeployResponse

type PodDeployResponse struct {
	Status PodDeployStatus `json:"status"`
}

PodDeployResponse is part of the deployment response coming back from Kubernetes

type PodDeployStatus

type PodDeployStatus struct {
	AvailableReplicas int `json:"availableReplicas"`
}

PodDeployStatus has details about what state the Pod is in.

type PodItem

type PodItem struct {
	Name    string
	Status  string
	Created time.Time
	Tag     string
}

PodItem is an app specific summary status coming back from pods

type PodList

type PodList struct {
	Items []PodMetadataContainer `json:"items"`
}

PodList holds a Kubernetes PodList.

func (*PodList) FilterByDeployment added in v1.1.0

func (p *PodList) FilterByDeployment(namePrefix string) *PodList

FilterByDeployment returns a new PodList with only deployment names that match prefix. Handy for only retrieving specific deployment when running multiple deployments in same namespace.

func (*PodList) Overview

func (p *PodList) Overview() []PodItem

Overview for a group of pods in a deployment

type PodListRetriever

type PodListRetriever interface {
	PodInformation() (*PodList, error)
}

PodListRetriever represents any struct that returns a PodList

type PodMetadataContainer

type PodMetadataContainer struct {
	Metadata PodMetadataDetail `json:"metadata"`
	Status   PodStatus         `json:"status"`
}

PodMetadataContainer houses PodMetadataDetail values.

type PodMetadataDetail

type PodMetadataDetail struct {
	Name              string    `json:"name"`
	CreationTimestamp time.Time `json:"creationTimestamp"`
}

PodMetadataDetail has details about an individual Kubernetes Pod.

type PodStatus

type PodStatus struct {
	Phase             string                 `json:"phase"`
	ContainerStatuses []PodContainerStatuses `json:"containerStatuses"`
}

PodStatus has details about what state the Pod is in.

Jump to

Keyboard shortcuts

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