juju: github.com/wallyworld/juju/caas/specs Index | Files

package specs

import "github.com/wallyworld/juju/caas/specs"

Index

Package Files

filesets.go legacy.go rbac.go types.go v2.go v3.go

type ConfigMap Uses

type ConfigMap map[string]string

ConfigMap describes the format of configmap resource.

type ContainerConfig Uses

type ContainerConfig map[string]interface{}

ContainerConfig describes the config used for setting up a pod container's environment variables.

type ContainerPort Uses

type ContainerPort struct {
    Name          string `json:"name,omitempty" yaml:"name,omitempty"`
    ContainerPort int32  `json:"containerPort" yaml:"containerPort"`
    Protocol      string `json:"protocol" yaml:"protocol"`
}

ContainerPort defines a port on a container.

type ContainerSpec Uses

type ContainerSpec struct {
    Name string `json:"name" yaml:"name"`
    Init bool   `json:"init,omitempty" yaml:"init,omitempty"`
    // Image is deprecated in preference to using ImageDetails.
    Image        string          `json:"image,omitempty" yaml:"image,omitempty"`
    ImageDetails ImageDetails    `json:"imageDetails" yaml:"imageDetails"`
    Ports        []ContainerPort `json:"ports,omitempty" yaml:"ports,omitempty"`

    Command    []string `json:"command,omitempty" yaml:"command,omitempty"`
    Args       []string `json:"args,omitempty" yaml:"args,omitempty"`
    WorkingDir string   `json:"workingDir,omitempty" yaml:"workingDir,omitempty"`

    EnvConfig    ContainerConfig `json:"envConfig,omitempty" yaml:"envConfig,omitempty"`
    VolumeConfig []FileSet       `json:"volumeConfig,omitempty" yaml:"volumeConfig,omitempty"`

    ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" yaml:"imagePullPolicy,omitempty"`

    // ProviderContainer defines config which is specific to a substrate, eg k8s
    ProviderContainer `json:"-" yaml:"-"`
}

ContainerSpec defines the data values used to configure a container on the CAAS substrate.

func (*ContainerSpec) Validate Uses

func (spec *ContainerSpec) Validate() error

Validate is defined on ProviderContainer.

type ContainerSpecV2 Uses

type ContainerSpecV2 struct {
    Name string `json:"name" yaml:"name"`
    Init bool   `json:"init,omitempty" yaml:"init,omitempty"`
    // Image is deprecated in preference to using ImageDetails.
    Image        string          `json:"image,omitempty" yaml:"image,omitempty"`
    ImageDetails ImageDetails    `json:"imageDetails" yaml:"imageDetails"`
    Ports        []ContainerPort `json:"ports,omitempty" yaml:"ports,omitempty"`

    Command    []string `json:"command,omitempty" yaml:"command,omitempty"`
    Args       []string `json:"args,omitempty" yaml:"args,omitempty"`
    WorkingDir string   `json:"workingDir,omitempty" yaml:"workingDir,omitempty"`

    Config ContainerConfig `json:"config,omitempty" yaml:"config,omitempty"`
    Files  []FileSetV2     `json:"files,omitempty" yaml:"files,omitempty"`

    ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" yaml:"imagePullPolicy,omitempty"`

    // ProviderContainer defines config which is specific to a substrate, eg k8s
    ProviderContainer `json:"-" yaml:"-"`
}

ContainerSpecV2 defines the data values used to configure a container on the CAAS substrate.

func (*ContainerSpecV2) Validate Uses

func (spec *ContainerSpecV2) Validate() error

Validate is defined on ProviderContainer.

type EmptyDirVol Uses

type EmptyDirVol struct {
    Medium    string             `json:"medium,omitempty" yaml:"medium,omitempty"`
    SizeLimit *resource.Quantity `json:"sizeLimit,omitempty" yaml:"sizeLimit,omitempty"`
}

EmptyDirVol represents an empty directory for a pod.

func (*EmptyDirVol) Validate Uses

func (edv *EmptyDirVol) Validate(name string) error

Validate validates EmptyDirVol.

type File Uses

type File struct {
    Path    string `json:"path" yaml:"path"`
    Content string `json:"content" yaml:"content"`
    Mode    *int32 `json:"mode,omitempty" yaml:"mode,omitempty"`
}

File describes a file to mount into a pod.

func (*File) Validate Uses

func (f *File) Validate(name string) error

Validate validates File.

type FileRef Uses

type FileRef struct {
    Key  string `json:"key" yaml:"key"`
    Path string `json:"path" yaml:"path"`
    Mode *int32 `json:"mode,omitempty" yaml:"mode,omitempty"`
}

FileRef describes a file to mount into a pod.

func (*FileRef) Validate Uses

func (f *FileRef) Validate(name string) error

Validate validates FileRef.

type FileSet Uses

