manifest

package
v0.0.0-...-173f4c4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_RESOURCE_ENV_NAME = "URL"
)
View Source
const (
	ValidNameDescription = "must contain only lowercase alphanumeric and dashes"
)

Variables

View Source
var (
	DefaultCpu        = 256
	DefaultMem        = 512
	ReservedLabelKeys = map[string]bool{
		"system":  true,
		"rack":    true,
		"app":     true,
		"name":    true,
		"service": true,
		"release": true,
		"type":    true,
	}
)
View Source
var (
	AdditionalEnvNames = []string{
		DEFAULT_RESOURCE_ENV_NAME,
		"USER",
		"PASS",
		"HOST",
		"PORT",
		"NAME",
	}
)

Functions

This section is empty.

Types

type AWSPodIdentityOptions

type AWSPodIdentityOptions struct {
	PolicyArns []string `yaml:"policyArns"`
}

type AccessControlOptions

type AccessControlOptions struct {
	AWSPodIdentity *AWSPodIdentityOptions `yaml:"awsPodIdentity,omitempty"`
}

type Balancer

type Balancer struct {
	Name string `yaml:"-"`

	Annotations BalancerAnnotations `yaml:"annotations"`
	Ports       BalancerPorts       `yaml:"ports,omitempty"`
	Service     string              `yaml:"service,omitempty"`
	Whitelist   BalancerWhitelist   `yaml:"whitelist,omitempty"`
}

func (Balancer) AnnotationsMap

func (b Balancer) AnnotationsMap() map[string]string

func (*Balancer) SetName

func (v *Balancer) SetName(name string) error

type BalancerAnnotations

type BalancerAnnotations []string

type BalancerPort

type BalancerPort struct {
	Source int `yaml:"-"`

	Protocol string `yaml:"protocol,omitempty"`
	Target   int    `yaml:"port,omitempty"`
}

func (*BalancerPort) SetName

func (v *BalancerPort) SetName(name string) error

func (*BalancerPort) UnmarshalYAML

func (v *BalancerPort) UnmarshalYAML(unmarshal func(interface{}) error) error

type BalancerPorts

type BalancerPorts []BalancerPort

func (BalancerPorts) MarshalYAML

func (v BalancerPorts) MarshalYAML() (interface{}, error)

func (*BalancerPorts) UnmarshalYAML

func (v *BalancerPorts) UnmarshalYAML(unmarshal func(interface{}) error) error

type BalancerWhitelist

type BalancerWhitelist []string

func (*BalancerWhitelist) UnmarshalYAML

func (v *BalancerWhitelist) UnmarshalYAML(unmarshal func(interface{}) error) error

type Balancers

type Balancers []Balancer

func (Balancers) MarshalYAML

func (v Balancers) MarshalYAML() (interface{}, error)

func (*Balancers) UnmarshalYAML

func (v *Balancers) UnmarshalYAML(unmarshal func(interface{}) error) error

type Certificate

type Certificate struct {
	Duration string `yaml:"duration,omitempty"`
}

type DefaultsSetter

type DefaultsSetter interface {
	SetDefaults() error
}

type Environment

type Environment []string

func (*Environment) UnmarshalYAML

func (v *Environment) UnmarshalYAML(unmarshal func(interface{}) error) error

type Labels

type Labels map[string]string

type Manifest

type Manifest struct {
	Balancers   Balancers   `yaml:"balancers,omitempty"`
	Environment Environment `yaml:"environment,omitempty"`
	Labels      Labels      `yaml:"labels,omitempty"`
	Params      Params      `yaml:"params,omitempty"`
	Resources   Resources   `yaml:"resources,omitempty"`
	Services    Services    `yaml:"services,omitempty"`
	Timers      Timers      `yaml:"timers,omitempty"`
	// contains filtered or unexported fields
}

func Load

func Load(data []byte, env map[string]string) (*Manifest, error)

func (*Manifest) Agents

func (m *Manifest) Agents() []string

func (*Manifest) ApplyCompatibility

func (m *Manifest) ApplyCompatibility() error

func (*Manifest) ApplyDefaults

func (m *Manifest) ApplyDefaults() error

func (*Manifest) AttributeExists

