v1

package
v0.0.0-...-31fc70c Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the elasticsearch v1 API group +kubebuilder:object:generate=true +groupName=elasticsearch.k8s.webcenter.fr

Index

Constants

View Source
const (
	ElasticsearchAnnotationKey = "elasticsearch.k8s.webcenter.fr"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "elasticsearch.k8s.webcenter.fr", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func SetupElasticsearchIndexer

func SetupElasticsearchIndexer(k8sManager manager.Manager) (err error)

SetupIndexer setup indexer for Elasticsearch

Types

type Elasticsearch

type Elasticsearch struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ElasticsearchSpec   `json:"spec,omitempty"`
	Status ElasticsearchStatus `json:"status,omitempty"`
}

Elasticsearch is the Schema for the elasticsearchs API +operator-sdk:csv:customresourcedefinitions:resources={{Ingress,networking.k8s.io/v1},{ConfigMap,v1},{Service,v1},{Secret,v1},{Deployment,apps/v1},{StatefulSet,apps/v1},{License,elasticsearchapi.k8s.webcenter.fr/v1},{NetworkPolicy,networking.k8s.io/v1},{PodDisruptionBudget,policy/v1},{PodMonitor,monitoring.coreos.com/v1},{User,elasticsearchapi.k8s.webcenter.fr/v1},{Metricbeat,beat.k8s.webcenter.fr/v1}} +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".status.url" +kubebuilder:printcolumn:name="CredentialsRef",type="string",JSONPath=".status.credentialsRef.name" +kubebuilder:printcolumn:name="Health",type="string",JSONPath=".status.health",description="Cluster health" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Phase" +kubebuilder:printcolumn:name="Error",type="boolean",JSONPath=".status.isOnError",description="Is on error" +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status",description="health" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

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.

func (*Elasticsearch) DeepCopyObject

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

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

func (*Elasticsearch) GetStatus

GetStatus implement the object.MultiPhaseObject

func (*Elasticsearch) IsBoostrapping

func (h *Elasticsearch) IsBoostrapping() bool

IsBoostraping return true if cluster is already bootstraped

func (*Elasticsearch) IsIngressEnabled

func (h *Elasticsearch) IsIngressEnabled() bool

IsIngressEnabled return true if ingress is enabled

func (*Elasticsearch) IsLoadBalancerEnabled

func (h *Elasticsearch) IsLoadBalancerEnabled() bool

IsLoadBalancerEnabled return true if LoadBalancer is enabled

func (*Elasticsearch) IsPdb

func (h *Elasticsearch) IsPdb(nodeGroup ElasticsearchNodeGroupSpec) bool

IsPdb return true if PDB is enabled

func (*Elasticsearch) IsSetVMMaxMapCount

func (h *Elasticsearch) IsSetVMMaxMapCount() bool

IsSetVMMaxMapCount return true if SetVMMaxMapCount is enabled

func (*Elasticsearch) NumberOfReplicas

func (h *Elasticsearch) NumberOfReplicas() int32

NumberOfReplicas permit to get the total of replicas

type ElasticsearchEndpointSpec

type ElasticsearchEndpointSpec struct {
	// Ingress permit to set ingress settings
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Ingress *ElasticsearchIngressSpec `json:"ingress,omitempty"`

	// Load balancer permit to set load balancer settings
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	LoadBalancer *ElasticsearchLoadBalancerSpec `json:"loadBalancer,omitempty"`
}

func (*ElasticsearchEndpointSpec) DeepCopy

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

func (*ElasticsearchEndpointSpec) DeepCopyInto

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

type ElasticsearchGlobalNodeGroupSpec

