juju: github.com/juju/juju/caas/kubernetes/provider/specs Index | Files | Directories

package specs

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

Index

Package Files

legacy.go secrets.go types.go v2.go

func ParsePodSpec Uses

func ParsePodSpec(in string) (*specs.PodSpec, error)

ParsePodSpec parses a YAML file which defines how to configure a CAAS pod. We allow for generic container set up plus k8s select specific features.

type K8sContainerSpec Uses

type K8sContainerSpec struct {
    LivenessProbe   *core.Probe           `json:"livenessProbe,omitempty"`
    ReadinessProbe  *core.Probe           `json:"readinessProbe,omitempty"`
    SecurityContext *core.SecurityContext `json:"securityContext,omitempty"`
}

K8sContainerSpec is a subset of v1.Container which defines attributes we expose for charms to set.

func (*K8sContainerSpec) Validate Uses

func (*K8sContainerSpec) Validate() error

Validate validates K8sContainerSpec.

type K8sPodSpec Uses

type K8sPodSpec = K8sPodSpecV2

K8sPodSpec is the current k8s pod spec.

type K8sPodSpecLegacy Uses

type K8sPodSpecLegacy struct {
    PodSpec                      `yaml:",inline"`
    ServiceAccountName           string `json:"serviceAccountName,omitempty"`
    AutomountServiceAccountToken *bool  `json:"automountServiceAccountToken,omitempty"`

    CustomResourceDefinitions map[string]apiextensionsv1beta1.CustomResourceDefinitionSpec `yaml:"customResourceDefinitions,omitempty"`
}

K8sPodSpecLegacy is a subset of v1.PodSpec which defines attributes we expose for charms to set.

func (*K8sPodSpecLegacy) Validate Uses

func (*K8sPodSpecLegacy) Validate() error

Validate is defined on ProviderPod.

type K8sPodSpecV2 Uses

type K8sPodSpecV2 struct {
    // k8s resources.
    KubernetesResources *KubernetesResources `json:"kubernetesResources,omitempty"`
}

K8sPodSpecV2 is a subset of v1.PodSpec which defines attributes we expose for charms to set.

func (*K8sPodSpecV2) Validate Uses

func (p *K8sPodSpecV2) Validate() error

Validate is defined on ProviderPod.

type K8sServiceAccountSpec Uses

type K8sServiceAccountSpec struct {
    Name           string `yaml:"name" json:"name"`
    specs.RBACSpec `yaml:",inline"`
}

K8sServiceAccountSpec defines spec for referencing or creating a service account.

func (K8sServiceAccountSpec) GetName Uses

func (sa K8sServiceAccountSpec) GetName() string

GetName returns the service accout name.

func (K8sServiceAccountSpec) GetSpec Uses

func (sa K8sServiceAccountSpec) GetSpec() specs.RBACSpec

GetSpec returns the RBAC spec.

func (K8sServiceAccountSpec) Validate Uses

func (sa K8sServiceAccountSpec) Validate() error

Validate returns an error if the spec is not valid.

type KubernetesResources Uses

type KubernetesResources struct {
    Pod *PodSpec `json:"pod,omitempty"`

    Secrets                   []Secret                                                     `json:"secrets" yaml:"secrets"`
    CustomResourceDefinitions map[string]apiextensionsv1beta1.CustomResourceDefinitionSpec `json:"customResourceDefinitions,omitempty" yaml:"customResourceDefinitions,omitempty"`
    ServiceAccounts           []K8sServiceAccountSpec                                      `json:"serviceAccounts,omitempty" yaml:"serviceAccounts,omitempty"`
}

KubernetesResources is the k8s related resources.

func (*KubernetesResources) Validate Uses

func (krs *KubernetesResources) Validate() error

Validate is defined on ProviderPod.

type PodSpec Uses

type PodSpec struct {
    RestartPolicy                 core.RestartPolicy       `json:"restartPolicy,omitempty"`
    ActiveDeadlineSeconds         *int64                   `json:"activeDeadlineSeconds,omitempty"`
    TerminationGracePeriodSeconds *int64                   `json:"terminationGracePeriodSeconds,omitempty"`
    SecurityContext               *core.PodSecurityContext `json:"securityContext,omitempty"`
    ReadinessGates                []core.PodReadinessGate  `json:"readinessGates,omitempty"`
    DNSPolicy                     core.DNSPolicy           `json:"dnsPolicy,omitempty"`
}

PodSpec is a subset of v1.PodSpec which defines attributes we expose for charms to set.

func (PodSpec) IsEmpty Uses

func (ps PodSpec) IsEmpty() bool

IsEmpty checks if PodSpec is empty or not.

type PodSpecConverter Uses

type PodSpecConverter interface {
    Validate() error
    ToLatest() *specs.PodSpec
}

PodSpecConverter defines methods to validate and convert a specific version of podspec to latest version.

type Secret Uses

type Secret struct {
    Name        string            `json:"name" yaml:"name"`
    Type        core.SecretType   `json:"type" yaml:"type"`
    Annotations map[string]string `json:"annotations,omitempty"`
    Data        map[string]string `json:"data,omitempty" yaml:"data,omitempty"`
    StringData  map[string]string `json:"stringData,omitempty" yaml:"stringData,omitempty"`
}

Secret is a subset of v1.Secret which defines attributes we expose for charms to set.

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.

Package specs imports 9 packages (graph) and is imported by 8 packages. Updated 2019-10-23. Refresh now. Tools for package owners.