elasticsearch

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: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigmapCondition shared.ConditionName = "ConfigmapReady"
	ConfigmapPhase     shared.PhaseName     = "Configmap"
)
View Source
const (
	ExporterCondition shared.ConditionName = "ExporterReady"
	ExporterPhase     shared.PhaseName     = "Exporter"
)
View Source
const (
	IngressCondition shared.ConditionName = "IngressReady"
	IngressPhase     shared.PhaseName     = "Ingress"
)
View Source
const (
	LicenseCondition shared.ConditionName = "LicenseReady"
	LicensePhase     shared.PhaseName     = "License"
)
View Source
const (
	LoadBalancerCondition shared.ConditionName = "LoadBalancerReady"
	LoadBalancerPhase     shared.PhaseName     = "LoadBalancer"
)
View Source
const (
	MetricbeatCondition shared.ConditionName = "MetricbeatReady"
	MetricbeatPhase     shared.PhaseName     = "Metricbeat"
)
View Source
const (
	NetworkPolicyCondition shared.ConditionName = "NetworkPolicyReady"
	NetworkPolicyPhase     shared.PhaseName     = "NetworkPolicy"
)
View Source
const (
	PdbCondition shared.ConditionName = "PodDisruptionBudgetReady"
	PdbPhase     shared.PhaseName     = "PodDisruptionBudget"
)
View Source
const (
	PodMonitorCondition shared.ConditionName = "PodMonitorReady"
	PodMonitorPhase     shared.PhaseName     = "PodMonitor"
)
View Source
const (
	CredentialCondition shared.ConditionName = "CredentialReady"
	CredentialPhase     shared.PhaseName     = "Credential"
)
View Source
const (
	TlsConditionGeneratePki          shared.ConditionName = "TlsGeneratePki"
	TlsConditionPropagatePki         shared.ConditionName = "TlsPropagatePki"
	TlsConditionGenerateCertificate  shared.ConditionName = "TlsGenerateCertificates"
	TlsConditionPropagateCertificate shared.ConditionName = "TlsPropagateCertificates"
	TlsCondition                     shared.ConditionName = "TlsReady"
	TlsConditionBlackout             shared.ConditionName = "TlsBlackout"
	TlsPhase                         shared.PhaseName     = "Tls"
	TlsPhaseCreate                   shared.PhaseName     = "tlsCreate"
	TlsPhaseUpdatePki                shared.PhaseName     = "tlsUpdatePki"
	TlsPhasePropagatePki             shared.PhaseName     = "tlsPropagatePki"
	TlsPhaseUpdateCertificates       shared.PhaseName     = "tlsUpdateCertificates"
	TlsPhasePropagateCertificates    shared.PhaseName     = "tlsPropagateCertificates"
	TlsPhaseCleanTransportCA         shared.PhaseName     = "tlsCleanCA"
	TlsPhaseNormal                   shared.PhaseName     = "tlsNormal"
	TlsPhaseReconcile                shared.PhaseName     = "tlsReconcile"
	DefaultRenewCertificate                               = -time.Hour * 24 * 30 // 30 days before expired
)
View Source
const (
	ServiceCondition shared.ConditionName = "ServiceReady"
	ServicePhase     shared.PhaseName     = "Service"
)
View Source
const (
	StatefulsetCondition            shared.ConditionName = "StatefulsetReady"
	StatefulsetConditionUpgrade     shared.ConditionName = "StatefulsetUpgrade"
	StatefulsetPhase                shared.PhaseName     = "Statefullset"
	StatefulsetPhaseUpgradeStarted  shared.PhaseName     = "statefulsetUpgradeStarted"
	StatefulsetPhaseUpgrade         shared.PhaseName     = "statefulsetUpgrade"
	StatefulsetPhaseUpgradeFinished shared.PhaseName     = "statefulsetUpgradeFinished"
	StatefulsetPhaseNormal          shared.PhaseName     = "statefulsetNormal"
)
View Source
const (
	SystemUserCondition shared.ConditionName = "SystemUserReady"
	SystemUserPhase     shared.PhaseName     = "systemUser"
)

Variables

This section is empty.

Functions

func GetBootstrappingConfigMapName

func GetBootstrappingConfigMapName(elasticsearch *elasticsearchcrd.Elasticsearch) (configMapName string)

GetBootstrappingConfigMapName permit to get the configMap name that store the bootstrapping properties of Elasticsearch cluster

func GetContainerImage

func GetContainerImage(elasticsearch *elasticsearchcrd.Elasticsearch) string

GetContainerImage permit to get the image name

func GetElasticsearchNameFromSecretApiTlsName

func GetElasticsearchNameFromSecretApiTlsName(secretApiTlsName string) (elasticsearchName string)

GetElasticsearchNameFromSecretApiTlsName return the Elasticsearch name from secret name that store TLS API

func GetExporterDeployementName

func GetExporterDeployementName(es *elasticsearchcrd.Elasticsearch) string

GetExporterDeployementName return the exporter deployement name

func GetExporterImage

func GetExporterImage(es *elasticsearchcrd.Elasticsearch) string

GetExporterImage return the image to use for exporter pod

func GetGlobalServiceName

func GetGlobalServiceName(elasticsearch *elasticsearchcrd.Elasticsearch) (serviceName string)

GetGlobalServiceName permit to get the global service name

func GetIngressName

func GetIngressName(elasticsearch *elasticsearchcrd.Elasticsearch) (ingressName string)

GetIngressName permit to get the ingress name

func GetLicenseName