type ElasticsearchGlobalNodeGroupSpec struct {

	// AdditionalVolumes permit to use additionnal volumes
	// Default is empty
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	AdditionalVolumes []shared.DeploymentVolumeSpec `json:"additionalVolumes,omitempty"`

	// AntiAffinity permit to set anti affinity policy
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	AntiAffinity *shared.DeploymentAntiAffinitySpec `json:"antiAffinity,omitempty"`

	// PodDisruptionBudget is the pod disruption budget policy
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	PodDisruptionBudgetSpec *policyv1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

	// InitContainerResources permit to set resources on init containers
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	InitContainerResources *corev1.ResourceRequirements `json:"initContainerResources,omitempty"`

	// PodTemplate is merged with expected pod
	// It usefull to add some extra properties on pod spec
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +kubebuilder:validation:Optional
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	PodTemplate *corev1.PodTemplateSpec `json:"podTemplate,omitempty"`

	// Jvm permit to set extra option on JVM like memory or proxy to download plugins
	// Becarefull with memory, not forget to set the right ressource on pod
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Jvm string `json:"jvm,omitempty"`

	// Config is the Elasticsearch config dedicated for this node groups like roles
	// The key is the file stored on elasticsearch/config
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Config map[string]string `json:"config,omitempty"`

	// KeystoreSecretRef is the secret that store the security settings
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	KeystoreSecretRef *corev1.LocalObjectReference `json:"keystoreSecretRef,omitempty"`

	// CacertsSecretRef is the secret that store custom CA to import on cacerts
	// It usefull to access on onpremise S3 service to store snaoshot and more
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	CacertsSecretRef *corev1.LocalObjectReference `json:"caSecretRef,omitempty"`

	// Labels permit to set labels on containers
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations permit to set annotation on containers
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Env permit to set some environment variable on containers
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// EnvFrom permit to set some environment variable from config map or secret
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
}

func (*ElasticsearchGlobalNodeGroupSpec) DeepCopy

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

func (*ElasticsearchGlobalNodeGroupSpec) DeepCopyInto

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

type ElasticsearchIngressSpec

type ElasticsearchIngressSpec struct {
	shared.EndpointIngressSpec `json:",inline"`

	// TargetNodeGroupName permit to define if specific node group is responsible to receive external access, like ingest nodes
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	TargetNodeGroupName string `json:"targetNodeGroupName,omitempty"`
}

func (*ElasticsearchIngressSpec) DeepCopy

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

func (*ElasticsearchIngressSpec) DeepCopyInto

func (in *ElasticsearchIngressSpec) DeepCopyInto(out *ElasticsearchIngressSpec)

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

type ElasticsearchList

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

ElasticsearchList contains a list of Elasticsearch

func (*ElasticsearchList) DeepCopy

func (in *ElasticsearchList) DeepCopy() *ElasticsearchList

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

func (*ElasticsearchList) DeepCopyInto

func (in *ElasticsearchList) DeepCopyInto(out *ElasticsearchList)

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

func (*ElasticsearchList) DeepCopyObject

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

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

type ElasticsearchLoadBalancerSpec

type ElasticsearchLoadBalancerSpec struct {
	shared.EndpointLoadBalancerSpec `json:",inline"`

	// TargetNodeGroupName permit to define if specific node group is responsible to receive external access, like ingest nodes
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	TargetNodeGroupName string `json:"targetNodeGroupName,omitempty"`
}

func (*ElasticsearchLoadBalancerSpec) DeepCopy

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

func (*ElasticsearchLoadBalancerSpec) DeepCopyInto

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

type ElasticsearchNodeGroupSpec

type ElasticsearchNodeGroupSpec struct {
	shared.Deployment `json:",inline"`

	// Name is the the node group name
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	Name string `json:"name"`

	// Roles is the list of Elasticsearch roles
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	Roles []string `json:"roles"`

	// Persistence is the spec to persist data
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Persistence *shared.DeploymentPersistenceSpec `json:"persistence,omitempty"`

	// AntiAffinity permit to set anti affinity policy
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	AntiAffinity *shared.DeploymentAntiAffinitySpec `json:"antiAffinity,omitempty"`

	// Jvm permit to set extra option on JVM like Xmx, Xms
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Jvm string `json:"jvm,omitempty"`

	// Config is the Elasticsearch config dedicated for this node groups
	// The key is the file stored on elasticsearch/config
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Config map[string]string `json:"config,omitempty"`

	// PodDisruptionBudget is the pod disruption budget policy
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	PodDisruptionBudgetSpec *policyv1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

	// WaitClusterStatus permit to wait the cluster state on readyness probe
	// Default to green
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	// +kubebuilder:default=green
	// +kubebuilder:validation:Enum=green;yellow;red
	WaitClusterStatus string `json:"waitClusterStatus,omitempty"`
}

