controllers

package
v0.0.0-...-21b7018 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCondition

func NewCondition(conditionStatus string, conditionType string, conditionReason string, conditionMessage string) opensearchservice.StatusCondition

Types

type AutofollowStats

type AutofollowStats struct {
	SuccessStart        int         `json:"num_success_start_replication"`
	FailedStart         int         `json:"num_failed_start_replication"`
	AutofollowRuleStats []RuleStats `json:"autofollow_stats"`
}

type CuratorReconciler

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

func (CuratorReconciler) Configure

func (r CuratorReconciler) Configure() error

func (CuratorReconciler) Reconcile

func (r CuratorReconciler) Reconcile() error

func (CuratorReconciler) Status

func (r CuratorReconciler) Status() error

type DashboardsReconciler

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

func (DashboardsReconciler) Configure

func (r DashboardsReconciler) Configure() error

func (DashboardsReconciler) Reconcile

func (r DashboardsReconciler) Reconcile() error

func (DashboardsReconciler) Status

func (r DashboardsReconciler) Status() error

type DbaasAdapterReconciler

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

func (DbaasAdapterReconciler) Configure

func (r DbaasAdapterReconciler) Configure() error

func (DbaasAdapterReconciler) Reconcile

func (r DbaasAdapterReconciler) Reconcile() error

func (DbaasAdapterReconciler) Status

func (r DbaasAdapterReconciler) Status() error

type DisasterRecoveryReconciler

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

func (DisasterRecoveryReconciler) Configure

func (r DisasterRecoveryReconciler) Configure() error

func (DisasterRecoveryReconciler) Reconcile

func (r DisasterRecoveryReconciler) Reconcile() error

func (DisasterRecoveryReconciler) Status

func (r DisasterRecoveryReconciler) Status() error

type ElasticsearchDbaasAdapterReconciler

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

func (ElasticsearchDbaasAdapterReconciler) Configure

func (ElasticsearchDbaasAdapterReconciler) Reconcile

func (ElasticsearchDbaasAdapterReconciler) Status

type ExternalOpenSearchReconciler

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

func (ExternalOpenSearchReconciler) Configure

func (r ExternalOpenSearchReconciler) Configure() error

func (ExternalOpenSearchReconciler) Reconcile

func (r ExternalOpenSearchReconciler) Reconcile() error

func (ExternalOpenSearchReconciler) Status

type FlushResult

type FlushResult struct {
	Shards struct {
		Total      int `json:"total"`
		Successful int `json:"successful"`
		Failed     int `json:"failed"`
	} `json:"_shards"`
}

type IndexDetails

type IndexDetails struct {
	LeaderCheckpoint   int `json:"leader_checkpoint"`
	FollowerCheckpoint int `json:"follower_checkpoint"`
	Seq                int `json:"seq_no"`
}

type InnerTask

type InnerTask struct {
	Action string `json:"action"`
}

type LeaderStats

type LeaderStats struct {
	NumReplicatedIndices        int                    `json:"num_replicated_indices"`
	OperationsRead              int                    `json:"operations_read"`
	TranslogSizeBytes           int                    `json:"translog_size_bytes"`
	OperationsReadLucene        int                    `json:"operations_read_lucene"`
	OperationsReadTranslog      int                    `json:"operations_read_translog"`
	TotalReadTimeLuceneMillis   int                    `json:"total_read_time_lucene_millis"`
	TotalReadTimeTranslogMillis int                    `json:"total_read_time_translog_millis"`
	BytesRead                   int                    `json:"bytes_read"`
	IndexStats                  map[string]interface{} `json:"index_stats"`
}

type MappingAllAccess

type MappingAllAccess struct {
	AllAccess OpenSearchRoleMapping `json:"all_access"`
}

type MonitoringReconciler

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

func (MonitoringReconciler) Configure

func (r MonitoringReconciler) Configure() error

func (MonitoringReconciler) Reconcile

func (r MonitoringReconciler) Reconcile() error

func (MonitoringReconciler) Status

func (r MonitoringReconciler) Status() error

