deployment

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProfilesForVersionAndRequirements

func GetProfilesForVersionAndRequirements(version *semver.Version, requirements AstarteProfileRequirements) map[string]AstarteClusterProfile

GetProfilesForVersionAndRequirements gets all profiles compatible with given version and requirements

Types

type AstarteClusterProfile

type AstarteClusterProfile struct {
	Name               string                            `yaml:"name"`
	Description        string                            `yaml:"description"`
	Compatibility      AstarteProfileCompatibility       `yaml:"compatibility"`
	Requirements       AstarteProfileRequirements        `yaml:"requirements"`
	DefaultSpec        Astartev1alpha1DeploymentSpec     `yaml:"defaultSpec"`
	CustomizableFields []AstarteProfileCustomizableField `yaml:"customizableFields"`
}

AstarteClusterProfile represents a deployment profile for an Astarte Cluster

func GetAllBuiltinAstarteClusterProfiles

func GetAllBuiltinAstarteClusterProfiles() []AstarteClusterProfile

GetAllBuiltinAstarteClusterProfiles returns all the bundled Cluster profiles.

func GetMatchingProfile added in v0.10.5

func GetMatchingProfile(name string, version *semver.Version) AstarteClusterProfile

GetMatchingProfile returns a profile which matches name and version requirements, or an invalid profile.

func (*AstarteClusterProfile) IsValid added in v0.10.5

func (p *AstarteClusterProfile) IsValid() bool

IsValid returns whether the AstarteClusterProfile is valid or not.

type AstarteProfileCompatibility

type AstarteProfileCompatibility struct {
	MinAstarteVersion *semver.Version `yaml:"minAstarteVersion,omitempty"`
	MaxAstarteVersion *semver.Version `yaml:"maxAstarteVersion,omitempty"`
}

AstarteProfileCompatibility represents a compatibility range for an Astarte profile

type AstarteProfileCustomizableField

type AstarteProfileCustomizableField struct {
	Field      string          `yaml:"field"`
	Question   string          `yaml:"question"`
	Default    interface{}     `yaml:"default"`
	Type       types.BasicKind `yaml:"type"`
	AllowEmpty bool            `yaml:"allowEmpty,omitempty"`
}

AstarteProfileCustomizableField represents a customizable field in a deployment profile

type AstarteProfileRequirements

type AstarteProfileRequirements struct {
	CPUAllocation    int64 `yaml:"cpuAllocation"`
	MemoryAllocation int64 `yaml:"memoryAllocation"`
	MinNodes         int   `yaml:"minNodes,omitempty"`
	MaxNodes         int   `yaml:"maxNodes,omitempty"`
}

AstarteProfileRequirements represents the requirements for an Astarte profile

type Astartev1alpha1Deployment

type Astartev1alpha1Deployment struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name        string            `yaml:"name"`
		Namespace   string            `yaml:"namespace"`
		Annotations map[string]string `yaml:"annotations,omitempty"`
	} `yaml:"metadata"`
	Spec Astartev1alpha1DeploymentSpec `yaml:"spec"`
}

Astartev1alpha1Deployment represents an Astarte Deployment object

func GetBaseAstartev1alpha1Deployment

func GetBaseAstartev1alpha1Deployment() Astartev1alpha1Deployment

GetBaseAstartev1alpha1Deployment returns a ready to customise deployment spec for an Astarte v1alpha1 resource

type Astartev1alpha1DeploymentSpec