type FileSet struct {
    VolumeSource `json:",inline" yaml:",inline"`
    Name         string `json:"name" yaml:"name"`
    MountPath    string `json:"mountPath" yaml:"mountPath"`
}

FileSet defines a set of files to mount into the container.

func (FileSet) Equal Uses

func (fs FileSet) Equal(another FileSet) bool

Equal compares if two FileSet are same.

func (FileSet) EqualVolume Uses

func (fs FileSet) EqualVolume(another FileSet) bool

EqualVolume checks if two fileset definitions will create same volume.

func (*FileSet) Validate Uses

func (fs *FileSet) Validate() error

Validate validates FileSet.

type FileSetV2 Uses

type FileSetV2 struct {
    Name      string            `json:"name" yaml:"name"`
    MountPath string            `json:"mountPath" yaml:"mountPath"`
    Files     map[string]string `json:"files" yaml:"files"`
}

FileSetV2 defines a set of files to mount into the container.

func (*FileSetV2) Validate Uses

func (fs *FileSetV2) Validate() error

Validate validates FileSetV2.

type HostPathVol Uses

type HostPathVol struct {
    Path string `json:"path" yaml:"path"`
    Type string `json:"type,omitempty" yaml:"type,omitempty"`
}

HostPathVol represents a host path mapped into a pod.

func (*HostPathVol) Validate Uses

func (hpv *HostPathVol) Validate(name string) error

Validate validates HostPathVol.

type ImageDetails Uses

type ImageDetails struct {
    ImagePath string `json:"imagePath" yaml:"imagePath"`
    Username  string `json:"username,omitempty" yaml:"username,omitempty"`
    Password  string `json:"password,omitempty" yaml:"password,omitempty"`
}

ImageDetails defines all details required to pull a docker image from any registry

type PodSpec Uses

type PodSpec = PodSpecV3

PodSpec is the current version of pod spec.

type PodSpecLegacy Uses

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

PodSpecLegacy defines the legacy version of data values used to configure a pod on the CAAS substrate.

func (*PodSpecLegacy) Validate Uses

func (spec *PodSpecLegacy) Validate() error

Validate returns an error if the spec is not valid.

type PodSpecV2 Uses

type PodSpecV2 struct {
    ServiceAccount *ServiceAccountSpecV2 `json:"serviceAccount,omitempty" yaml:"serviceAccount,omitempty"`
    // contains filtered or unexported fields
}

PodSpecV2 defines the data values used to configure a pod on the CAAS substrate for version 2.

func (*PodSpecV2) Validate Uses

func (spec *PodSpecV2) Validate() error

Validate returns an error if the spec is not valid.

type PodSpecV3 Uses

type PodSpecV3 struct {
    ServiceAccount *PrimeServiceAccountSpecV3 `json:"serviceAccount,omitempty" yaml:"serviceAccount,omitempty"`
    // contains filtered or unexported fields
}

PodSpecV3 defines the data values used to configure a pod on the CAAS substrate for version 3.

func (*PodSpecV3) Validate Uses

func (spec *PodSpecV3) Validate() error

Validate returns an error if the spec is not valid.

type PodSpecVersion Uses

type PodSpecVersion struct {
    Version Version `json:"version,omitempty" yaml:"version,omitempty"`
}

PodSpecVersion indicates the version of the podspec.

type PolicyRule Uses

type PolicyRule struct {
    Verbs           []string `json:"verbs" yaml:"verbs"`
    APIGroups       []string `json:"apiGroups,omitempty" yaml:"apiGroups,omitempty"`
    Resources       []string `json:"resources,omitempty" yaml:"resources,omitempty"`
    ResourceNames   []string `json:"resourceNames,omitempty" yaml:"resourceNames,omitempty"`
    NonResourceURLs []string `json:"nonResourceURLs,omitempty" yaml:"nonResourceURLs,omitempty"`
}

PolicyRule defines a rule policy for a role or cluster role.

type PrimeServiceAccountSpecV3 Uses

type PrimeServiceAccountSpecV3 struct {
    ServiceAccountSpecV3 `json:",inline" yaml:",inline"`
    // contains filtered or unexported fields
}

PrimeServiceAccountSpecV3 defines spec for creating the prime RBAC resources for version 3.

func (PrimeServiceAccountSpecV3) GetName Uses

func (psa PrimeServiceAccountSpecV3) GetName() string

GetName returns the service accout name.

func (*PrimeServiceAccountSpecV3) SetName Uses

func (psa *PrimeServiceAccountSpecV3) SetName(name string)

SetName sets the service accout name.

func (PrimeServiceAccountSpecV3) Validate Uses

func (psa PrimeServiceAccountSpecV3) Validate() error

Validate returns an error if the spec is not valid.

type ProviderContainer Uses

type ProviderContainer interface {
    Validate() error
}

ProviderContainer defines a provider specific container.

type ProviderPod Uses

type ProviderPod interface {
    Validate() error
}