func GetLicenseName(es *elasticsearchcrd.Elasticsearch) string

GetLicenseName return the name for the license

func GetLoadBalancerName

func GetLoadBalancerName(elasticsearch *elasticsearchcrd.Elasticsearch) (serviceName string)

GetLoadBalancerName permit to get the load balancer name

func GetMetricbeatName

func GetMetricbeatName(es *elasticsearchcrd.Elasticsearch) (name string)

GetMetricbeatName return the metricbeat namme

func GetNetworkPolicyName

func GetNetworkPolicyName(es *elasticsearchcrd.Elasticsearch) string

GetNetworkPolicyName return the name for network policy

func GetNodeGroupConfigMapName

func GetNodeGroupConfigMapName(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (configMapName string)

GetNodeGroupConfigMapName permit to get the configMap name that store the config of Elasticsearch

func GetNodeGroupName

func GetNodeGroupName(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (name string)

GetNodeGroupName permit to get the node group name

func GetNodeGroupNameFromNodeName

func GetNodeGroupNameFromNodeName(nodeName string) (nodeGroupName string)

func GetNodeGroupNodeNames

func GetNodeGroupNodeNames(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (nodeNames []string)

GetNodeGroupNodeNames permit to get node names that composed the node group

func GetNodeGroupPDBName

func GetNodeGroupPDBName(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (serviceName string)

GetNodeGroupPDBName permit to get the pdb name

func GetNodeGroupServiceName

func GetNodeGroupServiceName(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (serviceName string)

GetNodeGroupServiceName permit to get the service name for specified node group name

func GetNodeGroupServiceNameHeadless

func GetNodeGroupServiceNameHeadless(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (serviceName string)

GetNodeGroupServiceNameHeadless permit to get the service name headless for specified node group name

func GetNodeNames

func GetNodeNames(elasticsearch *elasticsearchcrd.Elasticsearch) (nodeNames []string)

GetNodeNames permit to get all nodes names It return the list with all node names (DNS / pod name)

func GetPodMonitorName

func GetPodMonitorName(es *elasticsearchcrd.Elasticsearch) string

GetPodMonitorName return the name for podMonitor

func GetPublicUrl

func GetPublicUrl(es *elasticsearchcrd.Elasticsearch, targetNodeGroup string, external bool) string

GetPublicUrl permit to get the public URL to connect on Elasticsearch

func GetSecretNameForCacerts

func GetSecretNameForCacerts(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)

GetSecretNameForCacerts permit to get the secret name that store the custom ca to ibject on Java cacerts It will inject each certificate file on cacerts It return empty string if not secret provided

func GetSecretNameForCredentials

func GetSecretNameForCredentials(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)

GetSecretNameForCredentials permit to get the secret name that store the credentials

func GetSecretNameForKeystore

func GetSecretNameForKeystore(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)

GetSecretNameForKeystore permit to get the secret name that store the secret It will inject each key on keystore It return empty string if not secret provided

func GetSecretNameForPkiApi

func GetSecretNameForPkiApi(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)

GetSecretNameForPkiApi permit to get the secret name that store PKI for API layer It return the secret name as string

func GetSecretNameForPkiTransport

func GetSecretNameForPkiTransport(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)

GetSecretNameForPkiTransport permit to get the secret name that store PKI for transport layer It return the secret name as string

func GetSecretNameForTlsApi

func GetSecretNameForTlsApi(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)

GetSecretNameForTlsApi permit to get the secret name that store all certificates for Api layout (Http endpoint) It return the secret name as string

func GetSecretNameForTlsTransport

func GetSecretNameForTlsTransport(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)

GetSecretNameForTlsTransport permit to get the secret name that store all certificates for transport layout It return the secret name as string

func GetUserSystemName

func GetUserSystemName(es *elasticsearchcrd.Elasticsearch, username string) string

GetUserSystemName return the name for system users

func IsMasterRole

func IsMasterRole(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) bool

isMasterRole return true if nodegroup have `cluster_manager` role

func NewElasticsearchReconciler

func NewElasticsearchReconciler(client client.Client, logger *logrus.Entry, recorder record.EventRecorder) (multiPhaseReconciler controller.Controller)

NewElasticsearchReconciler is the default constructor for Elasticsearch controller

Types

type ElasticsearchReconciler

type ElasticsearchReconciler struct {
	controller.Controller
	controller.MultiPhaseReconcilerAction
	controller.MultiPhaseReconciler
	controller.BaseReconciler
	// contains filtered or unexported fields
}

ElasticsearchReconciler reconciles a Elasticsearch object

func (*ElasticsearchReconciler) Configure

func (h *ElasticsearchReconciler) Configure(ctx context.Context, req ctrl.Request, resource object.MultiPhaseObject) (res ctrl.Result, err error)

func (*ElasticsearchReconciler) Delete

func (h *ElasticsearchReconciler) Delete(ctx context.Context, o object.MultiPhaseObject, data map[string]any) (err error)

func (*ElasticsearchReconciler) OnError

func (h *ElasticsearchReconciler) OnError(ctx context.Context, o object.MultiPhaseObject, data map[string]any, currentErr error) (res ctrl.Result, err error)

func (*ElasticsearchReconciler) OnSuccess

func (h *ElasticsearchReconciler) OnSuccess(ctx context.Context, r object.MultiPhaseObject, data map[string]any) (res ctrl.Result, err error)

func (*ElasticsearchReconciler) Reconcile

func (r *ElasticsearchReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the Elasticsearch object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*ElasticsearchReconciler) SetupWithManager

func (h *ElasticsearchReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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