spec

package
v0.0.0-...-e218867 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 5000

	SlugAnnotation = "teresa.io/slug"

	DefaultExternalPort = 80
)
View Source
const AppSecretName = "secrets"
View Source
const (
	NginxConfFile = "nginx.conf"
)

Variables

This section is empty.

Functions

func MountConfigMapInSideCar

func MountConfigMapInSideCar(name, path, configMapName string) func(*PodBuilder)

func MountSecretInAppContainer

func MountSecretInAppContainer(name, path, secretName string) func(*PodBuilder)

func MountSecretInInitContainer

func MountSecretInInitContainer(name, path, secretName string) func(*PodBuilder)

func MountSecretItemsInAppContainer

func MountSecretItemsInAppContainer(name, path, secretName string, items []string) func(*PodBuilder)

func ShareVolumeBetweenAppAndInitContainer

func ShareVolumeBetweenAppAndInitContainer(name, path string) func(*PodBuilder)

func ShareVolumeBetweenAppAndSideCar

func ShareVolumeBetweenAppAndSideCar(name, path string) func(*PodBuilder)

func SwitchPortWithAppContainer

func SwitchPortWithAppContainer(b *PodBuilder)

Types

type BuildPodBuilder

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

func NewBuildPodBuilder

func NewBuildPodBuilder(name, image string) *BuildPodBuilder

func (*BuildPodBuilder) Build

func (b *BuildPodBuilder) Build() *Pod

func (*BuildPodBuilder) ForApp

func (b *BuildPodBuilder) ForApp(a *app.App) *BuildPodBuilder

func (*BuildPodBuilder) SendSlugTo

func (b *BuildPodBuilder) SendSlugTo(dest string) *BuildPodBuilder

func (*BuildPodBuilder) WithLimits

func (b *BuildPodBuilder) WithLimits(cpu, memory string) *BuildPodBuilder

func (*BuildPodBuilder) WithStorage

func (b *BuildPodBuilder) WithStorage(fs storage.Storage) *BuildPodBuilder

func (*BuildPodBuilder) WithTarBallPath

func (b *BuildPodBuilder) WithTarBallPath(path string) *BuildPodBuilder

type CloudSQLProxy

type CloudSQLProxy struct {
	Instances      string
	CredentialFile string `yaml:"credentialFile"`
	Image          string `yaml:"-"`
}

func NewCloudSQLProxy

func NewCloudSQLProxy(img string, t *TeresaYaml) (*CloudSQLProxy, error)

type Container

type Container struct {
	Name            string
	Image           string
	ContainerLimits *ContainerLimits
	Env             map[string]string
	VolumeMounts    []*VolumeMounts
	Command         []string
	Args            []string
	Ports           []Port
	Secrets         []string
}

func NewCloudSQLProxyContainer

func NewCloudSQLProxyContainer(csp *CloudSQLProxy, a *app.App) *Container

func NewInitContainer

func NewInitContainer(image, slugURL string, fs storage.Storage) *Container

func NewNginxContainer

func NewNginxContainer(image string, a *app.App) *Container

type ContainerBuilder

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

func NewContainerBuilder

func NewContainerBuilder(name, image string) *ContainerBuilder

func (*ContainerBuilder) Build

func (b *ContainerBuilder) Build() *Container

func (*ContainerBuilder) ExposePort

func (b *ContainerBuilder) ExposePort(name string, port int) *ContainerBuilder

func (*ContainerBuilder) WithArgs

func (b *ContainerBuilder) WithArgs(args []string) *ContainerBuilder

func (*ContainerBuilder) WithCommand

func (b *ContainerBuilder) WithCommand(cmd []string) *ContainerBuilder

func (*ContainerBuilder) WithEnv

func (b *ContainerBuilder) WithEnv(ev map[string]string) *ContainerBuilder

func (*ContainerBuilder) WithLimits

func (b *ContainerBuilder) WithLimits(cpu, memory string) *ContainerBuilder

func (*ContainerBuilder) WithSecrets