type NodesInfo

type NodesInfo struct {
	Nodes map[string]TasksInfo `json:"nodes"`
}

type NotReadyError

type NotReadyError struct {
	StatusCode int
	Err        error
}

func (NotReadyError) Error

func (nre NotReadyError) Error() string

type OpenSearchAuditConfig

type OpenSearchAuditConfig struct {
	Config struct {
		Enabled    bool                   `json:"enabled"`
		Audit      map[string]interface{} `json:"audit"`
		Compliance map[string]interface{} `json:"compliance"`
	} `json:"config"`
}

type OpenSearchHealth

type OpenSearchHealth struct {
	Status string `json:"status"`
}

type OpenSearchReconciler

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

func (OpenSearchReconciler) Configure

func (r OpenSearchReconciler) Configure() error

func (OpenSearchReconciler) Reconcile

func (r OpenSearchReconciler) Reconcile() error

func (OpenSearchReconciler) Status

func (r OpenSearchReconciler) Status() error

func (OpenSearchReconciler) UpdateRoles

func (r OpenSearchReconciler) UpdateRoles(restClient *util.RestClient, userName string, role string) error

type OpenSearchRoleMapping

type OpenSearchRoleMapping struct {
	RoleName        string   `json:"role_name,omitempty"`
	Description     string   `json:"description"`
	BackendRoles    []string `json:"backend_roles"`
	AndBackendRoles []string `json:"and_backend_roles"`
	Hosts           []string `json:"hosts"`
	Users           []string `json:"users"`
	Reserved        bool     `json:"reserved,omitempty"`
	Hidden          bool     `json:"hidden,omitempty"`
}

type OpenSearchServiceReconciler

type OpenSearchServiceReconciler struct {
	client.Client
	Scheme                *runtime.Scheme
	ResourceHashes        map[string]string
	ReplicationWatcher    ReplicationWatcher
	SlowLogIndicesWatcher SlowLogIndicesWatcher
	StatusUpdater         util.StatusUpdater
}

OpenSearchServiceReconciler reconciles a OpenSearchService object

func (*OpenSearchServiceReconciler) Reconcile

