Documentation
¶
Overview ¶
Package pods borrows heavily from the Kubernetes definition of pods to provide p2 with a convenient way to colocate several related launchable artifacts, as well as basic shared runtime configuration. Pod manifests are written as YAML files that describe what to launch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidManifest ¶
ValidManifest checks the internal consistency of a manifest. Returns an error if the data is inconsistent or "nil" otherwise.
Types ¶
type Builder ¶
type Builder interface {
GetManifest() Manifest
SetID(types.PodID)
SetConfig(config map[interface{}]interface{}) error
SetRunAsUser(user string)
SetStatusHTTP(statusHTTP bool)
SetStatusPath(statusPath string)
SetStatusPort(port int)
SetLaunchables(launchableStanzas map[launch.LaunchableID]launch.LaunchableStanza)
SetResourceLimits(limits ResourceLimitsStanza)
SetNodeRequirements(map[string]string)
SetTerminationGracePeriod(seconds int)
}
func NewBuilder ¶
func NewBuilder() Builder
type Manifest ¶
type Manifest interface {
ID() types.PodID
RunAsUser() string
UnpackAsUser() string
Write(out io.Writer) error
ConfigFileName() (string, error)
WriteConfig(out io.Writer) error
PlatformConfigFileName() (string, error)
WritePlatformConfig(out io.Writer) error
WriteResourceLimitsConfig(out io.Writer) error
GetLaunchableStanzas() map[launch.LaunchableID]launch.LaunchableStanza
GetResourceLimits() ResourceLimitsStanza
ResourceLimitsConfigFileName() (string, error)
GetConfig() map[interface{}]interface{}
SHA() (string, error)
GetArtifactRegistry(uri.Fetcher) artifact.Registry
GetMinHealthPercentage() int
GetStatusHTTP() bool
GetStatusPath() string
GetStatusPort() int
GetStatusLocalhostOnly() bool
GetStatusStanza() StatusStanza
GetReadOnly() bool
SetReadOnlyIfUnset(readonly bool)
Marshal() ([]byte, error)
SignatureData() (plaintext, signature []byte)
GetNodeRequirements() map[string]string
GetTerminationGracePeriod() time.Duration
GetBuilder() Builder
}
Read-only immutable interface for manifests. To programmatically build a manifest, use Builder
func FromBytes ¶
FromBytes constructs a Manifest by parsing its serialized representation. The manifest can be a raw YAML document or a PGP clearsigned YAML document. If signed, the signature components will be stored inside the Manifest instance.
func FromPath ¶
FromPath constructs a Manifest from a local file. This function is a helper for FromBytes().
func FromReader ¶
FromReader constructs a Manifest from an open Reader. All bytes will be read from the Reader. The caller is responsible for closing the Reader, if necessary. This function is a helper for FromBytes().
type ResourceLimitsStanza ¶
type StatusStanza ¶
type StatusStanza struct {
HTTP bool `yaml:"http,omitempty"`
Path string `yaml:"path,omitempty"`
Port int `yaml:"port,omitempty"`
LocalhostOnly bool `yaml:"localhost_only,omitempty"`
}
func (StatusStanza) GetPath ¶
func (status StatusStanza) GetPath() string