From 57de81d8c27e221832790443cebaf141353c3e3f Mon Sep 17 00:00:00 2001 From: Joao Marcal Date: Thu, 24 Oct 2024 15:06:19 +0200 Subject: [PATCH] feat(operator): introduce 1x.pico size (#14407) --- operator/api/loki/v1/lokistack_types.go | 16 +- .../loki-operator.clusterserviceversion.yaml | 2 +- .../loki.grafana.com_lokistacks.yaml | 1 + .../loki-operator.clusterserviceversion.yaml | 2 +- .../loki.grafana.com_lokistacks.yaml | 1 + .../loki-operator.clusterserviceversion.yaml | 2 +- .../loki.grafana.com_lokistacks.yaml | 1 + .../bases/loki.grafana.com_lokistacks.yaml | 1 + operator/docs/operator/api.md | 13 +- operator/internal/manifests/internal/sizes.go | 137 ++++++++++++++++-- 10 files changed, 157 insertions(+), 19 deletions(-) diff --git a/operator/api/loki/v1/lokistack_types.go b/operator/api/loki/v1/lokistack_types.go index a9ef632d7044..84c097131057 100644 --- a/operator/api/loki/v1/lokistack_types.go +++ b/operator/api/loki/v1/lokistack_types.go @@ -27,7 +27,7 @@ const ( // LokiStackSizeType declares the type for loki cluster scale outs. // -// +kubebuilder:validation:Enum="1x.demo";"1x.extra-small";"1x.small";"1x.medium" +// +kubebuilder:validation:Enum="1x.demo";"1x.pico";"1x.extra-small";"1x.small";"1x.medium" type LokiStackSizeType string const ( @@ -39,10 +39,18 @@ const ( // DO NOT USE THIS IN PRODUCTION! SizeOneXDemo LokiStackSizeType = "1x.demo" + // SizeOneXPico defines the size of a single Loki deployment + // with extra small resources/limits requirements and HA support for all + // Loki components. This size is dedicated for setup **without** the + // requirement for single replication factor and auto-compaction. + // + // FIXME: Add clear description of ingestion/query performance expectations. + SizeOneXPico LokiStackSizeType = "1x.pico" + // SizeOneXExtraSmall defines the size of a single Loki deployment - // with extra small resources/limits requirements and without HA support. - // This size is ultimately dedicated for development and demo purposes. - // DO NOT USE THIS IN PRODUCTION! + // with extra small resources/limits requirements and HA support for all + // Loki components. This size is dedicated for setup **without** the + // requirement for single replication factor and auto-compaction. // // FIXME: Add clear description of ingestion/query performance expectations. SizeOneXExtraSmall LokiStackSizeType = "1x.extra-small" diff --git a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml index fce1efd9432a..6fa468cf9996 100644 --- a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: docker.io/grafana/loki-operator:0.6.2 - createdAt: "2024-10-21T14:32:40Z" + createdAt: "2024-10-23T18:05:45Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. features.operators.openshift.io/disconnected: "true" diff --git a/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml b/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml index 87b204da9736..d7971f0cda67 100644 --- a/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml @@ -791,6 +791,7 @@ spec: out sizes. enum: - 1x.demo + - 1x.pico - 1x.extra-small - 1x.small - 1x.medium diff --git a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml index 8dc0d34e36f6..83b91072bb5c 100644 --- a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: docker.io/grafana/loki-operator:0.6.2 - createdAt: "2024-10-21T14:32:37Z" + createdAt: "2024-10-23T18:05:43Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. operators.operatorframework.io/builder: operator-sdk-unknown diff --git a/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml b/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml index 8dd8ad938683..0f5fdb231363 100644 --- a/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml @@ -792,6 +792,7 @@ spec: out sizes. enum: - 1x.demo + - 1x.pico - 1x.extra-small - 1x.small - 1x.medium diff --git a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml index 9d42513fc749..339b65f1f912 100644 --- a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: quay.io/openshift-logging/loki-operator:0.1.0 - createdAt: "2024-10-21T14:32:43Z" + createdAt: "2024-10-23T18:05:47Z" description: | The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging. ## Prerequisites and Requirements diff --git a/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml b/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml index 828a99481535..277350061c87 100644 --- a/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml @@ -791,6 +791,7 @@ spec: out sizes. enum: - 1x.demo + - 1x.pico - 1x.extra-small - 1x.small - 1x.medium diff --git a/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml b/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml index a4ce94922ffe..02dbdf73a392 100644 --- a/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml +++ b/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml @@ -773,6 +773,7 @@ spec: out sizes. enum: - 1x.demo + - 1x.pico - 1x.extra-small - 1x.small - 1x.medium diff --git a/operator/docs/operator/api.md b/operator/docs/operator/api.md index 8ea65485112d..7816be60e804 100644 --- a/operator/docs/operator/api.md +++ b/operator/docs/operator/api.md @@ -1916,9 +1916,9 @@ DO NOT USE THIS IN PRODUCTION!

"1x.extra-small"

SizeOneXExtraSmall defines the size of a single Loki deployment -with extra small resources/limits requirements and without HA support. -This size is ultimately dedicated for development and demo purposes. -DO NOT USE THIS IN PRODUCTION!

+with extra small resources/limits requirements and HA support for all +Loki components. This size is dedicated for setup without the +requirement for single replication factor and auto-compaction.

FIXME: Add clear description of ingestion/query performance expectations.

"1x.medium"

@@ -1928,6 +1928,13 @@ Loki components. This size is dedicated for setup with the requirement for single replication factor and auto-compaction.

FIXME: Add clear description of ingestion/query performance expectations.

+

"1x.pico"

+

SizeOneXPico defines the size of a single Loki deployment +with extra small resources/limits requirements and HA support for all +Loki components. This size is dedicated for setup without the +requirement for single replication factor and auto-compaction.

+

FIXME: Add clear description of ingestion/query performance expectations.

+

"1x.small"

SizeOneXSmall defines the size of a single Loki deployment with small resources/limits requirements and HA support for all diff --git a/operator/internal/manifests/internal/sizes.go b/operator/internal/manifests/internal/sizes.go index 0501aba60ea1..28ffe4fb3c31 100644 --- a/operator/internal/manifests/internal/sizes.go +++ b/operator/internal/manifests/internal/sizes.go @@ -48,6 +48,64 @@ var ResourceRequirementsTable = map[lokiv1.LokiStackSizeType]ComponentResources{ PVCSize: resource.MustParse("10Gi"), }, }, + lokiv1.SizeOneXPico: { + Querier: corev1.ResourceRequirements{ + Requests: map[corev1.ResourceName]resource.Quantity{ + corev1.ResourceCPU: resource.MustParse("750m"), + corev1.ResourceMemory: resource.MustParse("1.5Gi"), + }, + }, + Ruler: ResourceRequirements{ + Requests: map[corev1.ResourceName]resource.Quantity{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("1Gi"), + }, + PVCSize: resource.MustParse("10Gi"), + }, + Ingester: ResourceRequirements{ + PVCSize: resource.MustParse("10Gi"), + Requests: map[corev1.ResourceName]resource.Quantity{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("3Gi"), + }, + PDBMinAvailable: 1, + }, + Distributor: corev1.ResourceRequirements{ + Requests: map[corev1.ResourceName]resource.Quantity{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("500Mi"), + }, + }, + QueryFrontend: corev1.ResourceRequirements{ + Requests: map[corev1.ResourceName]resource.Quantity{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("500Mi"), + }, + }, + Compactor: ResourceRequirements{ + PVCSize: resource.MustParse("10Gi"), + Requests: map[corev1.ResourceName]resource.Quantity{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("500Mi"), + }, + }, + Gateway: corev1.ResourceRequirements{ + Requests: map[corev1.ResourceName]resource.Quantity{ + corev1.ResourceCPU: resource.MustParse("500m"), + corev1.ResourceMemory: resource.MustParse("500Mi"), + }, + }, + IndexGateway: ResourceRequirements{ + PVCSize: resource.MustParse("50Gi"), + Requests: map[corev1.ResourceName]resource.Quantity{ + corev1.ResourceCPU: resource.MustParse("150m"), + corev1.ResourceMemory: resource.MustParse("250Mi"), + }, + }, + WALStorage: ResourceRequirements{ + PVCSize: resource.MustParse("150Gi"), + }, + }, lokiv1.SizeOneXExtraSmall: { Querier: corev1.ResourceRequirements{ Requests: map[corev1.ResourceName]resource.Quantity{ @@ -283,6 +341,66 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{ }, }, }, + + lokiv1.SizeOneXPico: { + Size: lokiv1.SizeOneXPico, + Replication: &lokiv1.ReplicationSpec{ + Factor: 2, + }, + Limits: &lokiv1.LimitsSpec{ + Global: &lokiv1.LimitsTemplateSpec{ + IngestionLimits: &lokiv1.IngestionLimitSpec{ + // Defaults from Loki docs + IngestionRate: 4, + IngestionBurstSize: 6, + MaxGlobalStreamsPerTenant: 10000, + MaxLabelNameLength: 1024, + MaxLabelValueLength: 2048, + MaxLabelNamesPerSeries: 30, + MaxLineSize: 256000, + PerStreamDesiredRate: 3, + PerStreamRateLimit: 5, + PerStreamRateLimitBurst: 15, + }, + QueryLimits: &lokiv1.QueryLimitSpec{ + // Defaults from Loki docs + MaxEntriesLimitPerQuery: 5000, + MaxChunksPerQuery: 2000000, + MaxQuerySeries: 500, + QueryTimeout: "3m", + CardinalityLimit: 100000, + MaxVolumeSeries: 1000, + }, + }, + }, + Template: &lokiv1.LokiTemplateSpec{ + Compactor: &lokiv1.LokiComponentSpec{ + Replicas: 1, + }, + Distributor: &lokiv1.LokiComponentSpec{ + Replicas: 2, + }, + Ingester: &lokiv1.LokiComponentSpec{ + Replicas: 3, + }, + Querier: &lokiv1.LokiComponentSpec{ + Replicas: 2, + }, + QueryFrontend: &lokiv1.LokiComponentSpec{ + Replicas: 2, + }, + Gateway: &lokiv1.LokiComponentSpec{ + Replicas: 2, + }, + IndexGateway: &lokiv1.LokiComponentSpec{ + Replicas: 2, + }, + Ruler: &lokiv1.LokiComponentSpec{ + Replicas: 2, + }, + }, + }, + lokiv1.SizeOneXExtraSmall: { Size: lokiv1.SizeOneXExtraSmall, Replication: &lokiv1.ReplicationSpec{ @@ -292,15 +410,16 @@ var StackSizeTable = map[lokiv1.LokiStackSizeType]lokiv1.LokiStackSpec{ Global: &lokiv1.LimitsTemplateSpec{ IngestionLimits: &lokiv1.IngestionLimitSpec{ // Defaults from Loki docs - IngestionRate: 4, - IngestionBurstSize: 6, - MaxLabelNameLength: 1024, - MaxLabelValueLength: 2048, - MaxLabelNamesPerSeries: 30, - MaxLineSize: 256000, - PerStreamDesiredRate: 3, - PerStreamRateLimit: 5, - PerStreamRateLimitBurst: 15, + IngestionRate: 4, + IngestionBurstSize: 6, + MaxGlobalStreamsPerTenant: 10000, + MaxLabelNameLength: 1024, + MaxLabelValueLength: 2048, + MaxLabelNamesPerSeries: 30, + MaxLineSize: 256000, + PerStreamDesiredRate: 3, + PerStreamRateLimit: 5, + PerStreamRateLimitBurst: 15, }, QueryLimits: &lokiv1.QueryLimitSpec{ // Defaults from Loki docs