multiclusterrolebinding

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogPolicyName        = "log-policy"
	LogIndexPrefix       = "logs-v0.5.4"
	LogIndexAlias        = "logs"
	LogIndexTemplateName = "logs_rollover_mapping"

	TracePolicyName       = "tracing-policy"
	SpanIndexPrefix       = "ss4o_traces-kubernetes-opni-v0.5.4"
	SpanIndexAlias        = "ss4o_traces-kubernetes-opni"
	SpanIndexTemplateName = "traces_rollover_mapping"
)

Variables

View Source
var (
	OldSpanIndexPrefixes []string
	OldLogIndexPrefixes  = []string{
		"logs-v0.1.3*",
		"logs-v0.5.1*",
	}
	DefaultRetry = opensearchtypes.RetrySpec{
		Count:   3,
		Backoff: "exponential",
		Delay:   "1m",
	}

	OpniSpanTemplate = opensearchtypes.IndexTemplateSpec{
		TemplateName: SpanIndexTemplateName,
		IndexPatterns: []string{
			fmt.Sprintf("%s*", SpanIndexPrefix),
		},
		Template: opensearchtypes.TemplateSpec{
			Settings: opensearchtypes.TemplateSettingsSpec{
				NumberOfShards:   1,
				NumberOfReplicas: 1,
				ISMPolicyID:      TracePolicyName,
				RolloverAlias:    SpanIndexAlias,
			},
			Mappings: opensearchtypes.TemplateMappingsSpec{
				DynamicTemplates: []map[string]opensearchtypes.DynamicTemplateSpec{
					{
						"resource_attributes_map": opensearchtypes.DynamicTemplateSpec{
							Mapping: opensearchtypes.PropertySettings{
								Type: "keyword",
							},
							PathMatch: "resource.attributes.*",
						},
					},
					{
						"span_attributes_map": opensearchtypes.DynamicTemplateSpec{
							Mapping: opensearchtypes.PropertySettings{
								Type: "keyword",
							},
							PathMatch: "span.attributes.*",
						},
					},
				},
				Properties: map[string]opensearchtypes.PropertySettings{
					"timestamp": {
						Type: "date",
					},
					"time": {
						Type: "date",
					},
					"cluster_id": {
						Type: "keyword",
					},
					"traceId": {
						IgnoreAbove: 256,
						Type:        "keyword",
					},
					"id": {
						IgnoreAbove: 256,
						Type:        "keyword",
					},
					"parentSpanId": {
						IgnoreAbove: 256,
						Type:        "keyword",
					},
					"name": {
						IgnoreAbove: 1024,
						Type:        "keyword",
					},
					"kind": {
						IgnoreAbove: 128,
						Type:        "keyword",
					},
					"startTime": {
						Type: "date",
					},
					"endTime": {
						Type: "date",
					},
					"status": {
						Properties: map[string]opensearchtypes.PropertySettings{
							"code": {
								Type: "keyword",
							},
							"message": {
								Type: "keyword",
							},
						},
					},
					"events": {
						Type: "nested",
						Properties: map[string]opensearchtypes.PropertySettings{
							"time": {
								Type: "date_nanos",
							},
						},
					},
					"links": {
						Type: "nested",
					},
				},
			},
		},
		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 (*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)

Jump to

Keyboard shortcuts

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