schema

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 45 Imported by: 20

Documentation

Overview

This package implements compatibility layer to bridge previous provider/provisioner mismatch and as such is discouraged for future use.

+groupName=gravitational.io

Index

Constants

View Source
const (
	// LabelRole names a label that defines a node role
	LabelRole = "role"

	// ServiceLabelRole names a label that defines a kubernetes node role
	ServiceLabelRole = "gravitational.io/k8s-role"

	// ProviderAWS defines AWS as infrastructure provider
	ProviderAWS = "aws"
	// ProviderGeneric defines a generic provider
	ProviderGeneric = "generic"
	// ProviderOnPrem defines an On-Premises infrastructure provider
	ProviderOnPrem = "onprem"
	// ProviderGCE defines Google Compute Engine provider
	ProviderGCE = "gce"

	// ProvisionerAWSTerraform defines an operation provisioner based on terraform
	ProvisionerAWSTerraform = "aws_terraform"
	// ProvisionerOnPrem defines a provisioner for an On-Premises operation
	ProvisionerOnPrem = "onprem"

	// NetworkingAWSVPC defines a type of networking for AWS based on AWS-VPC
	NetworkingAWSVPC = "aws-vpc"
	// NetworkingCalico defines a type of networking using Calico
	NetworkingCalico = "calico"
	// NetworkingFlannel defines a type of networking using Flannel VXLAN
	NetworkingFlannel = "vxlan"

	// DisplayRole defines a role used to identify a server instance in the inventory
	// management console
	DisplayRole = "display-role"

	// SystemDevice defines the name of the agent download URI query parameter for system (state) device
	SystemDevice = "system_device"

	// AdvertiseAddr is advertise IP address used in agents
	AdvertiseAddr = "advertise_addr"

	// MountSpec defines the name of the agent download URI query parameter for a mount specification
	MountSpec = "mount"

	// GCENodeTags defines the name of the agent download URI query parameter to override instance node tags
	// on GCE
	GCENodeTags = "gce_node_tags"

	// KindBundle defines an application bundle type (obsoleted by "Cluster")
	KindBundle = "Bundle"
	// KindCluster defines a cluster type (former "Bundle")
	KindCluster = "Cluster"
	// KindApplication defines a user application type
	KindApplication = "Application"
	// KindSystemApplication defines a system application type
	KindSystemApplication = "SystemApplication"
	// KindRuntime defines a runtime application type
	KindRuntime = "Runtime"

	// APIVersionV1 specifies the previous API version
	APIVersionV1 = "v1"
	// APIVersionLegacyV2 specifies legacy v2 version
	APIVersionLegacyV2 = "v2"

	// GroupName specifies the name of the group for application manifest package
	GroupName = "bundle.gravitational.io"
	// ClusterGroupName is the API group for cluster image manifest
	ClusterGroupName = "cluster.gravitational.io"
	// AppGroupName is the API group for app image manifest
	AppGroupName = "app.gravitational.io"
	// Version specifies the current package version
	Version = "v2"

	// ExpandPolicyFixed is a node membership policy that prevents adding
	// more nodes of the same role
	ExpandPolicyFixed = "fixed"
	// ExpandPolicyFixedInstance is a node membership policy that allows adding
	// nodes of the same role with the same instance type only (for cloud
	// providers)
	ExpandPolicyFixedInstance = "fixed-instance"

	// OpsCenterAppName is the name of the Ops Center application
	OpsCenterAppName = "opscenter"
	// OpsCenterNode is the Ops Center app node profile name
	OpsCenterNode = "node"
	// OpsCenterFlavor is the Ops Center app flavor
	OpsCenterFlavor = "single"

	// SELinuxLabelNone is a special placeholder for a SELinux label indicating
	// that no labeling should be performed for the directory
	SELinuxLabelNone = "none"
)

Variables

View Source
var (
	// DefaultKernelModules is the list of kernel modules needed for gravity to function properly
	DefaultKernelModules = []monitoring.ModuleRequest{
		moduleName("ebtables"),
		moduleName("ebtable_filter"),
		moduleName("ip_tables"),
		moduleName("iptable_filter"),
		moduleName("iptable_nat"),
		moduleName("br_netfilter"),
		moduleName("overlay"),
	}

	// DefaultKernelModuleChecker is a satellite kernel module checker with required modules to run kubernetes
	DefaultKernelModuleChecker = monitoring.NewKernelModuleChecker(DefaultKernelModules...)
)
View Source
var (
	// APIVersionV2 specifies the current API version
	APIVersionV2 = fmt.Sprintf("%v/%v", GroupName, Version)
	// APIVersionV2Cluster is the API version for cluster images
	APIVersionV2Cluster = fmt.Sprintf("%v/%v", ClusterGroupName, Version)
	// APIVersionV2App is the API version for app images
	APIVersionV2App = fmt.Sprintf("%v/%v", AppGroupName, Version)
)
View Source
var (
	// SchemeGroupVersion defines group and version for the application manifest type in the kubernetes
	// resource scheme
	SchemeGroupVersion = kubeschema.GroupVersion{Group: GroupName, Version: Version}
	// ClusterGroupVersion defines group/version for the cluster image manifest
	ClusterGroupVersion = kubeschema.GroupVersion{Group: ClusterGroupName, Version: Version}
	// AppGroupVersion defines group/version for the app image manifest
	AppGroupVersion = kubeschema.GroupVersion{Group: AppGroupName, Version: Version}
)
View Source
var DefaultPortRanges = PortRanges{
	Kubernetes: []PortRange{
		{Protocol: "tcp", From: 10248, To: 10255, Description: "kubernetes internal services range"},
		{
			Protocol:    "tcp",
			From:        defaults.EtcdAPIPort,
			To:          defaults.EtcdAPIPort,
			Description: "etcd API port",
		},
		{
			Protocol:    "tcp",
			From:        defaults.EtcdPeerPort,
			To:          defaults.EtcdPeerPort,
			Description: "etcd peer port",
		},
		{
			Protocol:    "tcp",
			From:        defaults.APIServerSecurePort,
			To:          defaults.APIServerSecurePort,
			Description: "kubernetes API server",
		},
		{
			Protocol:    "tcp",
			From:        defaults.AlertmanagerServicePort,
			To:          defaults.AlertmanagerServicePort,
			Description: "alert manager service port",
		},
	},
	Installer: []PortRange{
		{
			Protocol:    "tcp",
			From:        defaults.WizardPackServerPort,
			To:          defaults.WizardPackServerPort,
			Description: "wizard package service",
		},
		{
			Protocol:    "tcp",
			From:        defaults.WizardHealthPort,
			To:          defaults.WizardHealthPort,
			Description: "wizard health endpoint",
		},
		{
			Protocol:    "tcp",
			From:        defaults.WizardSSHServerPort,
			To:          defaults.WizardSSHServerPort,
			Description: "wizard SSH port",
		},
		{
			Protocol:    "tcp",
			From:        defaults.WizardProxyServerPort,
			To:          defaults.WizardProxyServerPort,
			Description: "wizard proxy port",
		},
		{
			Protocol:    "tcp",
			From:        defaults.WizardReverseTunnelPort,
			To:          defaults.WizardReverseTunnelPort,
			Description: "installer reverse tunnel port",
		},
		{
			Protocol:    "tcp",
			From:        defaults.WizardAuthServerPort,
			To:          defaults.WizardAuthServerPort,
			Description: "installer auth port",
		},
		{
			Protocol:    "tcp",
			From:        defaults.GravityRPCAgentPort,
			To:          defaults.GravityRPCAgentPort,
			Description: "gravity agent RPC",
		},
		{
			Protocol:    "tcp",
			From:        defaults.BandwidthTestPort,
			To:          defaults.BandwidthTestPort,
			Description: "bandwidth test port",
		},
	},
	Vxlan: PortRange{
		Protocol:    "udp",
		From:        defaults.VxlanPort,
		To:          defaults.VxlanPort,
		Description: "overlay network",
	},
	Generic: []PortRange{
		{Protocol: "tcp", From: 3022, To: 3026, Description: "teleport internal SSH control panel"},
		{Protocol: "tcp", From: 3007, To: 3011, Description: "internal gravity services"},
		{
			Protocol:    "tcp",
			From:        defaults.GravitySiteNodePort,
			To:          defaults.GravitySiteNodePort,
			Description: "gravity Hub control panel",
		},
		{
			Protocol:    "tcp",
			From:        defaults.SatelliteRPCAgentPort,
			To:          defaults.SatelliteRPCAgentPort,
			Description: "planet agent RPC",
		},
		{
			Protocol:    "tcp",
			From:        defaults.SatelliteMetricsPort,
			To:          defaults.SatelliteMetricsPort,
			Description: "planet agent monitoring API port",
		},
	},
	Reserved: []PortRange{

		{
			Protocol:    "tcp",
			From:        defaults.EtcdAPILegacyPort,
			To:          defaults.EtcdAPILegacyPort,
			Description: "etcd",
		},

		{
			Protocol:    "tcp",
			From:        defaults.EtcdPeerLegacyPort,
			To:          defaults.EtcdPeerLegacyPort,
			Description: "etcd",
		},

		{
			Protocol:    "tcp",
			From:        defaults.DockerRegistryPort,
			To:          defaults.DockerRegistryPort,
			Description: "docker registry",
		},
	},
}

