Documentation ¶
Index ¶
Constants ¶
View Source
const ( LogPolicyName = "log-policy" LogIndexPrefix = "logs-v0.5.4" LogIndexAlias = "logs" LogIndexTemplateName = "logs_rollover_mapping" )
Variables ¶
View Source
var ( OldIndexPrefixes = []string{ "logs-v0.1.3*", "logs-v0.5.1*", } DefaultRetry = opensearchtypes.RetrySpec{ Count: 3, Backoff: "exponential", Delay: "1m", } OpniLogPolicy = opensearchtypes.ISMPolicySpec{ ISMPolicyIDSpec: &opensearchtypes.ISMPolicyIDSpec{ PolicyID: LogPolicyName, MarshallID: false, }, Description: "Opni policy with hot-warm-cold workflow", DefaultState: "hot", States: []opensearchtypes.StateSpec{ { Name: "hot", Actions: []opensearchtypes.ActionSpec{ { ActionOperation: &opensearchtypes.ActionOperation{ Rollover: &opensearchtypes.RolloverOperation{ MinIndexAge: "1d", MinSize: "20gb", }, }, }, }, Transitions: []opensearchtypes.TransitionSpec{ { StateName: "warm", }, }, }, { Name: "warm", Actions: []opensearchtypes.ActionSpec{ { ActionOperation: &opensearchtypes.ActionOperation{ ReplicaCount: &opensearchtypes.ReplicaCountOperation{ NumberOfReplicas: 0, }, }, }, { ActionOperation: &opensearchtypes.ActionOperation{ IndexPriority: &opensearchtypes.IndexPriorityOperation{ Priority: 50, }, }, }, { ActionOperation: &opensearchtypes.ActionOperation{ ForceMerge: &opensearchtypes.ForceMergeOperation{ MaxNumSegments: 1, }, }, }, }, Transitions: []opensearchtypes.TransitionSpec{ { StateName: "cold", Conditions: &opensearchtypes.ConditionSpec{ MinIndexAge: "2d", }, }, }, }, { Name: "cold", Actions: []opensearchtypes.ActionSpec{ { ActionOperation: &opensearchtypes.ActionOperation{ ReadOnly: &opensearchtypes.ReadOnlyOperation{}, }, }, }, Transitions: []opensearchtypes.TransitionSpec{ { StateName: "delete", Conditions: &opensearchtypes.ConditionSpec{ MinIndexAge: "7d", }, }, }, }, { Name: "delete", Actions: []opensearchtypes.ActionSpec{ { ActionOperation: &opensearchtypes.ActionOperation{ Delete: &opensearchtypes.DeleteOperation{}, }, }, }, Transitions: make([]opensearchtypes.TransitionSpec, 0), }, }, ISMTemplate: []opensearchtypes.ISMTemplateSpec{ { IndexPatterns: []string{ fmt.Sprintf("%s*", LogIndexPrefix), }, Priority: 100, }, }, } OpniLogTemplate = opensearchtypes.IndexTemplateSpec{ TemplateName: LogIndexTemplateName, IndexPatterns: []string{ fmt.Sprintf("%s*", LogIndexPrefix), }, Template: opensearchtypes.TemplateSpec{ Settings: opensearchtypes.TemplateSettingsSpec{ NumberOfShards: 1, NumberOfReplicas: 1, ISMPolicyID: LogPolicyName, RolloverAlias: LogIndexAlias, DefaultPipeline: preProcessingPipelineName, }, Mappings: opensearchtypes.TemplateMappingsSpec{ Properties: map[string]opensearchtypes.PropertySettings{ "timestamp": { Type: "date", }, "time": { Type: "date", }, "log": { Type: "text", }, "masked_log": { Type: "text", }, "log_type": { Type: "keyword", }, "kubernetes_component": { Type: "keyword", }, "cluster_id": { Type: "keyword", }, "anomaly_level": { Type: "keyword", }, }, }, }, Priority: 100, } )
Functions ¶
This section is empty.
Types ¶
type Reconciler ¶
type Reconciler struct { reconciler.ResourceReconciler // contains filtered or unexported fields }
func NewReconciler ¶
func NewReconciler( ctx context.Context, instance *loggingv1beta1.MulticlusterRoleBinding, c client.Client, opts ...reconciler.ResourceReconcilerOption, ) *Reconciler
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile() (retResult *reconcile.Result, retErr error)
func (*Reconciler) ReconcileOpensearchObjects ¶
func (r *Reconciler) ReconcileOpensearchObjects(opensearchCluster *opensearchv1.OpenSearchCluster) (retResult *reconcile.Result, retErr error)
Click to show internal directories.
Click to hide internal directories.