func (m *Manifest) AttributeExists(name string) bool

func (*Manifest) Attributes

func (m *Manifest) Attributes() []string

func (*Manifest) AttributesByPrefix

func (m *Manifest) AttributesByPrefix(prefix string) []string

func (*Manifest) CombineEnv

func (m *Manifest) CombineEnv() error

CombineEnv calculates the final environment of each service and filters m.env to the union of all service env vars defined in the manifest

func (*Manifest) CombineLabels

func (m *Manifest) CombineLabels() error

func (*Manifest) Env

func (m *Manifest) Env() map[string]string

func (*Manifest) Resource

func (m *Manifest) Resource(name string) (*Resource, error)

func (*Manifest) Service

func (m *Manifest) Service(name string) (*Service, error)

func (*Manifest) ServiceEnvironment

func (m *Manifest) ServiceEnvironment(service string) (map[string]string, error)

func (*Manifest) SetAttributes

func (m *Manifest) SetAttributes(attrs []string)

used only for tests

func (*Manifest) SetEnv

func (m *Manifest) SetEnv(env map[string]string)

used only for tests

func (*Manifest) Validate

func (m *Manifest) Validate() error

type NameGetter

type NameGetter interface {
	GetName() string
}

type NameSetter

type NameSetter interface {
	SetName(name string) error
}

type Params

type Params map[string]string

type Resource

type Resource struct {
	Name    string            `yaml:"-"`
	Type    string            `yaml:"type"`
	Options map[string]string `yaml:"options"`
}

func (Resource) DefaultEnv

func (r Resource) DefaultEnv() string

func (Resource) GetName

func (r Resource) GetName() string

func (Resource) LoadEnv

func (r Resource) LoadEnv() []string

func (*Resource) SetName

func (v *Resource) SetName(name string) error

type Resources

type Resources []Resource

func (Resources) MarshalYAML

func (v Resources) MarshalYAML() (interface{}, error)

func (*Resources) UnmarshalYAML

func (v *Resources) UnmarshalYAML(unmarshal func(interface{}) error) error

type Service

type Service struct {
	Name string `yaml:"-"`

	Agent              ServiceAgent          `yaml:"agent,omitempty"`
	Annotations        ServiceAnnotations    `yaml:"annotations,omitempty"`
	Build              ServiceBuild          `yaml:"build,omitempty"`
	Certificate        Certificate           `yaml:"certificate,omitempty"`
	Command            string                `yaml:"command,omitempty"`
	Deployment         ServiceDeployment     `yaml:"deployment,omitempty"`
	DnsConfig          ServiceDnsConfig      `yaml:"dnsConfig,omitempty"`
	Domains            ServiceDomains        `yaml:"domain,omitempty"`
	Drain              int                   `yaml:"drain,omitempty"`
	Environment        Environment           `yaml:"environment,omitempty"`
	GrpcHealthEnabled  bool                  `yaml:"grpcHealthEnabled,omitempty"`
	Health             ServiceHealth         `yaml:"health,omitempty"`
	Liveness           ServiceLiveness       `yaml:"liveness,omitempty"`
	Image              string                `yaml:"image,omitempty"`
	Init               bool                  `yaml:"init,omitempty"`
	Internal           bool                  `yaml:"internal,omitempty"`
	InternalRouter     bool                  `yaml:"internalRouter,omitempty"`
	IngressAnnotations ServiceAnnotations    `yaml:"ingressAnnotations,omitempty"`
	Labels             Labels                `yaml:"labels,omitempty"`
	Lifecycle          ServiceLifecycle      `yaml:"lifecycle,omitempty"`
	Port               ServicePortScheme     `yaml:"port,omitempty"`
	Ports              []ServicePortProtocol `yaml:"ports,omitempty"`
	Privileged         bool                  `yaml:"privileged,omitempty"`
	Resources          []string              `yaml:"resources,omitempty"`
	Scale              ServiceScale          `yaml:"scale,omitempty"`
	Singleton          bool                  `yaml:"singleton,omitempty"`
	Sticky             bool                  `yaml:"sticky,omitempty"`
	Termination        ServiceTermination    `yaml:"termination,omitempty"`
	Test               string                `yaml:"test,omitempty"`
	Timeout            int                   `yaml:"timeout,omitempty"`
	Tls                ServiceTls            `yaml:"tls,omitempty"`
	Volumes            []string              `yaml:"volumes,omitempty"`
	VolumeOptions      []VolumeOption        `yaml:"volumeOptions,omitempty"`
	Whitelist          string                `yaml:"whitelist,omitempty"`
	AccessControl      AccessControlOptions  `yaml:"accessControl,omitempty"`
}