DefaultPortRanges defines the list of default ports for the cluster

View Source
var SupportedProviders = []string{
	ProviderGeneric,
	ProviderAWS,
	ProviderGCE,
}

SupportedProviders is a list of currently supported providers

Functions

func CheckAndSetDefaults

func CheckAndSetDefaults(manifest *Manifest) error

CheckAndSetDefaults verifies that the specified manifest does not have conflicting or errorneous attributes set

func DiffPorts

func DiffPorts(old, new Manifest, profileName string) (tcp, udp []int, err error)

DiffPorts returns a difference of port requirements between old and new for the specified profile.

func ExpandEnvVars

func ExpandEnvVars(manifest []byte) []byte

ExpandEnvVars does environment variables interpolation on manifest body.

Environment variables have format ${VARNAME}.

func GetProviderFromProvisioner

func GetProviderFromProvisioner(provisioner string) (string, error)

GetProviderFromProvisioner derives a provider name from the specified provisioner. It does not try to guess hard enough and supports only basic translation. Note, it is always cleaner to set the provider in the request explicitly.

func GetProvisionerFromProvider

func GetProvisionerFromProvider(provider string) (string, error)

GetProvisionerFromProvider derives a provisioner name from the specified provider. It does not try to guess hard enough and supports only basic translation. Note, it is always cleaner to set the provisioner in the request explicitly.

func IsAWSProvider

func IsAWSProvider(provider string) bool

IsAWSProvider determines if specified provider string refers to AWS provider

func ProcessMultiSourceValues

func ProcessMultiSourceValues(ctx context.Context, manifest *Manifest, manifestPath string) error

ProcessMultiSourceValues replaces manifest fields that refer to files (via file:// schema) or internet resources (via http:// scheme) with their literal values (i.e. file/downloaded content).

The following fields can be filepaths/URLs:

.releaseNotes
.logo
.installer.eula.source
.installer.flavors.description
.hooks.*.job
.webConfig

func SetDefaults

func SetDefaults(manifest *Manifest) error

SetDefaults enforces defaults on fields that require a value but have not been specified on the given manifest.

func ShouldSkipApp

func ShouldSkipApp(manifest Manifest, app loc.Locator) bool

ShouldSkipApp returns true if the specified application should not be installed in the cluster described by the provided manifest.

func ValidateDocker

func ValidateDocker(ctx context.Context, d Docker, dir string) (failed []*pb.Probe, err error)

ValidateDocker validates Docker requirements. The specified directory is expected to be on the same filesystem as the Docker graph directory (which might not exist at this point).

func ValidateKubelet

func ValidateKubelet(ctx context.Context, profile NodeProfile, manifest Manifest) (failed []*pb.Probe)

ValidateKubelet will check kubelet configuration

func ValidateRequirements

func ValidateRequirements(ctx context.Context, reqs Requirements, stateDir string) (failed []*pb.Probe, err error)

ValidateRequirements will assess local node to match requirements

Types

type AWS

type AWS struct {
	// Networking describes networking configuration
	Networking Networking `json:"network,omitempty"`
	// Regions is a list of supported regions
	Regions []string `json:"regions,omitempty"`
	// IAMPolicy is a list of permissions
	IAMPolicy IAMPolicy `json:"iamPolicy,omitempty"`
	// Disabled is whether this provider should be disabled
	Disabled bool `json:"disabled,omitempty"`
}

AWS defines AWS-specific settings

func (*AWS) DeepCopy

func (in *AWS) DeepCopy() *AWS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWS.

func (*AWS) DeepCopyInto

func (in *AWS) DeepCopyInto(out *AWS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Azure

type Azure struct {
	// Disabled is whether this provider should be disabled
	Disabled bool `json:"disabled,omitempty"`
}

Azure defines Azure-specific settings

func (*Azure) DeepCopy

func (in *Azure) DeepCopy() *Azure

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Azure.

func (*Azure) DeepCopyInto

func (in *Azure) DeepCopyInto(out *Azure)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BaseImage

type BaseImage struct {
	// Locator is the base image locator.
	Locator loc.Locator
}

BaseImage defines a base image type which is basically a locator with custom marshal/unmarshal.

func (*BaseImage) MarshalJSON

func (b *BaseImage) MarshalJSON() ([]byte, error)

MarshalJSON marshals base image into a JSON string.

func (*BaseImage) UnmarshalJSON

func (b *BaseImage) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals base image from a JSON string.

type CPU

type CPU struct {
	// Min is minimum required amount of CPUs
	Min int `json:"min,omitempty"`
	// Max is maximum supported amount of CPUs
	Max int `json:"max,omitempty"`
}

CPU describes CPU requirements

func (*CPU) DeepCopy

func (in *CPU) DeepCopy() *CPU

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPU.

func (*CPU) DeepCopyInto

func (in *CPU) DeepCopyInto(out *CPU)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CatalogExtension

type CatalogExtension struct {
	// Disabled disables application catalog and tiller
	Disabled bool `json:"disabled,omitempty"`
}

CatalogExtension allows to customize application catalog feature

type ConfigurationExtension

type ConfigurationExtension struct {
	// Disabled allows to disable Configuration tab
	Disabled bool `json:"disabled,omitempty"`
}

ConfigurationExtension allows to customize configuration feature

func (*ConfigurationExtension) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationExtension.

func (*ConfigurationExtension) DeepCopyInto

func (in *ConfigurationExtension) DeepCopyInto(out *ConfigurationExtension)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CustomCheck

type CustomCheck struct {
	// Description provides a readable description for the check
	Description string `json:"description,omitempty"`
	// Script defines the contents of the check script.
	// It is provided to the shell verbatim in a temporary file
	Script string `json:"script,omitempty"`
}

CustomCheck defines a script that runs a custom preflight check

type Dependencies

type Dependencies struct {
	// Packages is a list of dependencies-packages
	Packages []Dependency `json:"packages,omitempty"`
	// Apps is a list of dependencies-apps
	Apps []Dependency `json:"apps,omitempty"`
}

Dependencies describes application dependencies

func (Dependencies) ByName

func (d Dependencies) ByName(names ...string) (*loc.Locator, error)

ByName returns a dependency package locator by its name

func (*Dependencies) DeepCopy

func (in *Dependencies) DeepCopy() *Dependencies

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dependencies.

func (*Dependencies) DeepCopyInto

func (in *Dependencies) DeepCopyInto(out *Dependencies)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Dependencies) GetApps

func (d Dependencies) GetApps() []loc.Locator

GetApps returns a list of all application dependencies

func (Dependencies) GetPackages

func (d Dependencies) GetPackages() []loc.Locator

GetPackages returns a list of all package dependencies

type Dependency

type Dependency struct {
	// Locator is dependency package locator
	Locator loc.Locator
}

Dependency represents a package or app dependency

func (*Dependency) DeepCopy

func (in *Dependency) DeepCopy() *Dependency

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dependency.

func (*Dependency) DeepCopyInto

func (in *Dependency) DeepCopyInto(out *Dependency)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Dependency) MarshalJSON