func (r *OpenSearchServiceReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

func (*OpenSearchServiceReconciler) SetupWithManager

func (r *OpenSearchServiceReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type OpenSearchSettings

type OpenSearchSettings struct {
	Persistent struct {
		Cluster struct {
			Routing struct {
				Allocation struct {
					Enable *string `json:"enable"`
				} `json:"allocation"`
			} `json:"routing"`
		} `json:"cluster"`
	} `json:"persistent"`
}

type PluginReplicationError

type PluginReplicationError struct {
	Err struct {
		Reason   string `json:"reason,omitempty"`
		Type     string `json:"type,omitempty"`
		CausedBy struct {
			Type   string `json:"type,omitempty"`
			Reason string `json:"reason,omitempty"`
		} `json:"caused_by,omitempty"`
	} `json:"error"`
	Status int `json:"status"`
}

type ReconcileService

type ReconcileService interface {
	Reconcile() error
	Status() error
	Configure() error
}

type ReplicationIndexStats

type ReplicationIndexStats struct {
	Status  string       `json:"status"`
	Reason  string       `json:"reason,omitempty"`
	Details IndexDetails `json:"syncing_details,omitempty"`
}

type ReplicationManager

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

func NewReplicationManager

func NewReplicationManager(restClient util.RestClient, remoteUrl string, indexPattern string, logger logr.Logger) *ReplicationManager

func (ReplicationManager) Configure

func (rm ReplicationManager) Configure() error

func (ReplicationManager) DeleteAdminReplicationTasks

func (rm ReplicationManager) DeleteAdminReplicationTasks() error

func (ReplicationManager) DeleteIndices

func (rm ReplicationManager) DeleteIndices() error

func (ReplicationManager) DeleteIndicesByPattern

func (rm ReplicationManager) DeleteIndicesByPattern(pattern string) error

func (ReplicationManager) DeleteIndicesByPatternWithUnlock

func (rm ReplicationManager) DeleteIndicesByPatternWithUnlock(pattern string) error

func (ReplicationManager) GetAutoFollowRuleStats

func (rm ReplicationManager) GetAutoFollowRuleStats() (*RuleStats, error)

func (ReplicationManager) GetIndicesByPatternExcludeService

func (rm ReplicationManager) GetIndicesByPatternExcludeService(pattern string) ([]string, error)

func (ReplicationManager) RemoveReplicationRule

func (rm ReplicationManager) RemoveReplicationRule() error

func (ReplicationManager) Start

func (rm ReplicationManager) Start() error

func (ReplicationManager) StopIndicesReplicationByPattern

func (rm ReplicationManager) StopIndicesReplicationByPattern(pattern string) error

func (ReplicationManager) StopReplication

func (rm ReplicationManager) StopReplication() error

type ReplicationStats

type ReplicationStats struct {
	SyncingIndicesCount       int                 `json:"num_syncing_indices"`
	BootstrappingIndicesCount int                 `json:"num_bootstrapping_indices"`
	PausedIndicesCount        int                 `json:"num_paused_indices"`
	FailedIndicesCount        int                 `json:"num_failed_indices"`
	IndexStats                map[string]struct{} `json:"index_stats"`
}

ReplicationStats is a struct to unmarshal http response The following json is expected as response:

{
	"num_syncing_indices": 3,
	"num_bootstrapping_indices": 0,
	"num_paused_indices": 0,
	"num_failed_indices": 0,
	"num_shard_tasks": 3,
	"num_index_tasks": 3,
	"operations_written": 6,
	"operations_read": 6,
	"failed_read_requests": 0,
	"throttled_read_requests": 0,
	"failed_write_requests": 0,
	"throttled_write_requests": 0,
	"follower_checkpoint": 3,
	"leader_checkpoint": 5,
	"total_write_time_millis": 194,
	"index_stats": {
		"my-demo45": {
			"operations_written": 0,
			"operations_read": 0,
			"failed_read_requests": 0,
			"throttled_read_requests": 0,
			"failed_write_requests": 0,
			"throttled_write_requests": 0,
			"follower_checkpoint": -1,
			"leader_checkpoint": 0,
			"total_write_time_millis": 0
		},
		"my-demo": {
			"operations_written": 0,
			"operations_read": 0,
			"failed_read_requests": 0,
			"throttled_read_requests": 0,
			"failed_write_requests": 0,
			"throttled_write_requests": 0,
			"follower_checkpoint": -1,
			"leader_checkpoint": 0,
			"total_write_time_millis": 0
		},
		"my-index1": {
			"operations_written": 6,
			"operations_read": 6,
			"failed_read_requests": 0,
			"throttled_read_requests": 0,
			"failed_write_requests": 0,
			"throttled_write_requests": 0,
			"follower_checkpoint": 5,
			"leader_checkpoint": 5,
			"total_write_time_millis": 194
		}
	}
}

type ReplicationWatcher

type ReplicationWatcher struct {
	Lock *sync.Mutex
	// contains filtered or unexported fields
}

func NewReplicationWatcher

func NewReplicationWatcher(lock *sync.Mutex) ReplicationWatcher

type RuleStats

type RuleStats struct {
	Name          string   `json:"name"`
	Pattern       string   `json:"pattern"`
	SuccessStart  int      `json:"num_success_start_replication"`
	FailedStart   int      `json:"num_failed_start_replication"`
	FailedIndices []string `json:"failed_indices"`
}

type SlowLogIndicesHelper

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

type SlowLogIndicesWatcher

type SlowLogIndicesWatcher struct {
	State *string
	// contains filtered or unexported fields
}

func NewSlowLogIndicesWatcher

func NewSlowLogIndicesWatcher(mutex *sync.Mutex) SlowLogIndicesWatcher

type TasksInfo

type TasksInfo struct {
	Tasks map[string]InnerTask `json:"tasks"`
}

Jump to

Keyboard shortcuts

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