elasticsearch

package
v0.0.0-...-a5c132e Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 64 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFoundIndex = -1
)

Variables

View Source
var (
	DiskWatermarkLowPct   *float64
	DiskWatermarkHighPct  *float64
	DiskWatermarkFloodPct *float64
	DiskWatermarkLowAbs   *resource.Quantity
	DiskWatermarkHighAbs  *resource.Quantity
	DiskWatermarkFloodAbs *resource.Quantity
)
View Source
var ErrFlushShardsFailed = kverrors.New("flush shards failed")

ErrFlushShardsFailed indicates a failure when trying to flush shards

Functions

func CalculatePrimaryCount

func CalculatePrimaryCount(dpl *api.Elasticsearch) int

func CalculateReplicaCount

func CalculateReplicaCount(dpl *api.Elasticsearch) int

func CreateOrUpdateSecretWithOwnerRef

func CreateOrUpdateSecretWithOwnerRef(secretName, namespace string, data map[string][]byte, client client.Client, ownerRef metav1.OwnerReference) error

func EnforceNetworkPolicy

func EnforceNetworkPolicy(namespace string, client client.Client, ownerRef []metav1.OwnerReference) error

func FlushNodes

func FlushNodes(clusterName, namespace string)

func GetDataCount

func GetDataCount(dpl *api.Elasticsearch) int32

func GetElasticsearchCR

func GetElasticsearchCR(c client.Client, ns string) (*loggingv1.Elasticsearch, error)

func Reconcile

func Reconcile(log logr.Logger, requestCluster *elasticsearchv1.Elasticsearch, requestClient client.Client) error

func RelaxNetworkPolicy

func RelaxNetworkPolicy(namespace string, client client.Client) error

func RemoveDashboardConfigMap

func RemoveDashboardConfigMap(log logr.Logger, c client.Client)

RemoveDashboardConfigMap removes the config map in the grafana dashboard

func SecretReconcile

func SecretReconcile(log logr.Logger, requestCluster *elasticsearchv1.Elasticsearch, requestClient client.Client) (bool, error)

SecretReconcile returns false if the event needs to be requeued

Types

type CertificateRequest

type CertificateRequest struct {
	Log         logr.Logger
	ClusterName string
	Namespace   string
	OwnerRef    metav1.OwnerReference
	K8sClient   client.Client

	Extensions map[string]x509v3Ext
}

func NewCertificateRequest

func NewCertificateRequest(log logr.Logger, clusterName, namespace string, ownerRef metav1.OwnerReference, client client.Client) *CertificateRequest

func (*CertificateRequest) EnsureCert

func (cr *CertificateRequest) EnsureCert(componentName string, cert *certificate, ca *certCA) error

func (*CertificateRequest) GenerateComponentCerts

func (cr *CertificateRequest) GenerateComponentCerts(secretName, cn string)

func (*CertificateRequest) GenerateElasticsearchCerts

func (cr *CertificateRequest) GenerateElasticsearchCerts(clusterName string)

func (*CertificateRequest) GenerateKibanaCerts

func (cr *CertificateRequest) GenerateKibanaCerts(componentName string)

type ClusterRestart

type ClusterRestart struct {
	// contains filtered or unexported fields
}

type ElasticsearchRequest

type ElasticsearchRequest struct {
	// contains filtered or unexported fields
}

func (*ElasticsearchRequest) AnyNodeReady

func (er *ElasticsearchRequest) AnyNodeReady() bool

this function should be called before we try doing operations to make sure any of our nodes are first ready

func (*ElasticsearchRequest) ClusterReady

func (er *ElasticsearchRequest) ClusterReady() bool

this function should be called before we try doing operations to make sure all our nodes are first ready

func (*ElasticsearchRequest) CreateOrUpdateConfigMaps

func (er *ElasticsearchRequest) CreateOrUpdateConfigMaps() error

CreateOrUpdateConfigMaps ensures the existence of ConfigMaps with Elasticsearch configuration

func (*ElasticsearchRequest) CreateOrUpdateDashboards

func (er *ElasticsearchRequest) CreateOrUpdateDashboards() error

CreateOrUpdateDashboards creates/updates the cluster logging dashboard ConfigMap

func (*ElasticsearchRequest) CreateOrUpdateElasticsearchCluster

func (er *ElasticsearchRequest) CreateOrUpdateElasticsearchCluster() error

CreateOrUpdateElasticsearchCluster creates an Elasticsearch deployment

func (*ElasticsearchRequest) CreateOrUpdatePrometheusRules

func (er *ElasticsearchRequest) CreateOrUpdatePrometheusRules() error

