Documentation ¶
Index ¶
Constants ¶
View Source
const ( LogPolicyName = "log-policy" LogIndexPrefix = "logs-v0.1.3" LogIndexAlias = "logs" LogIndexTemplateName = "logs_rollover_mapping" )
View Source
const (
ISMChangeVersion = "1.1.0"
)
Variables ¶
View Source
var ( OpniLogPolicy = esapiext.ISMPolicySpec{ ISMPolicyIDSpec: &esapiext.ISMPolicyIDSpec{ PolicyID: LogPolicyName, MarshallID: false, }, Description: "Opni policy with hot-warm-cold workflow", DefaultState: "hot", States: []esapiext.StateSpec{ { Name: "hot", Actions: []esapiext.ActionSpec{ { ActionOperation: &esapiext.ActionOperation{ Rollover: &esapiext.RolloverOperation{ MinIndexAge: "1d", MinSize: "20gb", }, }, }, }, Transitions: []esapiext.TransitionSpec{ { StateName: "warm", }, }, }, { Name: "warm", Actions: []esapiext.ActionSpec{ { ActionOperation: &esapiext.ActionOperation{ ReplicaCount: &esapiext.ReplicaCountOperation{ NumberOfReplicas: 0, }, }, }, { ActionOperation: &esapiext.ActionOperation{ IndexPriority: &esapiext.IndexPriorityOperation{ Priority: 50, }, }, }, { ActionOperation: &esapiext.ActionOperation{ ForceMerge: &esapiext.ForceMergeOperation{ MaxNumSegments: 1, }, }, }, }, Transitions: []esapiext.TransitionSpec{ { StateName: "cold", Conditions: &esapiext.ConditionSpec{ MinIndexAge: "2d", }, }, }, }, { Name: "cold", Actions: []esapiext.ActionSpec{ { ActionOperation: &esapiext.ActionOperation{ ReadOnly: &esapiext.ReadOnlyOperation{}, }, }, }, Transitions: []esapiext.TransitionSpec{ { StateName: "delete", Conditions: &esapiext.ConditionSpec{ MinIndexAge: "7d", }, }, }, }, { Name: "delete", Actions: []esapiext.ActionSpec{ { ActionOperation: &esapiext.ActionOperation{ Delete: &esapiext.DeleteOperation{}, }, }, }, Transitions: make([]esapiext.TransitionSpec, 0), }, }, ISMTemplate: []esapiext.ISMTemplateSpec{ { IndexPatterns: []string{ fmt.Sprintf("%s*", LogIndexPrefix), }, Priority: 100, }, }, } OpniLogTemplate = esapiext.IndexTemplateSpec{ TemplateName: LogIndexTemplateName, IndexPatterns: []string{ fmt.Sprintf("%s*", LogIndexPrefix), }, Template: esapiext.TemplateSpec{ Settings: esapiext.TemplateSettingsSpec{ NumberOfShards: 1, NumberOfReplicas: 1, ISMPolicyID: LogPolicyName, RolloverAlias: LogIndexAlias, }, Mappings: esapiext.TemplateMappingsSpec{ Properties: map[string]esapiext.PropertySettings{ "timestamp": { Type: "date", }, }, }, }, } )
Functions ¶
This section is empty.
Types ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
func NewReconciler ¶
func NewReconciler(ctx context.Context, opniCluster *v1beta1.OpniCluster, c client.Client) *Reconciler
Click to show internal directories.
Click to hide internal directories.