v1alpha1

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the mattermost v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=mattermost.com

Package v1alpha1 contains API Schema definitions for the mattermost v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=mattermost.com

Index

Constants

View Source
const (
	// OperatorName is the name of the Mattermost operator
	OperatorName = "mattermost-operator"
	// DefaultMattermostImage is the default Mattermost docker image
	DefaultMattermostImage = "mattermost/mattermost-enterprise-edition"
	// DefaultMattermostVersion is the default Mattermost docker tag
	DefaultMattermostVersion = "5.12.4"
	// DefaultMattermostSize is the default number of users
	DefaultMattermostSize = "5000users"
	// DefaultMattermostDatabaseType is the default Mattermost database
	DefaultMattermostDatabaseType = "mysql"
	// DefaultMinioStorageSize is the default Storage size for Minio
	DefaultMinioStorageSize = "50Gi"
	// DefaultStorageSize is the default Storage size for the Database
	DefaultStorageSize = "50Gi"

	// ClusterLabel is the label applied across all compoments
	ClusterLabel = "v1alpha1.mattermost.com/installation"
	// ClusterResourceLabel is the label applied to a given ClusterInstallation
	// as well as all other resources created to support it.
	ClusterResourceLabel = "v1alpha1.mattermost.com/resource"
)
View Source
const Size10000String = "10000users"
View Source
const Size1000String = "1000users"
View Source
const Size100String = "100users"
View Source
const Size25000String = "25000users"
View Source
const Size5000String = "5000users"
View Source
const SizeMiniHAString = "miniHA"
View Source
const SizeMiniSingletonString = "miniSingleton"

Variables

View Source
var (
	//SchemeBuilder is the builder object for the mattermost scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	//AddToScheme is the function to add a mattermost scheme to the serializer.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: "mattermost.com", Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func ClusterInstallationLabels

func ClusterInstallationLabels(name string) map[string]string

ClusterInstallationLabels returns the labels for selecting the resources belonging to the given mattermost clusterinstallation.

func ClusterInstallationResourceLabels

func ClusterInstallationResourceLabels(name string) map[string]string

ClusterInstallationResourceLabels returns the labels for selecting a given ClusterInstallation as well as any external dependency resources that were created for the installation.

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ClusterInstallation

type ClusterInstallation struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object’s metadata. More info:
	// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata,omitempty"`
	// Specification of the desired behavior of the Mattermost cluster. More info:
	// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
	Spec ClusterInstallationSpec `json:"spec"`
	// Most recent observed status of the Mattermost cluster. Read-only. Not
	// included when requesting from the apiserver, only from the Mattermost
	// Operator API itself. More info:
	// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
	Status ClusterInstallationStatus `json:"status,omitempty"`
}

ClusterInstallation is the Schema for the clusterinstallations API +k8s:openapi-gen=true +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:priority=0,name="State",type=string,JSONPath=".status.state",description="State of Mattermost" +kubebuilder:printcolumn:priority=0,name="Image",type=string,JSONPath=".status.image",description="Image of Mattermost" +kubebuilder:printcolumn:priority=0,name="Version",type=string,JSONPath=".status.version",description="Version of Mattermost" +kubebuilder:printcolumn:priority=0,name="Endpoint",type=string,JSONPath=".status.endpoint",description="Endpoint"

func (*ClusterInstallation) DeepCopy

func (in *ClusterInstallation) DeepCopy() *ClusterInstallation

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

func (*ClusterInstallation) DeepCopyInto

func (in *ClusterInstallation) DeepCopyInto(out *ClusterInstallation)

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

func (*ClusterInstallation) DeepCopyObject

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

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

func (*ClusterInstallation) GenerateDeployment

func (mattermost *ClusterInstallation) GenerateDeployment(dbUser, dbPassword string, externalDB, isLicensed bool, minioService string) *appsv1.Deployment

GenerateDeployment returns the deployment spec for Mattermost

func (*ClusterInstallation) GenerateIngress

func (mattermost *ClusterInstallation) GenerateIngress() *v1beta1.Ingress

GenerateIngress returns the ingress for Mattermost

func (*ClusterInstallation) GenerateSecret

func (mattermost *ClusterInstallation) GenerateSecret(secretName string, labels map[string]string, values map[string][]byte) *corev1.Secret

GenerateSecret returns the service for Mattermost

func (*ClusterInstallation) GenerateService

func (mattermost *ClusterInstallation) GenerateService() *corev1.Service

GenerateService returns the service for Mattermost

func (*ClusterInstallation) GetImageName

func (mattermost *ClusterInstallation) GetImageName() string

GetImageName returns the container image name that matches the spec of the ClusterInstallation.