func (d *Dependency) MarshalJSON() ([]byte, error)

MarshalJSON marshals dependency into a JSON string

func (*Dependency) UnmarshalJSON

func (d *Dependency) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals dependency from a JSON string

type Device

type Device struct {
	// Path is the device path, treated as a glob, e.g. /dev/nvidia*
	Path string `json:"path"`
	// Permissions is the device permissions, a composition
	// of 'r' (read), 'w' (write) and 'm' (mknod)
	Permissions string `json:"permissions,omitempty"`
	// FileMode is the permission bits for the device
	FileMode string `json:"fileMode,omitempty"`
	// UID is the device user ID
	UID *int `json:"uid,omitempty"`
	// GID is the device group ID
	GID *int `json:"gid,omitempty"`
}

Device describes a device that should be created inside container

func (Device) Check

func (d Device) Check() error

Check makes sure all device parameters are correct

func (Device) Format

func (d Device) Format() string

Format formats the device to a string so it can be parsed later

type Docker

type Docker struct {
	// ExternalService defines additional configuration for the docker service
	ExternalService
	// StorageDriver is the docker storage driver to use
	StorageDriver string `json:"storageDriver,omitempty"`
	// Capacity is required docker device capacity
	Capacity utils.Capacity `json:"capacity,omitempty"`
}

Docker describes docker options

func (*Docker) DeepCopy

func (in *Docker) DeepCopy() *Docker

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Docker.

func (*Docker) DeepCopyInto

func (in *Docker) DeepCopyInto(out *Docker)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Docker) IsEmpty

func (d Docker) IsEmpty() bool

IsEmpty returns true if docker configuration is empty

type EULA

type EULA struct {
	// Source is the license text URL (file:// or http://) or literal text
	Source string `json:"source,omitempty"`
}

EULA describes the application end user license agreement

func (*EULA) DeepCopy

func (in *EULA) DeepCopy() *EULA

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EULA.

func (*EULA) DeepCopyInto

func (in *EULA) DeepCopyInto(out *EULA)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EncryptionExtension

type EncryptionExtension struct {
	// EncryptionKey is the passphrase for installer encryption
	EncryptionKey string `json:"encryptionKey,omitempty"`
	// CACert is the certificate authority certificate
	CACert string `json:"caCert,omitempty"`
}

EncryptionExtension describes installer encryption extension

func (*EncryptionExtension) DeepCopy

func (in *EncryptionExtension) DeepCopy() *EncryptionExtension

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionExtension.

func (*EncryptionExtension) DeepCopyInto

func (in *EncryptionExtension) DeepCopyInto(out *EncryptionExtension)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Endpoint

type Endpoint struct {
	// Name is the endpoint short name
	Name string `json:"name,omitempty"`
	// Description is the endpoint verbose description
	Description string `json:"description,omitempty"`
	// Selector is the endpoint's k8s service selector
	Selector map[string]string `json:"selector,omitempty"`
	// ServiceName is the endpoint's k8s service name
	ServiceName string `json:"serviceName,omitempty"`
	// Namespace is the endpoint's k8s namespace
	Namespace string `json:"namespace,omitempty"`
	// Protocol is the endpoint protocol
	Protocol string `json:"protocol,omitempty"`
	// Port is the endpoint port
	Port int `json:"port,omitempty"`
	// Hidden is whether to hide the endpoint from the UI
	Hidden bool `json:"hidden,omitempty"`
}

Endpoint describes an application endpoint

func (*Endpoint) DeepCopy

func (in *Endpoint) DeepCopy() *Endpoint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint.

func (*Endpoint) DeepCopyInto

