Documentation
¶
Overview ¶
This file contains functions common to the controllers to help them interact with elasticsearch.
Index ¶
- Constants
- Variables
- func ElasticsearchSecrets(ctx context.Context, userSecretNames []string, cli client.Client) ([]*corev1.Secret, error)
- func GetElasticLicenseType(ctx context.Context, cli client.Client, logger logr.Logger) (render.ElasticsearchLicenseType, error)
- func GetElasticsearch(ctx context.Context, c client.Client) (*esv1.Elasticsearch, error)
- func GetElasticsearchClusterConfig(ctx context.Context, cli client.Client) (*relasticsearch.ClusterConfig, error)
- func StrToElasticLicenseType(license string, logger logr.Logger) render.ElasticsearchLicenseType
- type Application
- type ElasticClient
- type ElasticsearchClientCreator
- type Policy
- type Role
- type RoleDefinition
- type RoleIndex
- type User
Constants ¶
const ( ElasticsearchRetentionFactor = 4 DefaultMaxIndexSizeGi = 30 ElasticConnRetries = 10 ElasticConnRetryInterval = "500ms" )
Variables ¶
var ( ElasticsearchUserNameLinseed = "tigera-ee-linseed" ElasticsearchUserNameDashboardInstaller = "tigera-ee-dashboards-installer" )
User's name in ES.
Functions ¶
func ElasticsearchSecrets ¶
func ElasticsearchSecrets(ctx context.Context, userSecretNames []string, cli client.Client) ([]*corev1.Secret, error)
ElasticsearchSecrets gets the secrets needed for a component to be able to access Elasticsearch.
func GetElasticLicenseType ¶
func GetElasticLicenseType(ctx context.Context, cli client.Client, logger logr.Logger) (render.ElasticsearchLicenseType, error)
GetElasticLicenseType returns the license type from elastic-licensing ConfigMap that ECK operator keeps updated.
func GetElasticsearch ¶
func GetElasticsearchClusterConfig ¶
func GetElasticsearchClusterConfig(ctx context.Context, cli client.Client) (*relasticsearch.ClusterConfig, error)
GetElasticsearchClusterConfig retrieves the config map containing the elasticsearch configuration values, such as the the cluster name and replica count.
func StrToElasticLicenseType ¶
func StrToElasticLicenseType(license string, logger logr.Logger) render.ElasticsearchLicenseType
StrToElasticLicenseType maps Elasticsearch license to one of the known and expected value.
Types ¶
type Application ¶
type ElasticClient ¶
type ElasticClient interface {
SetILMPolicies(context.Context, *operatorv1.LogStorage, bool) error
CreateUser(context.Context, *User) error
DeleteUser(context.Context, *User) error
GetUsers(ctx context.Context) ([]User, error)
}
func NewElasticClient ¶
type Role ¶
type Role struct {
Name string `json:"-"`
Definition *RoleDefinition
}
Role represents an Elasticsearch role that may be attached to a User
type RoleDefinition ¶
type RoleDefinition struct {
Cluster []string `json:"cluster"`
Indices []RoleIndex `json:"indices"`
Applications []Application `json:"applications,omitempty"`
}
type User ¶
User represents an Elasticsearch user, which may or may not have roles attached to it