func (*ClusterInstallation) SetDefaults

func (mattermost *ClusterInstallation) SetDefaults() error

SetDefaults set the missing values in the manifest to the default ones

func (*ClusterInstallation) SetReplicasAndResourcesFromSize

func (mattermost *ClusterInstallation) SetReplicasAndResourcesFromSize() error

SetReplicasAndResourcesFromSize will use the Size field to determine the number of replicas and resource requests to set for a ClusterInstallation. If Replicas or Resources for any components are manually set in the spec then those values will not be changed.

type ClusterInstallationList

type ClusterInstallationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterInstallation `json:"items"`
}

ClusterInstallationList contains a list of ClusterInstallation

func (*ClusterInstallationList) DeepCopy

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

func (*ClusterInstallationList) DeepCopyInto

func (in *ClusterInstallationList) DeepCopyInto(out *ClusterInstallationList)

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

func (*ClusterInstallationList) DeepCopyObject

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

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

type ClusterInstallationSize

type ClusterInstallationSize struct {
	App      ComponentSize
	Minio    ComponentSize
	Database ComponentSize
}

ClusterInstallationSize is sizing configuration used to convert user count to replica and resource requirements.

func GetClusterSize added in v0.5.2

func GetClusterSize(key string) (ClusterInstallationSize, error)

GetClusterSize returns a ClusterInstallationSize based on the provided size key.

func (*ClusterInstallationSize) CalculateCPUMilliRequirement added in v0.5.2

func (cis *ClusterInstallationSize) CalculateCPUMilliRequirement(includeDatabase, includeMinio bool) int64

CalculateCPUMilliRequirement returns the milli value for the CPU request of the cluster size.

func (*ClusterInstallationSize) CalculateMemoryMilliRequirement added in v0.5.2

func (cis *ClusterInstallationSize) CalculateMemoryMilliRequirement(includeDatabase, includeMinio bool) int64

CalculateMemoryMilliRequirement returns the milli value for the memory request of the cluster size.

func (*ClusterInstallationSize) CalculateResourceMilliRequirements added in v0.5.2

func (cis *ClusterInstallationSize) CalculateResourceMilliRequirements(includeDatabase, includeMinio bool) (int64, int64)

CalculateResourceMilliRequirements returns the milli values for the CPU and memory requests of the cluster size.

func (*ClusterInstallationSize) DeepCopy

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

func (*ClusterInstallationSize) DeepCopyInto

func (in *ClusterInstallationSize) DeepCopyInto(out *ClusterInstallationSize)

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

type ClusterInstallationSpec

type ClusterInstallationSpec struct {
	// Image defines the ClusterInstallation Docker image.
	Image string `json:"image,omitempty"`
	// Version defines the ClusterInstallation Docker image version.
	Version string `json:"version,omitempty"`
	// Size defines the size of the ClusterInstallation. This is typically specified in number of users.
	// This will set replica and resource requests/limits appropriately for the provided number of users.
	// Accepted values are: 100users, 1000users, 5000users, 10000users, 250000users. Defaults to 5000users.
	// Setting 'Replicas', 'Resources', 'Minio.Replicas', 'Minio.Resource', 'Database.Replicas',
	// or 'Database.Resources' will override the values set by Size.
	Size string `json:"size,omitempty"`
	// Replicas defines the number of replicas to use for the Mattermost app servers.
	// Setting this will override the number of replicas set by 'Size'.
	// +optional
	Replicas int32 `json:"replicas,omitempty"`
	// Defines the resource requests and limits for the Mattermost app server pods.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
	// IngressName defines the name to be used when creating the ingress rules
	IngressName string `json:"ingressName"`
	// Secret that contains the mattermost license
	// +optional
	MattermostLicenseSecret string `json:"mattermostLicenseSecret,omitempty"`
	// NodeSelector is a selector which must be true for the pod to fit on a node.
	// Selector which must match a node's labels for the pod to be scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// If specified, affinity will define the pod's scheduling constraints
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	Minio Minio `json:"minio,omitempty"`

	Database Database `json:"database,omitempty"`
	// +optional
	ElasticSearch ElasticSearch `json:"elasticSearch,omitempty"`

	// +optional
	UseServiceLoadBalancer bool `json:"useServiceLoadBalancer,omitempty"`

	// +optional
	ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`

	// +optional
	IngressAnnotations map[string]string `json:"ingressAnnotations,omitempty"`
}

ClusterInstallationSpec defines the desired state of ClusterInstallation +k8s:openapi-gen=true

func (*ClusterInstallationSpec) DeepCopy

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

func (*ClusterInstallationSpec) DeepCopyInto

func (in *ClusterInstallationSpec) DeepCopyInto(out *ClusterInstallationSpec)

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

type ClusterInstallationStatus

type ClusterInstallationStatus struct {
	// Represents the running state of the Mattermost instance
	// +optional
	State RunningState `json:"state,omitempty"`
	// The version currently running in the Mattermost instance
	// +optional
	Version string `json:"version,omitempty"`
	// The image running on the pods in the Mattermost instance
	// +optional
	Image string `json:"image,omitempty"`
	// The endpoint to access the Mattermost instance
	// +optional
	Endpoint string `json:"endpoint,omitempty"`
	// Total number of non-terminated pods targeted by this Mattermost deployment
	// +optional
	Replicas int32 `json:"replicas,omitempty"`
	// Total number of non-terminated pods targeted by this Mattermost deployment
	// that are running with the desired image.
	// +optional
	UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`
}