func (in *Endpoint) DeepCopyInto(out *Endpoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Etcd

type Etcd struct {
	// ExternalService defines additional configuration for the etcd service
	ExternalService
}

Etcd describes etcd options

func (*Etcd) DeepCopy

func (in *Etcd) DeepCopy() *Etcd

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Etcd.

func (*Etcd) DeepCopyInto

func (in *Etcd) DeepCopyInto(out *Etcd)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Extensions

type Extensions struct {
	// Encryption allows to encrypt installer packages
	Encryption *EncryptionExtension `json:"encryption,omitempty"`
	// Logs allows to customize logs feature
	Logs *LogsExtension `json:"logs,omitempty"`
	// Monitoring allows to customize monitoring feature
	Monitoring *MonitoringExtension `json:"monitoring,omitempty"`
	// Kubernetes allows to customize kubernetes feature
	Kubernetes *KubernetesExtension `json:"kubernetes,omitempty"`
	// Configuration allows to customize configuration feature
	Configuration *ConfigurationExtension `json:"configuration,omitempty"`
	// Catalog allows to customize application catalog feature
	Catalog *CatalogExtension `json:"catalog,omitempty"`
	// OpsCenter enables the management web UI
	OpsCenter *OpsCenterExtension `json:"opsCenter,omitempty"`
}

Extensions defines various custom application features

func (*Extensions) DeepCopy

func (in *Extensions) DeepCopy() *Extensions

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Extensions.

func (*Extensions) DeepCopyInto

func (in *Extensions) DeepCopyInto(out *Extensions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExternalService

type ExternalService struct {
	// Args is a list of extra arguments to provide to the service
	Args []string `json:"args,omitempty"`
}

ExternalService defines configuration for an external service.

type Flavor

type Flavor struct {
	// Name is the flavor name
	Name string `json:"name,omitempty"`
	// Description is verbose flavor description
	Description string `json:"description,omitempty"`
	// Nodes defines a list of node profiles composing the flavor
	Nodes []FlavorNode `json:"nodes,omitempty"`
}

Flavor describes a single application flavor

func (*Flavor) DeepCopy

func (in *Flavor) DeepCopy() *Flavor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Flavor.

func (*Flavor) DeepCopyInto

func (in *Flavor) DeepCopyInto(out *Flavor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlavorNode

type FlavorNode struct {
	// Profile is a node profile name
	Profile string `json:"profile,omitempty"`
	// Count is number of nodes of this profile
	Count int `json:"count,omitempty"`
}

FlavorNode describes a single node profile for a flavor

func (*FlavorNode) DeepCopy

func (in *FlavorNode) DeepCopy() *FlavorNode

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlavorNode.

func (*FlavorNode) DeepCopyInto

func (in *FlavorNode) DeepCopyInto(out *FlavorNode)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Flavors

type Flavors struct {
	// Default is the name of the default application flavor
	Default string `json:"default,omitempty"`
	// Prompt is a phrase or a question describing the criteria that
	// should be considered when picking a flavor (e.g. "How many
	// requests per second do you want to process?")
	Prompt string `json:"prompt,omitempty"`
	// Description is a general description for the application flavors
	Description string `json:"description,omitempty"`
	// Items is a list of flavors
	Items []Flavor `json:"items,omitempty"`
}

Flavors describes the application flavors

func (*Flavors) DeepCopy

func (in *Flavors) DeepCopy() *Flavors

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Flavors.

func (*Flavors) DeepCopyInto

func (in *Flavors) DeepCopyInto(out *Flavors)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Generic

type Generic struct {
	// Networking describes networking configuration
	Networking Networking `json:"network,omitempty"`
	// Disabled is whether this provider should be disabled
	Disabled bool `json:"disabled,omitempty"`
}

Generic defines generic provider settings

func (*Generic) DeepCopy

func (in *Generic) DeepCopy() *Generic

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Generic.

func (*Generic) DeepCopyInto

func (in *Generic) DeepCopyInto(out *Generic)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Header struct {
	metav1.TypeMeta
	// Metadata is the application metadata
	Metadata Metadata `json:"metadata,omitempty"`
}

Header is manifest header

func (*Header) DeepCopy

func (in *Header) DeepCopy() *Header

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Header.

func (*Header) DeepCopyInto

func (in *Header) DeepCopyInto(out *Header)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Header) GetVersion

func (h Header) GetVersion() string

GetVersion returns the manifest version

type Hook

type Hook struct {
	// Type is a hook type
	Type HookType `json:"type,omitempty"`
	// Job is a URL of (file:// or http://) or a literal value of a k8s job
	Job string `json:"job,omitempty"`
}

Hook defines a hook as either a shell script run in the context of the automatically created job or the raw job spec

func HookFromString

func HookFromString(hookType HookType, manifest Manifest) (*Hook, error)

HookFromString returns an application hook specified with hookType

func (*Hook) DeepCopy

func (in *Hook) DeepCopy() *Hook

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Hook.

func (*Hook) DeepCopyInto

func (in *Hook) DeepCopyInto(out *Hook)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Hook) Empty

func (h Hook) Empty() bool

Empty determines if the hook set is empty

func (Hook) GetJob

func (h Hook) GetJob() (*v1.Job, error)

GetJob parses the hook's string with job spec and returns a job object

func (*Hook) SetJob

func (h *Hook) SetJob(job v1.Job) error

SetJob updates the hook's job spec with the provided job object

type HookType

type HookType string

HookType defines the application hook type

const (
	// HookClusterProvision used to provision new cluster
	HookClusterProvision HookType = "clusterProvision"
	// HookClusterDeprovision used to deprovision existing cluster
	HookClusterDeprovision HookType = "clusterDeprovision"
	// HookNodesProvision used to provision new nodes in the cluster
	HookNodesProvision HookType = "nodesProvision"
	// HookNodesDeprovision used to deprovision existing nodes
	HookNodesDeprovision HookType = "nodesDeprovision"
	// HookInstall defines the installation hook
	HookInstall HookType = "install"
	// HookInstalled defines the post install hook
	HookInstalled HookType = "postInstall"
	// HookUninstall defines the installation hook
	HookUninstall HookType = "uninstall"
	// HookUninstalling defines the before uninstall hook
	HookUninstalling HookType = "preUninstall"
	// HookBeforeUpdate defines the application hook that runs before the update
	HookBeforeUpdate HookType = "preUpdate"
	// HookUpdate defines the application update hook
	HookUpdate HookType = "update"
	// HookUpdated defines the post application update hook
	HookUpdated HookType = "postUpdate"
	// HookRollback defines the application rollback hook
	HookRollback HookType = "rollback"
	// HookRolledBack defines the application post rollback hook
	HookRolledBack HookType = "postRollback"
	// HookNodeAdding defines the before expand hook
	HookNodeAdding HookType = "preNodeAdd"
	// HookNodeAdded defines the post expand hook
	HookNodeAdded HookType = "postNodeAdd"
	// HookNodeRemoving defines the before shrink hook
	HookNodeRemoving HookType = "preNodeRemove"
	// HookNodeRemoved defines the post shrink hook
	HookNodeRemoved HookType = "postNodeRemove"
	// HookStatus defines the application status hook
	HookStatus HookType = "status"
	// HookInfo defines the application service info hook
	HookInfo HookType = "info"
	// HookLicenseUpdated defines the license update hook
	HookLicenseUpdated HookType = "licenseUpdated"
	// HookStart defines the application start hook
	HookStart HookType = "start"
	// HookStop defines the application stop hook
	HookStop HookType = "stop"
	// HookDump defines the application dump hook
	HookDump HookType = "dump"
	// HookBackup defines a hook to trigger backup of application data.
	// The hook is scheduled on the same node where the backup command runs
	HookBackup HookType = "backup"
	// HookRestore defines a hook to restore application state from a previously
	// created backup.
	// The hook is scheduled on the same node where the restore command runs
	HookRestore HookType = "restore"
	// HookNetworkInstall defines a hook used to install a custom overlay network
	HookNetworkInstall = "networkInstall"
	// HookNetworkUpdate defines a hook to update the overlay network
	HookNetworkUpdate = "networkUpdate"
	// HookNetworkRollback defines a hook to rollback the overlay network
	HookNetworkRollback = "networkRollback"
)

func AllHooks

func AllHooks() []HookType

AllHooks obtains the list of all hook types

func (HookType) String

func (h HookType) String() string

String implements Stringer

type Hooks

type Hooks struct {
	// ClusterProvision provisions new cluster
	ClusterProvision *Hook `json:"clusterProvision,omitempty"`
	// ClusterDeprovision deprovisions cluster
	ClusterDeprovision *Hook `json:"clusterDeprovision,omitempty"`
	// NodesProvision provisions new nodes to the existing cluster
	NodesProvision *Hook `json:"nodesProvision,omitempty"`
	// NodesDeprovision deprovisions nodes
	NodesDeprovision *Hook `json:"nodesDeprovision,omitempty"`
	// Install installs the application
	Install *Hook `json:"install,omitempty"`
	// Installed is called after the application has been installed
	Installed *Hook `json:"postInstall,omitempty"`
	// Uninstall uninstalls the application
	Uninstall *Hook `json:"uninstall,omitempty"`
	// Uninstalling is called before uninstall
	Uninstalling *Hook `json:"preUninstall,omitempty"`
	// NodeAdding is called before expansion
	NodeAdding *Hook `json:"preNodeAdd,omitempty"`
	// NodeAdded is called after expansion
	NodeAdded *Hook `json:"postNodeAdd,omitempty"`
	// NodeRemoving is called before shrink
	NodeRemoving *Hook `json:"preNodeRemove,omitempty"`
	// NodeRemoved is called after shrink
	NodeRemoved *Hook `json:"postNodeRemove,omitempty"`
	// BeforeUpdate is executed before the application is updated
	BeforeUpdate *Hook `json:"preUpdate,omitempty"`
	// Updating performs application update
	Updating *Hook `json:"update,omitempty"`
	// Updated is called after successful update
	Updated *Hook `json:"postUpdate,omitempty"`
	// Rollback performs application rollback after an unsuccessful update
	Rollback *Hook `json:"rollback,omitempty"`
	// RolledBack is called after successful rollback
	RolledBack *Hook `json:"postRollback,omitempty"`
	// Status is called every minute to check application status
	Status *Hook `json:"status,omitempty"`
	// Info is used to obtain application information
	Info *Hook `json:"info,omitempty"`
	// LicenseUpdated is called after license update
	LicenseUpdated *Hook `json:"licenseUpdated,omitempty"`
	// Start starts the application
	Start *Hook `json:"start,omitempty"`
	// Stop stops the application
	Stop *Hook `json:"stop,omitempty"`
	// Dump is used to retrieve application-specific dumps for debug reports
	Dump *Hook `json:"dump,omitempty"`
	// Backup triggers application data backup
	Backup *Hook `json:"backup,omitempty"`
	// Restore restores application state from a backup
	Restore *Hook `json:"restore,omitempty"`
	// NetworkInstall is a hook for installing a custom overlay network
	NetworkInstall *Hook `json:"networkInstall,omitempty"`
	// NetworkUpdate is a hook for updating a custom overlay network
	NetworkUpdate *Hook `json:"networkUpdate,omitempty"`
	// NetworkRollback is a hook for rolling back a custom overlay network
	NetworkRollback *Hook `json:"networkRollback,omitempty"`
}

Hooks defines all supported application lifecycle hooks

func (Hooks) AllHooks

func (h Hooks) AllHooks() (all []*Hook)

AllHooks returns all non-nil hooks.

func (*Hooks) DeepCopy

func (in *Hooks) DeepCopy() *Hooks

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Hooks.

func (*Hooks) DeepCopyInto

func (in *Hooks) DeepCopyInto(out *Hooks)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IAMPolicy

type IAMPolicy struct {
	// Version is the policy version
	Version string `json:"version,omitempty"`
	// Actions is a list of IAM permissions (e.g. "ec2:CreateVolume")
	Actions []string `json:"actions,omitempty"`
}

IAMPolicy defines a list of AWS permissions

func (*IAMPolicy) DeepCopy

func (in *IAMPolicy) DeepCopy() *IAMPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IAMPolicy.

func (*IAMPolicy) DeepCopyInto

func (in *IAMPolicy) DeepCopyInto(out *IAMPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Ingress

type Ingress struct {
	// Nginx allows to customize the nginx based Ingress resource
	Nginx *Nginx `json:"nginx,omitempty"`
}

Ingress represents Ingress configuration.

type Installer

type Installer struct {
	// EULA describes the application end user license agreement
	EULA EULA `json:"eula,omitempty"`
	// SetupEndpoints is a list of names of endpoints to use in
	// post installation; only one is actually supported for now
	SetupEndpoints []string `json:"setupEndpoints,omitempty"`
	// Flavors defines application flavors
	Flavors Flavors `json:"flavors,omitempty"`
}

Installer contains installer customizations

func (*Installer) DeepCopy

func (in *Installer) DeepCopy() *Installer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Installer.

func (*Installer) DeepCopyInto

func (in *Installer) DeepCopyInto(out *Installer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Kubelet

type Kubelet struct {
	// ExternalService defines additional configuration for kubelet
	ExternalService
	// HairpinMode is deprecated and no longer used
	HairpinMode string `json:"hairpinMode,omitempty"`
}

Kubelet describes kubelet options

func (*Kubelet) DeepCopy

func (in *Kubelet) DeepCopy() *Kubelet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kubelet.

func (*Kubelet) DeepCopyInto

func (in *Kubelet) DeepCopyInto(out *Kubelet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type KubernetesExtension

type KubernetesExtension struct {
	// Disabled allows to disable Kubernetes tab
	Disabled bool `json:"disabled,omitempty"`
}

KubernetesExtension allows to customize kubernetes feature

func (*KubernetesExtension) DeepCopy

func (in *KubernetesExtension) DeepCopy() *KubernetesExtension

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesExtension.

func (*KubernetesExtension) DeepCopyInto

func (in *KubernetesExtension) DeepCopyInto(out *KubernetesExtension)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type License

type License struct {
	// Enabled is whether licensing is enabled/disabled
	Enabled bool `json:"enabled,omitempty"`
	// Type is the license type
	Type string `json:"type,omitempty"`
}

License describes an application license

func (*License) DeepCopy

func (in *License) DeepCopy() *License

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new License.

func (*License) DeepCopyInto

func (in *License) DeepCopyInto(out *License)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogsExtension

type LogsExtension struct {
	// Disabled allows to disable Logs tab
	Disabled bool `json:"disabled,omitempty"`
}

LogsExtension allows to customize logs feature

func (*LogsExtension) DeepCopy

func (in *LogsExtension) DeepCopy() *LogsExtension

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsExtension.

func (*LogsExtension) DeepCopyInto

func (in *LogsExtension) DeepCopyInto(out *LogsExtension)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Manifest

type Manifest struct {
	// Header provides basic information about application
	Header
	// BaseImage specifies the cluster image that's used as a base image
	BaseImage *BaseImage `json:"baseImage,omitempty"`
	// an HTTP address (http://) or base64 encoded image data in the format
	// that can be used in a web page
	Logo string `json:"logo,omitempty"`
	// ReleaseNotes is the application's release notes; can be either a filename
	// (file://) or an HTTP address (http://) or plain text
	ReleaseNotes string `json:"releaseNotes,omitempty"`
	// Endpoints is a list of application endpoints
	Endpoints []Endpoint `json:"endpoints,omitempty"`
	// Dependencies is other apps/packages the application depends on
	Dependencies Dependencies `json:"dependencies,omitempty"`
	// Installer customizes the installer behavior
	Installer *Installer `json:"installer,omitempty"`
	// NodeProfiles describes types of nodes the application supports
	NodeProfiles NodeProfiles `json:"nodeProfiles,omitempty"`
	// Providers contains settings specific to different providers (e.g. cloud)
	Providers *Providers `json:"providers,omitempty"`
	// Ingress configures Ingress controllers.
	Ingress *Ingress `json:"ingress,omitempty"`
	// Storage configures persistent storage providers.
	Storage *Storage `json:"storage,omitempty"`
	// License allows to turn on/off license mode for the application
	License *License `json:"license,omitempty"`
	// Hooks contains application-defined hooks
	Hooks *Hooks `json:"hooks,omitempty"`
	// SystemOptions contains various global settings
	SystemOptions *SystemOptions `json:"systemOptions,omitempty"`
	// Extensions allows to enable/disable various custom features
	Extensions *Extensions `json:"extensions,omitempty"`
	// WebConfig allows to specify config.js used by UI to customize installer
	WebConfig string `json:"webConfig,omitempty"`
}

Manifest represents an application manifest that describes a Gravity application or cluster image

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func MustParseManifestYAML

func MustParseManifestYAML(data []byte) Manifest

MustParseManifestYAML parser the provided manifest data and panics in case of parsing error

func ParseManifest

func ParseManifest(path string) (*Manifest, error)

ParseManifest parses manifest file at the specified path

func ParseManifestYAML

func ParseManifestYAML(data []byte) (*Manifest, error)

ParseManifestYAML parses the provided data as an application manifest and validates it

func ParseManifestYAMLNoValidate

func ParseManifestYAMLNoValidate(bytesYAML []byte) (*Manifest, error)

ParseManifestYAMLNoValidate parses the provided data as an application manifest and does not run any validation checks on it

func (Manifest) AllPackageDependencies

func (m Manifest) AllPackageDependencies() (deps []loc.Locator)

AllPackageDependencies returns the list of all available package dependencies

func (Manifest) Base

func (m Manifest) Base() *loc.Locator

Base returns a locator of a base application (runtime) the application depends on.

Only cluster images can have runtimes.

func (Manifest) CatalogDisabled

func (m Manifest) CatalogDisabled() bool

CatalogDisabled returns true if the application catalog feature is disabled.

func (*Manifest) DeepCopy

func (in *Manifest) DeepCopy() *Manifest

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Manifest.

func (*Manifest) DeepCopyInto

func (in *Manifest) DeepCopyInto(out *Manifest)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Manifest) DeepCopyObject

func (in *Manifest) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (Manifest) DefaultProvider

func (m Manifest) DefaultProvider() string

DefaultProvider returns the default cloud provider or an empty string.

func (Manifest) DefaultRuntimePackage

func (m Manifest) DefaultRuntimePackage() (*loc.Locator, error)

DefaultRuntimePackage returns the default runtime package

func (Manifest) DescribeKind

func (m Manifest) DescribeKind() string

DescribeKind returns a human-friendly short description of the manifest kind.

func (Manifest) DevicesForProfile

func (m Manifest) DevicesForProfile(profileName string) ([]Device, error)

DevicesForProfile returns a list of required devices for the specified profile

func (Manifest) Docker

func (m Manifest) Docker(profile NodeProfile) Docker

Docker returns docker configuration for the specified node profile. With no explicit configuration, default docker configuration is returned

func (Manifest) EULA

func (m Manifest) EULA() string

EULA returns the end-user license agreement text.

func (Manifest) EtcdArgs

func (m Manifest) EtcdArgs(profile NodeProfile) []string

EtcdArgs returns the list of additional etcd arguments for the specified node profile

func (Manifest) FilterDependencies

func (m Manifest) FilterDependencies(apps []loc.Locator) (result []loc.Locator)

FilterDependencies filters the provided list of application locators and returns only those that are enabled based on the manifest settings.

func (Manifest) FindFlavor

func (m Manifest) FindFlavor(name string) *Flavor

FindFlavor returns a flavor by the provided name

func (Manifest) FirstNodeProfile

func (m Manifest) FirstNodeProfile() (*NodeProfile, error)

FirstNodeProfile returns the first available node profile.

func (Manifest) FirstNodeProfileName

func (m Manifest) FirstNodeProfileName() (string, error)

FirstNodeProfileName returns the name of the first available node profile.

func (Manifest) FlavorNames

func (m Manifest) FlavorNames() []string

FlavorNames returns a list of all defined flavors

func (Manifest) GetNetworkType

func (m Manifest) GetNetworkType(provider, provisioner string) string

GetNetworkType looks up network type for the specified provider / provisioner pair

func (Manifest) GetObjectKind

func (m Manifest) GetObjectKind() kubeschema.ObjectKind

GetObjectKind returns the manifest header

func (Manifest) HasHook

func (m Manifest) HasHook(hook HookType) bool

HasHook returns true if manifest defines hook of the specified type

func (Manifest) ImageType

func (m Manifest) ImageType() string

ImageType returns the image type this manifest represents, cluster or application.

func (Manifest) IngressEnabled

func (m Manifest) IngressEnabled() bool

IngressEnabled returns true if Ingress is enabled.

func (Manifest) KubeletArgs

func (m Manifest) KubeletArgs(profile NodeProfile) []string

KubeletArgs returns the list of additional kubelet arguments for the specified node profile

func (Manifest) Locator

func (m Manifest) Locator() loc.Locator

Locator returns locator for this manifest's app

func (Manifest) OpenEBSEnabled

func (m Manifest) OpenEBSEnabled() bool

OpenEBSEnabled returns true if OpenEBS storage provider is enabled.

func (Manifest) OpsCenterDisabled

func (m Manifest) OpsCenterDisabled() bool

OpsCenterDisabled returns true if the Ops Center is disabled.

func (Manifest) PackageDependencies

func (m Manifest) PackageDependencies(profile string) (deps []loc.Locator, err error)

PackageDependencies returns the list of package dependencies for the specified profile

func (Manifest) PrivilegedEnabled

func (m Manifest) PrivilegedEnabled() bool

PrivilegedEnabled returns true if privileged containers should be allowed.

func (Manifest) RuntimeArgs

func (m Manifest) RuntimeArgs(profile NodeProfile) []string

RuntimeArgs returns the list of additional runtime arguments for the specified node profile

func (Manifest) RuntimeImages

func (m Manifest) RuntimeImages() (images []string)

RuntimeImages returns the list of all runtime images.

func (Manifest) RuntimePackage

func (m Manifest) RuntimePackage(profile NodeProfile) (*loc.Locator, error)

RuntimePackage returns the planet package for the specified profile. If the profile does not specify a runtime package, the default runtime package is returned

func (Manifest) RuntimePackageForProfile

func (m Manifest) RuntimePackageForProfile(profileName string) (*loc.Locator, error)

RuntimePackageForProfile returns the planet package for the specified profile

func (*Manifest) SetBase

func (m *Manifest) SetBase(locator loc.Locator)

SetBase sets a runtime application to the provided locator

func (Manifest) SetupEndpoint

func (m Manifest) SetupEndpoint() *Endpoint

SetupEndpoint returns the endpoint that is used at the post-installation step

Currently only one setup endpoint is supported, so if multiple are defines in the manifest, only the first one is returned

func (Manifest) SystemDocker

func (m Manifest) SystemDocker() Docker

SystemDocker returns global docker configuration

func (Manifest) SystemSettingsChanged

func (m Manifest) SystemSettingsChanged(other Manifest) bool

SystemSettingsChanged returns true if system settings in this manifest changed compared to the provided manifest.

func (*Manifest) UnmarshalJSON

func (m *Manifest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements encoding/json#Unmarshaler

type Metadata

type Metadata struct {
	// Name is the application name
	Name string `json:"name,omitempty"`
	// ResourceVersion is the application version in semver format
	ResourceVersion string `json:"resourceVersion,omitempty"`
	// Namespace is the application namespace
	Namespace string `json:"namespace,omitempty"`
	// Repository is the repository where application package resides;
	// it is normally not used and always equals to "gravitational.io"
	Repository string `json:"repository,omitempty"`
	// Description is the application description
	Description string `json:"description,omitempty"`
	// Author is the application author
	Author string `json:"author,omitempty"`
	// CreatedTimestamp is a timestamp the application package was built at
	CreatedTimestamp time.Time `json:"createdTimestamp,omitempty"`
	// Hidden allows to hide the app from a list of apps visible in Ops Center
	Hidden bool `json:"hidden,omitempty"`
	// Labels is labels attached to the manifest
	Labels map[string]string `json:"labels,omitempty"`
}

Metadata is the application metadata

func (*Metadata) DeepCopy

func (in *Metadata) DeepCopy() *Metadata

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata.

func (*Metadata) DeepCopyInto

func (in *Metadata) DeepCopyInto(out *Metadata)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Metadata) GetName

func (m Metadata) GetName() string

GetName returns an application name

func (Metadata) Locator

func (m Metadata) Locator() loc.Locator

Locator formats this metadata as a package locator

type MonitoringExtension

type MonitoringExtension struct {
	// Disabled allows to disable Monitoring tab
	Disabled bool `json:"disabled,omitempty"`
}

MonitoringExtension allows to customize monitoring feature

func (*MonitoringExtension) DeepCopy

func (in *MonitoringExtension) DeepCopy() *MonitoringExtension

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringExtension.

func (*MonitoringExtension) DeepCopyInto

func (in *MonitoringExtension) DeepCopyInto(out *MonitoringExtension)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Network

type Network struct {
	// MinTransferRate is minimum required transfer rate
	MinTransferRate utils.TransferRate `json:"minTransferRate,omitempty"`
	// Ports specifies port ranges that should be available on the server
	Ports []Port `json:"ports,omitempty"`
}

Network describes network requirements

func (*Network) DeepCopy

func (in *Network) DeepCopy() *Network

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network.

func (*Network) DeepCopyInto

func (in *Network) DeepCopyInto(out *Network)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Networking

type Networking struct {
	// Type is networking type
	Type string `json:"type,omitempty"`
}

Networking describes networking configuration

func (*Networking) DeepCopy

func (in *Networking) DeepCopy() *Networking

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networking.

func (*Networking) DeepCopyInto

func (in *Networking) DeepCopyInto(out *Networking)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Nginx

type Nginx struct {
	// Enabled indicates whether nginx is enabled.
	Enabled bool `json:"enabled,omitempty"`
}

Nginx represents a specific Ingress controller based on nginx.

type NodeProfile

type NodeProfile struct {
	// Name is the profile name (role), e.g. "db"
	Name string `json:"name,omitempty"`
	// Description is a verbose profile description
	Description string `json:"description,omitempty"`
	// Requirements is a list of requirements the servers of this profile
	// should satisty
	Requirements Requirements `json:"requirements,omitempty"`
	// Labels is a list of labels nodes of this profile will be marked with
	Labels map[string]string `json:"labels,omitempty"`
	// Tains is a list of taints to apply to this profile
	Taints []corev1.Taint `json:"taints,omitempty"`
	// Providers contains some cloud provider specific settings
	Providers NodeProviders `json:"providers,omitempty"`
	// ExpandPolicy specifies whether nodes of this profile can
	// be resized
	ExpandPolicy string `json:"expandPolicy,omitempty"`
	// ServiceRole is the node's system role ("master" or "node")
	ServiceRole ServiceRole `json:"serviceRole,omitempty"`
	// SystemOptions defines optional system configuration for the node
	SystemOptions *SystemOptions `json:"systemOptions,omitempty"`
}

NodeProfile describes a single node

func (*NodeProfile) DeepCopy

func (in *NodeProfile) DeepCopy() *NodeProfile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeProfile.

func (*NodeProfile) DeepCopyInto

func (in *NodeProfile) DeepCopyInto(out *NodeProfile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (NodeProfile) LabelValues

func (p NodeProfile) LabelValues() []string

LabelValues returns a list of all labels in this server profile as "key=value"

func (NodeProfile) Mounts

func (p NodeProfile) Mounts() []Volume

Mounts returns a list of mounts

func (NodeProfile) Ports

func (p NodeProfile) Ports() (tcp, udp []int, err error)

Ports parses ports ranges from the node profile.

func (NodeProfile) TaintValues

func (p NodeProfile) TaintValues() []string

TaintValues returns a list of all taints in this server profile as "key=value"

type NodeProfiles

type NodeProfiles []NodeProfile

NodeProfiles is a list of node profiles

func (NodeProfiles) ByName

func (p NodeProfiles) ByName(name string) (*NodeProfile, error)

ByName returns a node profile by its name

func (NodeProfiles) RuntimePackages

func (p NodeProfiles) RuntimePackages() (deps []loc.Locator)

RuntimePackages returns the list of runtime package dependencies for all node profiles

type NodeProviderAWS

type NodeProviderAWS struct {
	// InstanceTypes is a list of supported instance types
	InstanceTypes []string `json:"instanceTypes,omitempty"`
}

NodeProviderAWS describes AWS-specific node settings

func (*NodeProviderAWS) DeepCopy

func (in *NodeProviderAWS) DeepCopy() *NodeProviderAWS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeProviderAWS.

func (*NodeProviderAWS) DeepCopyInto

func (in *NodeProviderAWS) DeepCopyInto(out *NodeProviderAWS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeProviders

type NodeProviders struct {
	// AWS contains AWS-specific settings
	AWS NodeProviderAWS `json:"aws,omitempty"`
}

NodeProviders contains provider-specific node settings

func (*NodeProviders) DeepCopy

func (in *NodeProviders) DeepCopy() *NodeProviders

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeProviders.

func (*NodeProviders) DeepCopyInto

func (in *NodeProviders) DeepCopyInto(out *NodeProviders)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OS

type OS struct {
	// Name is the required OS name (e.g. "centos", "redhat")
	Name string `json:"name,omitempty"`
	// Versions is supported OS versions
	Versions []string `json:"versions,omitempty"`
}

OS describes OS requirements

func (*OS) DeepCopy

func (in *OS) DeepCopy() *OS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OS.

func (*OS) DeepCopyInto

func (in *OS) DeepCopyInto(out *OS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OpenEBS

type OpenEBS struct {
	// Enabled indicates whether OpenEBS is enabled.
	Enabled bool `json:"enabled,omitempty"`
}

OpenEBS represents OpenEBS configuration.

type OpsCenterExtension

type OpsCenterExtension struct {
	// Disabled disables the OpsCenter UI
	Disabled bool `json:"disabled,omitempty"`
}

OpsCenterExtension allows to disable/enable the Ops Center UI

type Port

type Port struct {
	// Protocol is port protocol ("tcp", "udp")
	Protocol string `json:"protocol,omitempty"`
	// Ranges is a list of port ranges to check
	Ranges []string `json:"ranges,omitempty"`
}

Port describes port ranges

func (*Port) DeepCopy

func (in *Port) DeepCopy() *Port

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Port.

func (*Port) DeepCopyInto

func (in *Port) DeepCopyInto(out *Port)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PortRange

type PortRange struct {
	// Protocol specifies the port's protocol
	Protocol string
	// From and To specify the port range
	From, To uint64
	// Description specifies the optional port description
	Description string
}

PortRange describes a range of cluster ports

type PortRanges

type PortRanges struct {
	// Kubernetes lists kubernetes-specific ports
	Kubernetes []PortRange
	// Installer lists installer-specific ports
	Installer []PortRange
	// Generic lists other ports
	Generic []PortRange
	// Reserved lists ports that are reserved by default
	Reserved []PortRange
	// Vxlan defines the xvlan port
	Vxlan PortRange
}

PortRanges arranges ports into groups

type Providers

type Providers struct {
	// Default specifies the default provider.
	Default string `json:"default,omitempty"`
	// AWS defines AWS-specific settings
	AWS AWS `json:"aws,omitempty"`
	// Azure defines Azure-specific settings
	Azure Azure `json:"azure,omitempty"`
	// Generic defines settings for a generic provider (e.g. onprem)
	Generic Generic `json:"generic,omitempty"`
}

Providers defines global provider-specific settings

func (*Providers) DeepCopy

func (in *Providers) DeepCopy() *Providers

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Providers.

func (*Providers) DeepCopyInto

func (in *Providers) DeepCopyInto(out *Providers)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RAM

type RAM struct {
	// Min is minimum required amount of RAM
	Min utils.Capacity `json:"min,omitempty"`
	// Max is maximum supported amount of RAM
	Max utils.Capacity `json:"max,omitempty"`
}

RAM describes RAM requirements

func (*RAM) DeepCopy

func (in *RAM) DeepCopy() *RAM

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RAM.

func (*RAM) DeepCopyInto

func (in *RAM) DeepCopyInto(out *RAM)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Requirements

type Requirements struct {
	// CPU describes CPU requirements
	CPU CPU `json:"cpu,omitempty"`
	// RAM describes RAM requirements
	RAM RAM `json:"ram,omitempty"`
	// OS describes OS requirements
	OS []OS `json:"os,omitempty"`
	// Network describes network requirements
	Network Network `json:"network,omitempty"`
	// Volumes describes volumes requirements
	Volumes []Volume `json:"volumes,omitempty"`
	// Devices describes devices that should be created inside container
	Devices []Device `json:"devices,omitempty"`
	// CustomChecks lists additional preflight checks as inline scripts
	CustomChecks []CustomCheck `json:"customChecks,omitempty"`
}

Requirements defines a set of requirements for a node profile

func (*Requirements) DeepCopy

func (in *Requirements) DeepCopy() *Requirements

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Requirements.

func (*Requirements) DeepCopyInto

func (in *Requirements) DeepCopyInto(out *Requirements)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Runtime

type Runtime struct {
	// Locator is the runtime package locator
	Locator loc.Locator
}

Runtime describes the application runtime

func (*Runtime) DeepCopy

func (in *Runtime) DeepCopy() *Runtime

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Runtime.

func (*Runtime) DeepCopyInto

func (in *Runtime) DeepCopyInto(out *Runtime)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Runtime) MarshalJSON

func (r Runtime) MarshalJSON() ([]byte, error)

MarshalJSON marshals runtime package

func (*Runtime) UnmarshalJSON

func (r *Runtime) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals runtime package

type ServiceRole

type ServiceRole string

ServiceRole defines the type for the node service role

const (
	// ServiceRoleMaster names a label that defines a master node role
	ServiceRoleMaster ServiceRole = "master"

	// ServiceRoleNode names a label that defines a regular node role
	ServiceRoleNode ServiceRole = "node"

	// ApplicationDefaultNamespace defines the default application manifest
	ApplicationDefaultNamespace = "default"
)

type Storage

type Storage struct {
	// OpenEBS is the OpenEBS storage provider configuration.
	OpenEBS *OpenEBS `json:"openebs,omitempty"`
}

Storage represents persistent storage configuration.

type SystemDependencies

type SystemDependencies struct {
	// Runtime describes the runtime package
	Runtime *Dependency `json:"runtimePackage,omitempty"`
}

SystemDependencies defines additional system-level package dependencies

type SystemOptions

type SystemOptions struct {
	// ExternalService specifies additional configuration for the runtime package
	ExternalService
	// Runtime describes the runtime the application is based on
	Runtime *Runtime `json:"runtime,omitempty"`
	// Docker describes docker options
	Docker *Docker `json:"docker,omitempty"`
	// Etcd describes etcd options
	Etcd *Etcd `json:"etcd,omitempty"`
	// Kubelet describes kubelet options
	Kubelet *Kubelet `json:"kubelet,omitempty"`
	// BaseImage optionally overrides the planet image.
	// If specified, the image is vendored locally and translated into a runtime package.
	// If this is specified for a specific node profile, only nodes with the profile
	// will have that runtime package installed.
	BaseImage string `json:"baseImage,omitempty"`
	// Dependencies defines additional package dependencies
	Dependencies SystemDependencies `json:"dependencies"`
	// AllowPrivileged controls whether privileged containers will be allowed
	// in the cluster.
	AllowPrivileged bool `json:"allowPrivileged,omitempty"`
}

SystemOptions defines various global settings

func (*SystemOptions) DeepCopy

func (in *SystemOptions) DeepCopy() *SystemOptions

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemOptions.

func (*SystemOptions) DeepCopyInto

func (in *SystemOptions) DeepCopyInto(out *SystemOptions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SystemOptions) DockerConfig

func (r *SystemOptions) DockerConfig() *Docker

DockerConfig returns docker configuration for this options object

func (*SystemOptions) EtcdArgs

func (r *SystemOptions) EtcdArgs() []string

EtcdArgs returns a list of additional etcd arguments

func (*SystemOptions) KubeletArgs

func (r *SystemOptions) KubeletArgs() []string

KubeletArgs returns a list of additional kubelet arguments

func (*SystemOptions) RuntimeArgs

func (r *SystemOptions) RuntimeArgs() []string

RuntimeArgs returns a list of additional runtime arguments

type Volume

type Volume struct {
	// Name is a volume short name for referencing
	Name string `json:"name,omitempty"`
	// Path is a volume path on host
	Path string `json:"path,omitempty"`
	// TargetPath is a volume mount path inside planet
	TargetPath string `json:"targetPath,omitempty"`
	// Capacity is required capacity
	Capacity utils.Capacity `json:"capacity,omitempty"`
	// Filesystems is a list of supported filesystems
	Filesystems []string `json:"filesystems,omitempty"`
	// CreateIfMissing is whether to create directory on host if it's missing
	CreateIfMissing *bool `json:"createIfMissing,omitempty"`
	// SkipIfMissing avoids mounting a directory inside a container if it's missing on host.
	// This flag implies CreateIfMissing == false.
	// The rationale for this flag is to be able to define mounts optimistically
	// for multiple disparate locations (subject to specific OS distributions)
	// and only actually create mounts for existing directories.
	//
	// For a configuration with two mounts: /path/to/dir1 (as found on OS1)
	// and /path/to/dir2 (as found on OS2) to some location inside the container,
	// installing on OS1 will use /path/to/dir1 as a mount source,
	// while installing on OS2 will use /path/to/dir2.
	SkipIfMissing *bool `json:"skipIfMissing,omitempty"`
	// MinTransferRate is required disk speed
	MinTransferRate utils.TransferRate `json:"minTransferRate,omitempty"`
	// Hidden applies to mounts and means that the mount is not shown to a user in installer UI
	Hidden bool `json:"hidden,omitempty"`
	// UID sets UID for a volume path on the host
	UID *int `json:"uid,omitempty"`
	// GID sets GID for a volume path on the host
	GID *int `json:"gid,omitempty"`
	// Mode sets file mode for a volume path on the host
	// accepts octal format
	Mode string `json:"mode,omitempty"`
	// Recursive means that all mount points inside this mount should also be mounted
	Recursive bool `json:"recursive,omitempty"`
	// SELinuxLabel specifies the SELinux label.
	// If left unspecified, the default.ContainerFileLabel will be used to label the directory.
	// If a special value SELinuxLabelNone is specified - no labeling is performed
	SELinuxLabel string `json:"seLinuxLabel,omitempty"`
}

Volume describes a volume requirement

func DiffVolumes

func DiffVolumes(old, new []Volume) []Volume

DiffVolumes returns a difference between old and new volume requirements.

func (*Volume) CheckAndSetDefaults

func (v *Volume) CheckAndSetDefaults() error

CheckAndSetDefaults checks and sets defaults

func (*Volume) DeepCopy

func (in *Volume) DeepCopy() *Volume

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volume.

func (*Volume) DeepCopyInto

func (in *Volume) DeepCopyInto(out *Volume)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Volume) FileMode

func (v Volume) FileMode() (os.FileMode, error)

FileMode parses mode from octal string representation and returns os.FileMode instead

func (Volume) IsMount

func (v Volume) IsMount() bool

IsMount returns true if the volume defines a mount point

Directories

Path Synopsis
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.

Jump to

Keyboard shortcuts

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