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

package specs

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

Index

Package Files

legacy.go rbac.go types.go v2.go

type ConfigMap Uses

type ConfigMap map[string]string

ConfigMap describes the format of configmap resource.

type ContainerPort Uses

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

ContainerPort defines a port on a container.

type ContainerSpec Uses

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

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

    Config map[string]interface{} `yaml:"config,omitempty"`
    Files  []FileSet              `yaml:"files,omitempty"`

    ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty"`

    // ProviderContainer defines config which is specific to a substrate, eg k8s
    ProviderContainer `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 FileSet Uses

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

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

func (*FileSet) Validate Uses

func (fs *FileSet) Validate() error

Validate validates FileSet.

type ImageDetails Uses

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

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

type PodSpec Uses

type PodSpec = PodSpecV2

PodSpec is the current version of pod spec.

type PodSpecLegacy Uses

type PodSpecLegacy struct {

    // legacy version has containers/initContainers two blocks.
    InitContainers []ContainerSpec `json:"initContainers" yaml:"initContainers"`
    // 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 *ServiceAccountSpec `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 PodSpecVersion Uses

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

PodSpecVersion indicates the version of the podspec.

type PolicyRule Uses

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

PolicyRule defines rule spec for creating a role or cluster role.

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 RBACSpec Uses

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

RBACSpec defines RBAC related spec.

func (RBACSpec) Validate Uses

func (rs RBACSpec) 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 = "serial"
)

func (ScalePolicyType) Validate Uses

func (spt ScalePolicyType) Validate() error

Validate returns an error if the spec is not valid.

type ServiceAccountSpec Uses

type ServiceAccountSpec struct {
    RBACSpec `yaml:",inline"`
    // contains filtered or unexported fields
}

ServiceAccountSpec defines spec for referencing or creating a service account.

func (ServiceAccountSpec) GetName Uses

func (sa ServiceAccountSpec) GetName() string

GetName returns the service accout name.

func (ServiceAccountSpec) GetSpec Uses

func (sa ServiceAccountSpec) GetSpec() RBACSpec

GetSpec returns the RBAC spec.

func (*ServiceAccountSpec) SetName Uses

func (sa *ServiceAccountSpec) SetName(name string)

SetName sets the service accout name.

func (ServiceAccountSpec) Validate Uses

func (sa ServiceAccountSpec) 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 = Version2

CurrentVersion is the latest version of pod spec.

const Version2 Version = 2

Version2 defines the version number for pod spec version 2.

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.

Package specs imports 3 packages (graph) and is imported by 5 packages. Updated 2019-10-20. Refresh now. Tools for package owners.