func (*ElasticsearchRequest) CreateOrUpdateRBAC

func (er *ElasticsearchRequest) CreateOrUpdateRBAC() error

func (*ElasticsearchRequest) CreateOrUpdateSecurityContextConstraints

func (er *ElasticsearchRequest) CreateOrUpdateSecurityContextConstraints() error

CreateOrUpdateSecurityContextConstraints ensures the existence of the securitycontextconstraints for Elasticsearch cluster

func (*ElasticsearchRequest) CreateOrUpdateServiceAccountTokenSecret

func (er *ElasticsearchRequest) CreateOrUpdateServiceAccountTokenSecret() error

CreateOrUpdateServiceAccountTokenSecret ensures the existence of the following secrets of type `kubernetes.io/service-account-token` for the serviceaccount `elasticsearch-metrics`.

func (*ElasticsearchRequest) CreateOrUpdateServiceAccounts

func (er *ElasticsearchRequest) CreateOrUpdateServiceAccounts() error

CreateOrUpdateServiceAccounts ensures the existence of the following serviceaccounts for Elasticsearch cluster: - elasticsearch: For mounting and using the custom SecurityContextConstraint to the elasticsearch pods - elasticsearch-metrics: For allowing Prometheus ServiceMonitor (ClusterMonitoring and User-Workload-Monitoring) to scrape logs

func (*ElasticsearchRequest) CreateOrUpdateServiceMonitors

func (er *ElasticsearchRequest) CreateOrUpdateServiceMonitors() error

CreateOrUpdateServiceMonitors ensures the existence of ServiceMonitors for Elasticsearch cluster

func (*ElasticsearchRequest) CreateOrUpdateServices

func (er *ElasticsearchRequest) CreateOrUpdateServices() error

CreateOrUpdateServices ensures the existence of the services for Elasticsearch cluster

func (*ElasticsearchRequest) GetCurrentPodStateMap

func (er *ElasticsearchRequest) GetCurrentPodStateMap() map[api.ElasticsearchNodeRole]api.PodStateMap

func (*ElasticsearchRequest) GetNodeTypeInterface

func (er *ElasticsearchRequest) GetNodeTypeInterface(uuid string, node api.ElasticsearchNode) []NodeTypeInterface

this can potentially return a list if we have replicas > 1 for a data node

func (*ElasticsearchRequest) L

L is the logger used for this request. TODO This needs to be removed in favor of using context.Context() with values.

func (*ElasticsearchRequest) PerformFullClusterCertRestart

func (er *ElasticsearchRequest) PerformFullClusterCertRestart(nodes []NodeTypeInterface) error

func (*ElasticsearchRequest) PerformFullClusterRestart

func (er *ElasticsearchRequest) PerformFullClusterRestart(nodes []NodeTypeInterface) error

func (*ElasticsearchRequest) PerformFullClusterUpdate

func (er *ElasticsearchRequest) PerformFullClusterUpdate(nodes []NodeTypeInterface) error

func (*ElasticsearchRequest) PerformNodeRestart

func (er *ElasticsearchRequest) PerformNodeRestart(node NodeTypeInterface) error

func (*ElasticsearchRequest) PerformNodeUpdate

func (er *ElasticsearchRequest) PerformNodeUpdate(node NodeTypeInterface) error

func (*ElasticsearchRequest) PerformRollingRestart

func (er *ElasticsearchRequest) PerformRollingRestart(nodes []NodeTypeInterface) error

func (*ElasticsearchRequest) PerformRollingUpdate

func (er *ElasticsearchRequest) PerformRollingUpdate(nodes []NodeTypeInterface) error

func (*ElasticsearchRequest) UpdateClusterStatus

func (er *ElasticsearchRequest) UpdateClusterStatus() error

func (*ElasticsearchRequest) UpdateDegradedCondition

func (er *ElasticsearchRequest) UpdateDegradedCondition(value bool, reason, message string) error

type LogConfig

type LogConfig struct {
	// LogLevel of the proxy and server security
	LogLevel string
	// ServerLoglevel of the remainder of Elasticsearch
	ServerLoglevel string
	// ServerAppender where to log messages
	ServerAppender string
}

type NodeTypeFactory

type NodeTypeFactory func(name, namespace string) NodeTypeInterface

NodeTypeFactory is a factory to construct either statefulset or deployment

type NodeTypeInterface

type NodeTypeInterface interface {
	// contains filtered or unexported methods
}

NodeTypeInterface interace represents individual Elasticsearch node

type Restarter

type Restarter struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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