func (b *ContainerBuilder) WithSecrets(s []string) *ContainerBuilder

func (*ContainerBuilder) WithVolumeMount

func (b *ContainerBuilder) WithVolumeMount(name, mountPath, subPath string) *ContainerBuilder

type ContainerLimits

type ContainerLimits struct {
	CPU    string
	Memory string
}

type CronArgs

type CronArgs struct {
	Schedule string `yaml:"schedule",omitempty"`
}

type CronJob

type CronJob struct {
	Deploy
	Schedule                   string
	SuccessfulJobsHistoryLimit int32
	FailedJobsHistoryLimit     int32
}

type CronJobBuilder

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

func NewCronJobBuilder

func NewCronJobBuilder(slugURL string) *CronJobBuilder

func (*CronJobBuilder) Build

func (b *CronJobBuilder) Build() *CronJob

func (*CronJobBuilder) WithDescription

func (b *CronJobBuilder) WithDescription(description string) *CronJobBuilder

func (*CronJobBuilder) WithPod

func (b *CronJobBuilder) WithPod(p *Pod) *CronJobBuilder

func (*CronJobBuilder) WithSchedule

func (b *CronJobBuilder) WithSchedule(s string) *CronJobBuilder

type Deploy

type Deploy struct {
	Pod
	TeresaYaml
	RevisionHistoryLimit int
	Description          string
	SlugURL              string
	MatchLabels          Labels
}

type DeployBuilder

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

func NewDeployBuilder

func NewDeployBuilder(slugURL string) *DeployBuilder

func (*DeployBuilder) Build

func (b *DeployBuilder) Build() *Deploy

func (*DeployBuilder) WithDescription

func (b *DeployBuilder) WithDescription(desc string) *DeployBuilder

func (*DeployBuilder) WithMatchLabels

func (b *DeployBuilder) WithMatchLabels(lb Labels) *DeployBuilder

func (*DeployBuilder) WithPod

func (b *DeployBuilder) WithPod(p *Pod) *DeployBuilder

func (*DeployBuilder) WithRevisionHistoryLimit

func (b *DeployBuilder) WithRevisionHistoryLimit(rhl int) *DeployBuilder

func (*DeployBuilder) WithTeresaYaml

func (b *DeployBuilder) WithTeresaYaml(ty *TeresaYaml) *DeployBuilder

type HealthCheck

type HealthCheck struct {
	Liveness  *HealthCheckProbe
	Readiness *HealthCheckProbe
}

type HealthCheckProbe

type HealthCheckProbe struct {
	FailureThreshold    int32  `yaml:"failureThreshold"`
	InitialDelaySeconds int32  `yaml:"initialDelaySeconds"`
	PeriodSeconds       int32  `yaml:"periodSeconds"`
	SuccessThreshold    int32  `yaml:"successThreshold"`
	TimeoutSeconds      int32  `yaml:"timeoutSeconds"`
	Path                string `yaml:"path"`
}

type Labels

type Labels map[string]string

type Lifecycle

type Lifecycle struct {
	PreStop *PreStop `yaml:"preStop,omitempty"`
}

type Pod

type Pod struct {
	Name           string
	Namespace      string
	Containers     []*Container
	Volumes        []*Volume
	InitContainers []*Container
	Labels         Labels
}

type PodBuilder

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

func NewPodBuilder

func NewPodBuilder(name, namespace string) *PodBuilder

func (*PodBuilder) Build

func (b *PodBuilder) Build() *Pod

func (*PodBuilder) WithAppContainer

func (b *PodBuilder) WithAppContainer(cn *Container, options ...func(*PodBuilder)) *PodBuilder

func (*PodBuilder) WithInitContainer

func (b *PodBuilder) WithInitContainer(cn *Container, options ...func(*PodBuilder)) *PodBuilder

func (*PodBuilder) WithLabels

func (b *PodBuilder) WithLabels(lb Labels) *PodBuilder

func (*PodBuilder) WithSideCar

