Documentation ¶
Index ¶
- Constants
- func GetBootstrappingConfigMapName(elasticsearch *elasticsearchcrd.Elasticsearch) (configMapName string)
- func GetContainerImage(elasticsearch *elasticsearchcrd.Elasticsearch) string
- func GetElasticsearchNameFromSecretApiTlsName(secretApiTlsName string) (elasticsearchName string)
- func GetExporterDeployementName(es *elasticsearchcrd.Elasticsearch) string
- func GetExporterImage(es *elasticsearchcrd.Elasticsearch) string
- func GetGlobalServiceName(elasticsearch *elasticsearchcrd.Elasticsearch) (serviceName string)
- func GetIngressName(elasticsearch *elasticsearchcrd.Elasticsearch) (ingressName string)
- func GetLicenseName(es *elasticsearchcrd.Elasticsearch) string
- func GetLoadBalancerName(elasticsearch *elasticsearchcrd.Elasticsearch) (serviceName string)
- func GetMetricbeatName(es *elasticsearchcrd.Elasticsearch) (name string)
- func GetNetworkPolicyName(es *elasticsearchcrd.Elasticsearch) string
- func GetNodeGroupConfigMapName(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (configMapName string)
- func GetNodeGroupName(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (name string)
- func GetNodeGroupNameFromNodeName(nodeName string) (nodeGroupName string)
- func GetNodeGroupNodeNames(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (nodeNames []string)
- func GetNodeGroupPDBName(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (serviceName string)
- func GetNodeGroupServiceName(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (serviceName string)
- func GetNodeGroupServiceNameHeadless(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) (serviceName string)
- func GetNodeNames(elasticsearch *elasticsearchcrd.Elasticsearch) (nodeNames []string)
- func GetPodMonitorName(es *elasticsearchcrd.Elasticsearch) string
- func GetPublicUrl(es *elasticsearchcrd.Elasticsearch, targetNodeGroup string, external bool) string
- func GetSecretNameForCacerts(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)
- func GetSecretNameForCredentials(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)
- func GetSecretNameForKeystore(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)
- func GetSecretNameForPkiApi(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)
- func GetSecretNameForPkiTransport(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)
- func GetSecretNameForTlsApi(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)
- func GetSecretNameForTlsTransport(elasticsearch *elasticsearchcrd.Elasticsearch) (secretName string)
- func GetUserSystemName(es *elasticsearchcrd.Elasticsearch, username string) string
- func IsMasterRole(elasticsearch *elasticsearchcrd.Elasticsearch, nodeGroupName string) bool
- func NewElasticsearchReconciler(client client.Client, logger *logrus.Entry, recorder record.EventRecorder) (multiPhaseReconciler controller.Controller)
- type ElasticsearchReconciler
- func (h *ElasticsearchReconciler) Configure(ctx context.Context, req ctrl.Request, resource object.MultiPhaseObject) (res ctrl.Result, err error)
- func (h *ElasticsearchReconciler) Delete(ctx context.Context, o object.MultiPhaseObject, data map[string]any) (err error)
- func (h *ElasticsearchReconciler) OnError(ctx context.Context, o object.MultiPhaseObject, data map[string]any, ...) (res ctrl.Result, err error)
- func (h *ElasticsearchReconciler) OnSuccess(ctx context.Context, r object.MultiPhaseObject, data map[string]any) (res ctrl.Result, err error)
- func (r *ElasticsearchReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (h *ElasticsearchReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
const ( ConfigmapCondition shared.ConditionName = "ConfigmapReady" ConfigmapPhase shared.PhaseName = "Configmap" )
const ( ExporterCondition shared.ConditionName = "ExporterReady" ExporterPhase shared.PhaseName = "Exporter" )
const ( IngressCondition shared.ConditionName = "IngressReady" IngressPhase shared.PhaseName = "Ingress" )
const ( LicenseCondition shared.ConditionName = "LicenseReady" LicensePhase shared.PhaseName = "License" )
const ( LoadBalancerCondition shared.ConditionName = "LoadBalancerReady" LoadBalancerPhase shared.PhaseName = "LoadBalancer" )
const ( MetricbeatCondition shared.ConditionName = "MetricbeatReady" MetricbeatPhase shared.PhaseName = "Metricbeat" )
const ( NetworkPolicyCondition shared.ConditionName = "NetworkPolicyReady" NetworkPolicyPhase shared.PhaseName = "NetworkPolicy" )
const ( PdbCondition shared.ConditionName = "PodDisruptionBudgetReady" PdbPhase shared.PhaseName = "PodDisruptionBudget" )
const ( PodMonitorCondition shared.ConditionName = "PodMonitorReady" PodMonitorPhase shared.PhaseName = "PodMonitor" )
const ( CredentialCondition shared.ConditionName = "CredentialReady" CredentialPhase shared.PhaseName = "Credential" )
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 )
const ( ServiceCondition shared.ConditionName = "ServiceReady" ServicePhase shared.PhaseName = "Service" )
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" )
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 ¶
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 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) 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.
Source Files ¶
- configmap_builder.go
- configmap_reconciler.go
- deployment_exporter_builder.go
- deployment_exporter_reconciler.go
- elasticsearch_controller.go
- elasticsearch_watcher.go
- helper.go
- ingress_builder.go
- ingress_reconciler.go
- license_builder.go
- license_reconciler.go
- loadbalancer_builder.go
- loadbalancer_reconciler.go
- metricbeat_builder.go
- metricbeat_reconciler.go
- networkpolicy_builder.go
- networkpolicy_reconciler.go
- pdb_builder.go
- pdb_reconciler.go
- podmonitor_builder.go
- podmonitor_reconciler.go
- secret_credential_builder.go
- secret_credential_reconciler.go
- secret_tls_builder.go
- secret_tls_reconciler.go
- service_builder.go
- service_reconciler.go
- statefulset_builder.go
- statefulset_reconciler.go
- system_user_builder.go
- system_user_reconciler.go