func (Service) AnnotationsMap

func (s Service) AnnotationsMap() map[string]string

skipcq

func (Service) Autoscale

func (s Service) Autoscale() bool

skipcq

func (Service) BuildHash

func (s Service) BuildHash(key string) string

skipcq

func (Service) Domain

func (s Service) Domain() string

skipcq

func (Service) EnvironmentDefaults

func (s Service) EnvironmentDefaults() map[string]string

skipcq

func (Service) EnvironmentKeys

func (s Service) EnvironmentKeys() string

skipcq

func (Service) GetName

func (s Service) GetName() string

skipcq

func (Service) IngressAnnotationsMap

func (s Service) IngressAnnotationsMap() map[string]string

skipcq

func (Service) ResourceMap

func (s Service) ResourceMap() []ServiceResource

skipcq

func (Service) ResourcesName

func (s Service) ResourcesName() []string

skipcq

func (*Service) SetName

func (v *Service) SetName(name string) error

type ServiceAgent

type ServiceAgent struct {
	Enabled bool `yaml:"enabled,omitempty"`
}

func (*ServiceAgent) UnmarshalYAML

func (v *ServiceAgent) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceAnnotations

type ServiceAnnotations []string

type ServiceBuild

type ServiceBuild struct {
	Args     []string `yaml:"args,omitempty"`
	Manifest string   `yaml:"manifest,omitempty"`
	Path     string   `yaml:"path,omitempty"`
}

func (ServiceBuild) MarshalYAML

func (v ServiceBuild) MarshalYAML() (interface{}, error)

func (*ServiceBuild) UnmarshalYAML

func (v *ServiceBuild) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceDeployment

type ServiceDeployment struct {
	Maximum int `yaml:"maximum,omitempty"`
	Minimum int `yaml:"minimum,omitempty"`
}

type ServiceDnsConfig

type ServiceDnsConfig struct {
	Ndots int
}

type ServiceDomains

type ServiceDomains []string

func (*ServiceDomains) UnmarshalYAML

func (v *ServiceDomains) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceHealth

type ServiceHealth struct {
	Disable  bool
	Grace    int
	Interval int
	Path     string
	Timeout  int
}

func (*ServiceHealth) UnmarshalYAML

func (v *ServiceHealth) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceLifecycle

type ServiceLifecycle struct {
	PreStop   string `yaml:"preStop,omitempty"`
	PostStart string `yaml:"postStart,omitempty"`
}

type ServiceLiveness

type ServiceLiveness struct {
	Grace            int    `yaml:"grace,omitempty"`
	Interval         int    `yaml:"interval,omitempty"`
	Path             string `yaml:"path,omitempty"`
	Timeout          int    `yaml:"timeout,omitempty"`
	SuccessThreshold int    `yaml:"successThreshold,omitempty"`
	FailureThreshold int    `yaml:"failureThreshold,omitempty"`
}

type ServicePortProtocol

type ServicePortProtocol struct {
	Port     int    `yaml:"port,omitempty"`
	Protocol string `yaml:"protocol,omitempty"`
}

func (*ServicePortProtocol) UnmarshalYAML

func (v *ServicePortProtocol) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServicePortScheme

type ServicePortScheme struct {
	Port   int    `yaml:"port,omitempty"`
	Scheme string `yaml:"scheme,omitempty"`
}

func (ServicePortScheme) MarshalYAML

func (v ServicePortScheme) MarshalYAML() (interface{}, error)

func (*ServicePortScheme) UnmarshalYAML

func (v *ServicePortScheme) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceResource

type ServiceResource struct {
	Name string
	Env  string
}

func (ServiceResource) GetConfigMapKey

func (sr ServiceResource) GetConfigMapKey() string

type ServiceResourceLimit