func (b *PodBuilder) WithSideCar(cn *Container, options ...func(*PodBuilder)) *PodBuilder

type Port

type Port struct {
	Name          string
	ContainerPort int32
}

type PreStop

type PreStop struct {
	DrainTimeoutSeconds int `yaml:"drainTimeoutSeconds,omitempty"`
}

type RawData

type RawData struct {
	Fn func(interface{}) error
}

func (*RawData) Unmarshal

func (r *RawData) Unmarshal(v interface{}) error

func (*RawData) UnmarshalYAML

func (r *RawData) UnmarshalYAML(unmarshal func(interface{}) error) error

type RollingUpdate

type RollingUpdate struct {
	MaxSurge       string `yaml:"maxSurge,omitempty"`
	MaxUnavailable string `yaml:"maxUnavailable,omitempty"`
}

type RunnerPodBuilder

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

func NewRunnerPodBuilder

func NewRunnerPodBuilder(name, image, initImage string) *RunnerPodBuilder

func (*RunnerPodBuilder) Build

func (b *RunnerPodBuilder) Build() *Pod

func (*RunnerPodBuilder) ForApp

func (b *RunnerPodBuilder) ForApp(a *app.App) *RunnerPodBuilder

func (*RunnerPodBuilder) WithArgs

func (b *RunnerPodBuilder) WithArgs(args []string) *RunnerPodBuilder

func (*RunnerPodBuilder) WithCloudSQLProxySideCar

func (b *RunnerPodBuilder) WithCloudSQLProxySideCar(csp *CloudSQLProxy) *RunnerPodBuilder

func (*RunnerPodBuilder) WithLabels

func (b *RunnerPodBuilder) WithLabels(lb Labels) *RunnerPodBuilder

func (*RunnerPodBuilder) WithLimits

func (b *RunnerPodBuilder) WithLimits(cpu, memory string) *RunnerPodBuilder

func (*RunnerPodBuilder) WithNginxSideCar

func (b *RunnerPodBuilder) WithNginxSideCar(image string) *RunnerPodBuilder

func (*RunnerPodBuilder) WithSlug

func (b *RunnerPodBuilder) WithSlug(url string) *RunnerPodBuilder

func (*RunnerPodBuilder) WithStorage

func (b *RunnerPodBuilder) WithStorage(fs storage.Storage) *RunnerPodBuilder

type Service

type Service struct {
	Name         string
	Namespace    string
	Type         string
	Labels       map[string]string
	Ports        []ServicePort
	SourceRanges []string
}

func NewDefaultService

func NewDefaultService(appName, sType, portName string) *Service

func NewService

func NewService(namespace, name, sType string, ports []ServicePort, labels map[string]string) *Service

type ServicePort

type ServicePort struct {
	Name       string
	Port       int
	TargetPort int
}

func NewDefaultServicePort

func NewDefaultServicePort(name string) *ServicePort

func NewServicePort

func NewServicePort(name string, port, targetPort int) *ServicePort

type TeresaYaml

type TeresaYaml struct {
	HealthCheck   *HealthCheck       `yaml:"healthCheck,omitempty"`
	RollingUpdate *RollingUpdate     `yaml:"rollingUpdate,omitempty"`
	Lifecycle     *Lifecycle         `yaml:"lifecycle,omitempty"`
	Cron          *CronArgs          `yaml:"cron,omitempty"`
	SideCars      map[string]RawData `yaml:"sidecars,omitempty"`
}

type TeresaYamlV2

type TeresaYamlV2 struct {
	Applications map[string]*TeresaYaml `yaml:"applications,omitempty"`
}

type Volume

type Volume struct {
	Name          string
	SecretName    string
	ConfigMapName string
	EmptyDir      bool
	Items         []VolumeItem
}

type VolumeItem

type VolumeItem struct {
	Key  string
	Path string
}

type VolumeMounts

type VolumeMounts struct {
	Name      string
	MountPath string
	SubPath   string
	ReadOnly  bool
}

Jump to

Keyboard shortcuts

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