func (*ElasticsearchNodeGroupSpec) DeepCopy

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

func (*ElasticsearchNodeGroupSpec) DeepCopyInto

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

func (ElasticsearchNodeGroupSpec) IsPersistence

func (h ElasticsearchNodeGroupSpec) IsPersistence() bool

IsPersistence return true if persistence is enabled

type ElasticsearchSpec

type ElasticsearchSpec struct {
	shared.ImageSpec `json:",inline"`

	// Version is the Elasticsearch version to use
	// Default is use the latest
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	// +kubebuilder:default=latest
	Version string `json:"version,omitempty"`

	// ClusterName is the Elasticsearch cluster name
	// Default is use the custom ressource name
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	ClusterName string `json:"clusterName,omitempty"`

	// SetVMMaxMapCount permit to set the right value for VMMaxMapCount on node
	// It need to run pod as root with privileged option
	// Default is true
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	// +kubebuilder:default=true
	SetVMMaxMapCount *bool `json:"setVMMaxMapCount,omitempty"`

	// PluginsList is the list of additionnal plugin to install on each Elasticsearch node
	// Default is empty
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	PluginsList []string `json:"pluginsList,omitempty"`

	// GlobalNodeGroup permit to set some default parameters for each node groups
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	GlobalNodeGroup ElasticsearchGlobalNodeGroupSpec `json:"globalNodeGroup,omitempty"`

	// NodeGroups permit to groups node per use case
	// For exemple master, data and ingest
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	NodeGroups []ElasticsearchNodeGroupSpec `json:"nodeGroups,omitempty"`

	// Endpoint permit to set endpoints to access on Elasticsearch from external kubernetes
	// You can set ingress and / or load balancer
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Endpoint ElasticsearchEndpointSpec `json:"endpoint,omitempty"`

	// Tls permit to set the TLS setting for API access
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Tls shared.TlsSpec `json:"tls,omitempty"`

	// LicenseSecretRef permit to set secret that contain Elasticsearch license on key `license`
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	LicenseSecretRef *corev1.LocalObjectReference `json:"licenseSecretRef,omitempty"`

	// Monitoring permit to monitor current cluster
	// Default, it not monitor cluster
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Monitoring shared.MonitoringSpec `json:"monitoring,omitempty"`
}

ElasticsearchSpec defines the desired state of Elasticsearch +k8s:openapi-gen=true

func (*ElasticsearchSpec) DeepCopy

func (in *ElasticsearchSpec) DeepCopy() *ElasticsearchSpec

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

func (*ElasticsearchSpec) DeepCopyInto

func (in *ElasticsearchSpec) DeepCopyInto(out *ElasticsearchSpec)

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

type ElasticsearchStatus

type ElasticsearchStatus struct {
	apis.BasicMultiPhaseObjectStatus `json:",inline"`

	// IsBootstrapping is true when the cluster is bootstraping
	// +operator-sdk:csv:customresourcedefinitions:type=status
	IsBootstrapping *bool `json:"isBootstrapping,omitempty"`

	// Url is the Elasticsearch endpoint
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Url string `json:"url,omitempty"`

	// CredentialsRef is the secret that store the credentials to access on Elasticsearch
	// +operator-sdk:csv:customresourcedefinitions:type=status
	CredentialsRef corev1.LocalObjectReference `json:"credentialsRef,omitempty"`

	// Health is the cluster health
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Health string `json:"health,omitempty"`
}

ElasticsearchStatus defines the observed state of Elasticsearch

func (*ElasticsearchStatus) DeepCopy

func (in *ElasticsearchStatus) DeepCopy() *ElasticsearchStatus

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

func (*ElasticsearchStatus) DeepCopyInto

func (in *ElasticsearchStatus) DeepCopyInto(out *ElasticsearchStatus)

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

Jump to

Keyboard shortcuts

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