type ServiceResourceLimit struct {
	Cpu    int
	Memory int
}

type ServiceScale

type ServiceScale struct {
	Count   ServiceScaleCount
	Cpu     int
	Gpu     ServiceScaleGpu `yaml:"gpu,omitempty"`
	Memory  int
	Limit   ServiceResourceLimit `yaml:"limit,omitempty"`
	Targets ServiceScaleTargets  `yaml:"targets,omitempty"`
}

func (*ServiceScale) UnmarshalYAML

func (v *ServiceScale) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceScaleCount

type ServiceScaleCount struct {
	Min int
	Max int
}

func (ServiceScaleCount) MarshalYAML

func (v ServiceScaleCount) MarshalYAML() (interface{}, error)

func (*ServiceScaleCount) UnmarshalYAML

func (v *ServiceScaleCount) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceScaleExternalMetric

type ServiceScaleExternalMetric struct {
	AverageValue *float64          `yaml:"averageValue,omitempty"`
	MatchLabels  map[string]string `yaml:"matchLabels,omitempty"`
	Name         string            `yaml:"name"`
	Value        *float64          `yaml:"value,omitempty"`
}

type ServiceScaleExternalMetrics

type ServiceScaleExternalMetrics []ServiceScaleExternalMetric

type ServiceScaleGpu

type ServiceScaleGpu struct {
	Count  int
	Vendor string
}

func (*ServiceScaleGpu) UnmarshalYAML

func (v *ServiceScaleGpu) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceScaleMetric

type ServiceScaleMetric struct {
	Aggregate  string
	Dimensions map[string]string
	Namespace  string
	Name       string
	Value      float64
}

type ServiceScaleMetrics

type ServiceScaleMetrics []ServiceScaleMetric

func (*ServiceScaleMetrics) UnmarshalYAML

func (v *ServiceScaleMetrics) UnmarshalYAML(unmarshal func(interface{}) error) error

type ServiceScaleTargets

type ServiceScaleTargets struct {
	Cpu      int
	Custom   ServiceScaleMetrics
	External ServiceScaleExternalMetrics
	Memory   int
	Requests int
}

type ServiceTermination

type ServiceTermination struct {
	Grace int `yaml:"grace,omitempty"`
}

type ServiceTls

type ServiceTls struct {
	Redirect bool
}

type Services

type Services []Service

func (Services) External

func (ss Services) External() Services

func (Services) Filter

func (ss Services) Filter(fn func(s Service) bool) Services

func (Services) InternalRouter

func (ss Services) InternalRouter() Services

func (Services) MarshalYAML

func (v Services) MarshalYAML() (interface{}, error)

func (Services) Routable

func (ss Services) Routable() Services

func (*Services) UnmarshalYAML

func (v *Services) UnmarshalYAML(unmarshal func(interface{}) error) error

type Timer

type Timer struct {
	Name        string             `yaml:"-"`
	Annotations ServiceAnnotations `yaml:"annotations,omitempty"`

	Command     string `yaml:"command"`
	Schedule    string `yaml:"schedule"`
	Service     string `yaml:"service"`
	Concurrency string `yaml:"concurrency"`
}

func (Timer) AnnotationsMap

func (t Timer) AnnotationsMap() map[string]string

skipcq

func (*Timer) GetName

func (t *Timer) GetName() string

func (*Timer) SetName

func (t *Timer) SetName(name string) error

type Timers

type Timers []Timer

func (Timers) MarshalYAML

func (v Timers) MarshalYAML() (interface{}, error)

func (*Timers) UnmarshalYAML

func (v *Timers) UnmarshalYAML(unmarshal func(interface{}) error) error

type VolumeEmptyDir

type VolumeEmptyDir struct {
	Id        string `yaml:"id"`
	Medium    string `yaml:"medium,omitempty"`
	MountPath string `yaml:"mountPath"`
}

func (VolumeEmptyDir) Validate

func (v VolumeEmptyDir) Validate() error

type VolumeOption

type VolumeOption struct {
	EmptyDir *VolumeEmptyDir `yaml:"emptyDir,omitempty"`
}

func (VolumeOption) Validate

func (v VolumeOption) Validate() error

Jump to

Keyboard shortcuts

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