type Astartev1alpha1DeploymentSpec struct {
	Version             string      `yaml:"version"`
	ImagePullPolicy     string      `yaml:"imagePullPolicy,omitempty"`
	ImagePullSecrets    []string    `yaml:"imagePullSecrets,omitempty"`
	DistributionChannel string      `yaml:"distributionChannel,omitempty"`
	Rbac                bool        `yaml:"rbac,omitempty"`
	StorageClassName    interface{} `yaml:"storageClassName,omitempty"`
	API                 struct {
		Ssl  bool   `yaml:"ssl,omitempty"`
		Host string `yaml:"host"`
	} `yaml:"api"`
	Rabbitmq struct {
		Deploy     bool `yaml:"deploy,omitempty"`
		Connection struct {
			Host     string `yaml:"host"`
			Port     string `yaml:"port"`
			Username string `yaml:"username"`
			Password string `yaml:"password"`
			Secret   struct {
				Name        string `yaml:"name"`
				UsernameKey string `yaml:"usernameKey"`
				PasswordKey string `yaml:"passwordKey"`
			} `yaml:"secret"`
		} `yaml:"connection,omitempty"`
		Replicas     int  `yaml:"replicas,omitempty"`
		AntiAffinity bool `yaml:"antiAffinity,omitempty"`
		Storage      struct {
			Size             string      `yaml:"size"`
			ClassName        string      `yaml:"className,omitempty"`
			VolumeDefinition interface{} `yaml:"volumeDefinition,omitempty"`
		} `yaml:"storage,omitempty"`
		Resources struct {
			Requests struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"requests"`
			Limits struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"limits"`
		} `yaml:"resources,omitempty"`
	} `yaml:"rabbitmq"`
	Cassandra struct {
		Deploy       bool   `yaml:"deploy"`
		Version      string `yaml:"version,omitempty"`
		Nodes        string `yaml:"nodes,omitempty"`
		Replicas     int    `yaml:"replicas,omitempty"`
		AntiAffinity bool   `yaml:"antiAffinity,omitempty"`
		MaxHeapSize  string `yaml:"maxHeapSize,omitempty"`
		HeapNewSize  string `yaml:"heapNewSize,omitempty"`
		Storage      struct {
			Size             string      `yaml:"size"`
			ClassName        string      `yaml:"className,omitempty"`
			VolumeDefinition interface{} `yaml:"volumeDefinition,omitempty"`
		} `yaml:"storage,omitempty"`
		Resources struct {
			Requests struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"requests"`
			Limits struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"limits"`
		} `yaml:"resources,omitempty"`
	} `yaml:"cassandra"`
	Vernemq struct {
		Host                      string `yaml:"host,omitempty"`
		Port                      int    `yaml:"port,omitempty"`
		Deploy                    bool   `yaml:"deploy,omitempty"`
		Replicas                  int    `yaml:"replicas,omitempty"`
		AntiAffinity              bool   `yaml:"antiAffinity,omitempty"`
		SslListener               bool   `yaml:"sslListener,omitempty"`
		SslListenerCertSecretName string `yaml:"sslListenerCertSecretName,omitempty"`
		CaSecret                  string `yaml:"caSecret,omitempty"`
		Storage                   struct {
			Size             string      `yaml:"size"`
			ClassName        string      `yaml:"className,omitempty"`
			VolumeDefinition interface{} `yaml:"volumeDefinition,omitempty"`
		} `yaml:"storage,omitempty"`
		Resources struct {
			Requests struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"requests"`
			Limits struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"limits"`
		} `yaml:"resources,omitempty"`
	} `yaml:"vernemq"`
	Cfssl struct {
		Deploy            bool   `yaml:"deploy,omitempty"`
		Replicas          int    `yaml:"replicas,omitempty"`
		URL               string `yaml:"url,omitempty"`
		CaExpiry          string `yaml:"caExpiry,omitempty"`
		CertificateExpiry string `yaml:"certificateExpiry,omitempty"`
		DbConfig          struct {
			Driver     string `yaml:"driver,omitempty"`
			DataSource string `yaml:"dataSource,omitempty"`
		} `yaml:"dbConfig,omitempty"`
		Resources struct {
			Requests struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"requests"`
			Limits struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"limits"`
		} `yaml:"resources,omitempty"`
		Storage struct {
			Size             string      `yaml:"size"`
			ClassName        string      `yaml:"className,omitempty"`
			VolumeDefinition interface{} `yaml:"volumeDefinition,omitempty"`
		} `yaml:"storage,omitempty"`
		CsrRootCa struct {
			CN  string `yaml:"CN"`
			Key struct {
				Algo string `yaml:"algo"`
				Size int    `yaml:"size"`
			} `yaml:"key"`
			Names []struct {
				C  string `yaml:"C"`
				L  string `yaml:"L"`
				O  string `yaml:"O"`
				OU string `yaml:"OU"`
				ST string `yaml:"ST"`
			} `yaml:"names"`
			Ca struct {
				Expiry string `yaml:"expiry"`
			} `yaml:"ca"`
		} `yaml:"csrRootCa,omitempty"`
		CaRootConfig struct {
			Signing struct {
				Default struct {
					Usages       []string `yaml:"usages"`
					Expiry       string   `yaml:"expiry"`
					CaConstraint struct {
						IsCa           bool `yaml:"isCa"`
						MaxPathLen     int  `yaml:"maxPathLen"`
						MaxPathLenZero bool `yaml:"maxPathLenZero"`
					} `yaml:"caConstraint"`
				} `yaml:"default"`
			} `yaml:"signing"`
		} `yaml:"caRootConfig,omitempty"`
	} `yaml:"cfssl"`
	Components struct {
		Resources struct {
			Requests struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"requests"`
			Limits struct {
				CPU    string `yaml:"cpu"`
				Memory string `yaml:"memory"`
			} `yaml:"limits"`
		} `yaml:"resources,omitempty"`
		Housekeeping struct {
			API     Astartev1alpha1GenericAPISpec     `yaml:"api,omitempty"`
			Backend Astartev1alpha1GenericBackendSpec `yaml:"backend,omitempty"`
		} `yaml:"housekeeping,omitempty"`
		RealmManagement struct {
			API     Astartev1alpha1GenericAPISpec     `yaml:"api,omitempty"`
			Backend Astartev1alpha1GenericBackendSpec `yaml:"backend,omitempty"`
		} `yaml:"realmManagement,omitempty"`
		Pairing struct {
			API     Astartev1alpha1GenericAPISpec     `yaml:"api,omitempty"`
			Backend Astartev1alpha1GenericBackendSpec `yaml:"backend,omitempty"`
		} `yaml:"pairing,omitempty"`
		DataUpdaterPlant struct {
			Replicas       int    `yaml:"replicas,omitempty"`
			DataQueueCount int    `yaml:"dataQueueCount,omitempty"`
			Version        string `yaml:"version,omitempty"`
			Resources      struct {
				Requests struct {
					CPU    string `yaml:"cpu"`
					Memory string `yaml:"memory"`
				} `yaml:"requests"`
				Limits struct {
					CPU    string `yaml:"cpu"`
					Memory string `yaml:"memory"`
				} `yaml:"limits"`
			} `yaml:"resources,omitempty"`
		} `yaml:"dataUpdaterPlant,omitempty"`
		AppengineAPI struct {
			Replicas              int    `yaml:"replicas,omitempty"`
			DisableAuthentication bool   `yaml:"disableAuthentication,omitempty"`
			MaxResultsLimit       int    `yaml:"maxResultsLimit,omitempty"`
			Version               string `yaml:"version,omitempty"`
			Resources             struct {
				Requests struct {
					CPU    string `yaml:"cpu"`
					Memory string `yaml:"memory"`
				} `yaml:"requests"`
				Limits struct {
					CPU    string `yaml:"cpu"`
					Memory string `yaml:"memory"`
				} `yaml:"limits"`
			} `yaml:"resources,omitempty"`
		} `yaml:"appengineApi,omitempty"`
		TriggerEngine struct {
			Deploy    bool   `yaml:"deploy,omitempty"`
			Replicas  int    `yaml:"replicas,omitempty"`
			Version   string `yaml:"version,omitempty"`
			Resources struct {
				Requests struct {
					CPU    string `yaml:"cpu"`
					Memory string `yaml:"memory"`
				} `yaml:"requests"`
				Limits struct {
					CPU    string `yaml:"cpu"`
					Memory string `yaml:"memory"`
				} `yaml:"limits"`
			} `yaml:"resources,omitempty"`
		} `yaml:"triggerEngine,omitempty"`
		Dashboard struct {
			Deploy       bool   `yaml:"deploy,omitempty"`
			Replicas     int    `yaml:"replicas,omitempty"`
			DefaultRealm string `yaml:"defaultRealm,omitempty"`
			Version      string `yaml:"version,omitempty"`
			Config       struct {
				RealmManagementAPIURL string `yaml:"realmManagementApiUrl"`
				DefaultRealm          string `yaml:"defaultRealm"`
				DefaultAuth           string `yaml:"defaultAuth"`
				Auth                  []struct {
					Type string `yaml:"type"`
				} `yaml:"auth"`
			} `yaml:"config,omitempty"`
			Resources struct {
				Requests struct {
					CPU    string `yaml:"cpu"`
					Memory string `yaml:"memory"`
				} `yaml:"requests"`
				Limits struct {
					CPU    string `yaml:"cpu"`
					Memory string `yaml:"memory"`
				} `yaml:"limits"`
			} `yaml:"resources,omitempty"`
		} `yaml:"dashboard,omitempty"`
	} `yaml:"components"`
}

Astartev1alpha1DeploymentSpec represents the spec for Kubernetes API api.astarte-platform.org/v1alpha1/Astarte

type Astartev1alpha1GenericAPISpec

type Astartev1alpha1GenericAPISpec struct {
	Replicas              int    `yaml:"replicas,omitempty"`
	DisableAuthentication bool   `yaml:"disableAuthentication,omitempty"`
	Version               string `yaml:"version,omitempty"`
	Resources             struct {
		Requests struct {
			CPU    string `yaml:"cpu"`
			Memory string `yaml:"memory"`
		} `yaml:"requests"`
		Limits struct {
			CPU    string `yaml:"cpu"`
			Memory string `yaml:"memory"`
		} `yaml:"limits"`
	} `yaml:"resources,omitempty"`
}

Astartev1alpha1GenericAPISpec represents a generic Astarte API Component in the Deployment spec

type Astartev1alpha1GenericBackendSpec

type Astartev1alpha1GenericBackendSpec struct {
	Replicas  int    `yaml:"replicas,omitempty"`
	Version   string `yaml:"version,omitempty"`
	Resources struct {
		Requests struct {
			CPU    string `yaml:"cpu"`
			Memory string `yaml:"memory"`
		} `yaml:"requests"`
		Limits struct {
			CPU    string `yaml:"cpu"`
			Memory string `yaml:"memory"`
		} `yaml:"limits"`
	} `yaml:"resources,omitempty"`
}

Astartev1alpha1GenericBackendSpec represents a generic Astarte Backend Component in the Deployment spec

Jump to

Keyboard shortcuts

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