spec

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 8 Imported by: 24

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 added in v0.25.0

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

func MountSecretInAppContainer added in v0.25.0

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

func MountSecretInInitContainer added in v0.25.0

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

func MountSecretItemsInAppContainer added in v0.25.0

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

func ShareVolumeBetweenAppAndInitContainer added in v0.25.0

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

func ShareVolumeBetweenAppAndSideCar added in v0.25.0

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

func SwitchPortWithAppContainer added in v0.25.0

func SwitchPortWithAppContainer(b *PodBuilder)

Types

type BuildPodBuilder added in v0.25.0

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

func NewBuildPodBuilder added in v0.25.0

func NewBuildPodBuilder(name, image string) *BuildPodBuilder

func (*BuildPodBuilder) Build added in v0.25.0

func (b *BuildPodBuilder) Build() *Pod

func (*BuildPodBuilder) ForApp added in v0.25.0

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

func (*BuildPodBuilder) SendSlugTo added in v0.25.0

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

func (*BuildPodBuilder) WithLimits added in v0.25.0

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

func (*BuildPodBuilder) WithStorage added in v0.25.0

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

func (*BuildPodBuilder) WithTarBallPath added in v0.25.0

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

type CloudSQLProxy added in v0.25.0

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

func NewCloudSQLProxy added in v0.25.0

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

type Container added in v0.16.0

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

func NewCloudSQLProxyContainer added in v0.25.0

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

func NewInitContainer added in v0.25.0

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

func NewNginxContainer added in v0.25.0

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

type ContainerBuilder added in v0.25.0

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

func NewContainerBuilder added in v0.25.0

func NewContainerBuilder(name, image string) *ContainerBuilder

func (*ContainerBuilder) Build added in v0.25.0

func (b *ContainerBuilder) Build() *Container

func (*ContainerBuilder) ExposePort added in v0.25.0

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

func (*ContainerBuilder) WithArgs added in v0.25.0

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

func (*ContainerBuilder) WithCommand added in v0.25.0

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

func (*ContainerBuilder) WithEnv added in v0.25.0

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

func (*ContainerBuilder) WithLimits added in v0.25.0

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

func (*ContainerBuilder) WithRequests added in v0.34.0

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

func (*ContainerBuilder) WithSecrets added in v0.25.0

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

func (*ContainerBuilder) WithVolumeMount added in v0.25.0

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

type ContainerLimits

type ContainerLimits struct {
	CPU    string
	Memory string
}

type CronArgs added in v0.16.0

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

type CronJob added in v0.16.0

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

type CronJobBuilder added in v0.25.0

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

func NewCronJobBuilder added in v0.25.0

func NewCronJobBuilder(slugURL string) *CronJobBuilder

func (*CronJobBuilder) Build added in v0.25.0

func (b *CronJobBuilder) Build() *CronJob

func (*CronJobBuilder) WithDescription added in v0.25.0

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

func (*CronJobBuilder) WithPod added in v0.25.0

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

func (*CronJobBuilder) WithSchedule added in v0.25.0

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

type DNSConfig added in v0.32.0

type DNSConfig struct {
	Options []DNSOptions `yaml:"options"`
}

type DNSOptions added in v0.32.0

type DNSOptions struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type Deploy

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

type DeployBuilder added in v0.25.0

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

func NewDeployBuilder added in v0.25.0

func NewDeployBuilder(slugURL string) *DeployBuilder

func (*DeployBuilder) Build added in v0.25.0

func (b *DeployBuilder) Build() *Deploy

func (*DeployBuilder) WithDNSConfigNdots added in v0.32.0

func (b *DeployBuilder) WithDNSConfigNdots(ndots string) *DeployBuilder

func (*DeployBuilder) WithDescription added in v0.25.0

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

func (*DeployBuilder) WithMatchLabels added in v0.25.0

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

func (*DeployBuilder) WithPod added in v0.25.0

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

func (*DeployBuilder) WithRevisionHistoryLimit added in v0.25.0

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

func (*DeployBuilder) WithTeresaYaml added in v0.25.0

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 added in v0.20.0

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 added in v0.25.0

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

func NewPodBuilder added in v0.25.0

func NewPodBuilder(name, namespace string) *PodBuilder

func (*PodBuilder) Build added in v0.25.0

func (b *PodBuilder) Build() *Pod

func (*PodBuilder) WithAppContainer added in v0.25.0

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

func (*PodBuilder) WithInitContainer added in v0.25.0

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

func (*PodBuilder) WithLabels added in v0.25.0

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

func (*PodBuilder) WithSideCar added in v0.25.0

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

type Port added in v0.17.0

type Port struct {
	Name          string
	ContainerPort int32
}

type PreStop

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

type RawData added in v0.25.0

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

func (*RawData) Unmarshal added in v0.25.0

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

func (*RawData) UnmarshalYAML added in v0.25.0

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 added in v0.25.0

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

func NewRunnerPodBuilder added in v0.25.0

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

func (*RunnerPodBuilder) Build added in v0.25.0

func (b *RunnerPodBuilder) Build() *Pod

func (*RunnerPodBuilder) ForApp added in v0.25.0

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

func (*RunnerPodBuilder) WithArgs added in v0.25.0

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

func (*RunnerPodBuilder) WithCloudSQLProxySideCar added in v0.25.0

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

func (*RunnerPodBuilder) WithLabels added in v0.25.0

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

func (*RunnerPodBuilder) WithLimits added in v0.25.0

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

func (*RunnerPodBuilder) WithNginxSideCar added in v0.25.0

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

func (*RunnerPodBuilder) WithSlug added in v0.25.0

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

func (*RunnerPodBuilder) WithStorage added in v0.25.0

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

type Service added in v0.20.0

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

func NewDefaultService added in v0.20.0

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

func NewService added in v0.20.0

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

type ServicePort added in v0.20.0

type ServicePort struct {
	Name       string
	Port       int
	TargetPort int
}

func NewDefaultServicePort added in v0.20.0

func NewDefaultServicePort(name string) *ServicePort

func NewServicePort added in v0.20.0

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"`
	DNSConfig     *DNSConfig         `yaml:"dnsConfig,omitempty"`
}

type TeresaYamlV2 added in v0.24.0

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

type Volume added in v0.16.0

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

type VolumeItem added in v0.25.0

type VolumeItem struct {
	Key  string
	Path string
}

type VolumeMounts added in v0.16.0

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