ClusterInstallationStatus defines the observed state of ClusterInstallation

func (*ClusterInstallationStatus) DeepCopy

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

func (*ClusterInstallationStatus) DeepCopyInto

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

type ComponentSize

type ComponentSize struct {
	Replicas  int32
	Resources corev1.ResourceRequirements
}

ComponentSize is sizing configuration for different components of a ClusterInstallation.

func (*ComponentSize) DeepCopy

func (in *ComponentSize) DeepCopy() *ComponentSize

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

func (*ComponentSize) DeepCopyInto

func (in *ComponentSize) DeepCopyInto(out *ComponentSize)

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

type Database

type Database struct {
	Type string `json:"type,omitempty"`
	// If the user want to use an external DB.
	// This can be inside the same k8s cluster or outside like AWS RDS.
	// +optional
	ExternalSecret string `json:"externalSecret,omitempty"`
	// Defines the storage size for the database. ie 50Gi
	// +optional
	// +kubebuilder:validation:Pattern=^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
	StorageSize string `json:"storageSize,omitempty"`
	// Defines the number of database replicas.
	// For redundancy use at least 2 replicas.
	// Setting this will override the number of replicas set by 'Size'.
	// +optional
	Replicas int32 `json:"replicas,omitempty"`
	// Defines the resource requests and limits for the database pods.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

Database defines the database configuration for a ClusterInstallation.

func (*Database) DeepCopy

func (in *Database) DeepCopy() *Database

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

func (*Database) DeepCopyInto

func (in *Database) DeepCopyInto(out *Database)

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

func (*Database) SetDefaults

func (db *Database) SetDefaults()

SetDefaults sets the missing values in Database to the default ones

type ElasticSearch

type ElasticSearch struct {
	Host string `json:"host,omitempty"`
	// +optional
	UserName string `json:"username,omitempty"`

	Password string `json:"password,omitempty"`
}

ElasticSearch defines the ElasticSearch configuration for a ClusterInstallation.

func (*ElasticSearch) DeepCopy

func (in *ElasticSearch) DeepCopy() *ElasticSearch

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

func (*ElasticSearch) DeepCopyInto

func (in *ElasticSearch) DeepCopyInto(out *ElasticSearch)

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

type Minio

type Minio struct {
	// Defines the storage size for Minio. ie 50Gi
	// +optional
	// +kubebuilder:validation:Pattern=^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
	StorageSize string `json:"storageSize,omitempty"`
	// Defines the number of Minio replicas.
	// Supply 1 to run Minio in standalone mode with no redundancy.
	// Supply 4 or more to run Minio in distributed mode.
	// Note that it is not possible to upgrade Minio from standalone to distributed mode.
	// Setting this will override the number of replicas set by 'Size'.
	// More info: https://docs.min.io/docs/distributed-minio-quickstart-guide.html
	// +optional
	Replicas int32 `json:"replicas,omitempty"`
	// Defines the resource requests and limits for the Minio pods.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

Minio defines the configuration of Minio for a ClusterInstallation.

func (*Minio) DeepCopy

func (in *Minio) DeepCopy() *Minio

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

func (*Minio) DeepCopyInto

func (in *Minio) DeepCopyInto(out *Minio)

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

func (*Minio) SetDefaults

func (mi *Minio) SetDefaults()

SetDefaults sets the missing values in Minio to the default ones

type RunningState

type RunningState string

RunningState is the state of the Mattermost instance

const (
	// Reconciling is the state when the Mattermost instance is being updated
	Reconciling RunningState = "reconciling"
	// Stable is the state when the Mattermost instance is fully running
	Stable RunningState = "stable"
)

Running States: Two types of instance running states are implemented: reconciling and stable. If any changes are being made on the mattermost instance, the state will be set to reconciling. If the reconcile loop reaches the end without requeuing then the state will be set to stable.

Jump to

Keyboard shortcuts

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