ProviderPod defines a provider specific pod.

type PullPolicy Uses

type PullPolicy string

PullPolicy describes a policy for if/when to pull a container image.

type ResourceRefVol Uses

type ResourceRefVol struct {
    Name        string    `json:"name" yaml:"name"`
    Files       []FileRef `json:"files,omitempty" yaml:"files,omitempty"`
    DefaultMode *int32    `json:"defaultMode,omitempty" yaml:"defaultMode,omitempty"`
}

ResourceRefVol reprents a configmap or secret source could be referenced by a volume.

func (*ResourceRefVol) Validate Uses

func (rrv *ResourceRefVol) Validate(name string) error

Validate validates ResourceRefVol.

type Role Uses

type Role struct {
    Name   string       `json:"name" yaml:"name"`
    Global bool         `json:"global,omitempty" yaml:"global,omitempty"`
    Rules  []PolicyRule `json:"rules,omitempty" yaml:"rules,omitempty"`
}

Role defines role spec for version 3.

func (Role) Validate Uses

func (r Role) Validate() error

Validate returns an error if the spec is not valid.

type ScalePolicyType Uses

type ScalePolicyType string

ScalePolicyType defines the policy for creating or terminating pods under a service.

const (
    // ParallelScale will create and delete pods as soon as the
    // replica count is changed, and will not wait for pods to be ready or complete
    // termination.
    ParallelScale ScalePolicyType = "parallel"

    // SerialScale will create pods in strictly increasing order on
    // scale up and strictly decreasing order on scale down, progressing only when
    // the previous pod is ready or terminated. At most one pod will be changed
    // at any time.
    SerialScale ScalePolicyType = "serial"
)

func (ScalePolicyType) Validate Uses

func (spt ScalePolicyType) Validate() error

Validate returns an error if the spec is not valid.

type ServiceAccountSpecV2 Uses

type ServiceAccountSpecV2 struct {
    AutomountServiceAccountToken *bool        `json:"automountServiceAccountToken,omitempty" yaml:"automountServiceAccountToken,omitempty"`
    Global                       bool         `json:"global,omitempty" yaml:"global,omitempty"`
    Rules                        []PolicyRule `json:"rules,omitempty" yaml:"rules,omitempty"`
}

ServiceAccountSpecV2 defines spec for referencing or creating RBAC resource for the application for version 2.

func (ServiceAccountSpecV2) ToLatest Uses

func (sa ServiceAccountSpecV2) ToLatest() *PrimeServiceAccountSpecV3

ToLatest converts ServiceAccountSpecV2 to the latest version.

func (ServiceAccountSpecV2) Validate Uses

func (sa ServiceAccountSpecV2) Validate() error

Validate returns an error if the spec is not valid.

type ServiceAccountSpecV3 Uses

type ServiceAccountSpecV3 struct {
    AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty" yaml:"automountServiceAccountToken,omitempty"`

    Roles []Role `json:"roles" yaml:"roles"`
}

ServiceAccountSpecV3 defines spec for creating RBAC resource for the application for version 3.

func (ServiceAccountSpecV3) Validate Uses

func (sa ServiceAccountSpecV3) Validate() error

Validate returns an error if the spec is not valid.

type ServiceSpec Uses

type ServiceSpec struct {
    ScalePolicy ScalePolicyType   `json:"scalePolicy,omitempty"`
    Annotations map[string]string `json:"annotations,omitempty"`
}

ServiceSpec contains attributes to be set on v1.Service when the application is deployed.

func (ServiceSpec) Validate Uses

func (ss ServiceSpec) Validate() error

Validate returns an error if the spec is not valid.

type Version Uses

type Version int32

Version describes pod spec version type.

const CurrentVersion Version = Version3

CurrentVersion is the latest version of pod spec.

const Version2 Version = 2

Version2 defines the version number for pod spec version 2.

const Version3 Version = 3

Version3 defines the version number for pod spec version 3.

const VersionLegacy Version = 0

VersionLegacy defines the version number for pod spec version 0 - legacy.

func GetVersion Uses

func GetVersion(strSpec string) (Version, error)

GetVersion picks the version from pod spec string.

type VolumeSource Uses

type VolumeSource struct {
    Files     []File          `json:"files" yaml:"files"`
    HostPath  *HostPathVol    `json:"hostPath" yaml:"hostPath"`
    EmptyDir  *EmptyDirVol    `json:"emptyDir" yaml:"emptyDir"`
    ConfigMap *ResourceRefVol `json:"configMap" yaml:"configMap"`
    Secret    *ResourceRefVol `json:"secret" yaml:"secret"`
}

VolumeSource represents the source of a volume to mount.

func (VolumeSource) Validate Uses

func (vs VolumeSource) Validate(name string) error

Validate validates VolumeSource.

Package specs imports 6 packages (graph). Updated 2020-03-31. Refresh now. Tools for package owners.