fargate

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// VCPU is one virtual CPU core in EC2.
	VCPU int64 = 1024
	// MiB is 2^20 bytes.
	MiB int64 = 1024 * 1024
	// GiB is 2^30 bytes.
	GiB int64 = 1024 * MiB
)

Variables

View Source
var (
	// FargateRegions are AWS regions where Fargate is available.
	FargateRegions = Regions{
		"ap-northeast-1",
		"eu-west-1",
		"us-east-1",
		"us-east-2",
		"us-west-2",
	}
)

Functions

This section is empty.

Types

type Client

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

Client communicates with the regional AWS Fargate service.

type Cluster

type Cluster struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Cluster represents a Fargate cluster.

func NewCluster

func NewCluster(config *ClusterConfig) (*Cluster, error)

NewCluster creates a new Cluster object.

func (*Cluster) GetContainerLogs

func (c *Cluster) GetContainerLogs(namespace, podName, containerName string, tail int) (string, error)

GetContainerLogs returns the logs of a container from this cluster.

func (*Cluster) GetPod

func (c *Cluster) GetPod(namespace string, name string) (*Pod, error)

GetPod returns a Kubernetes pod deployed on this cluster.

func (*Cluster) GetPods

func (c *Cluster) GetPods() ([]*Pod, error)

GetPods returns all Kubernetes pods deployed on this cluster.

func (*Cluster) InsertPod

func (c *Cluster) InsertPod(pod *Pod, tag string)

InsertPod inserts a Kubernetes pod to this cluster.

func (*Cluster) RemovePod

func (c *Cluster) RemovePod(tag string)

RemovePod removes a Kubernetes pod from this cluster.

type ClusterConfig

type ClusterConfig struct {
	Region                  string
	Name                    string
	NodeName                string
	Subnets                 []string
	SecurityGroups          []string
	AssignPublicIPv4Address bool
	ExecutionRoleArn        string
	CloudWatchLogGroupName  string
	PlatformVersion         string
}

ClusterConfig contains a Fargate cluster's configurable parameters.

type Pod

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

Pod is the representation of a Kubernetes pod in Fargate.

func NewPod

func NewPod(cluster *Cluster, pod *corev1.Pod) (*Pod, error)

NewPod creates a new Kubernetes pod on Fargate.

func NewPodFromTag

func NewPodFromTag(cluster *Cluster, tag string) (*Pod, error)

NewPodFromTag creates a new pod identified by a tag.

func (*Pod) GetSpec

func (pod *Pod) GetSpec() (*corev1.Pod, error)

GetSpec returns the specification of a Kubernetes pod on Fargate.

func (*Pod) GetStatus

func (pod *Pod) GetStatus() corev1.PodStatus

GetStatus returns the status of a Kubernetes pod on Fargate.

func (*Pod) Start

func (pod *Pod) Start() error

Start deploys and runs a Kubernetes pod on Fargate.

func (*Pod) Stop

func (pod *Pod) Stop() error

Stop stops a running Kubernetes pod on Fargate.

type Regions

type Regions []string

Regions is the set of AWS regions where a service is available. https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/

func (Regions) Include

func (r Regions) Include(region string) bool

Include returns whether the region set includes the given region.

func (Regions) Names

func (r Regions) Names() []string

Names returns an array of region names.

Jump to

Keyboard shortcuts

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