Skip to content

Commit

Permalink
feat(operator): introduce 1x.pico size (#14407)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoBraveCoding authored Oct 24, 2024
1 parent 8361cf2 commit 57de81d
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 19 deletions.
16 changes: 12 additions & 4 deletions operator/api/loki/v1/lokistack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ spec:
out sizes.
enum:
- 1x.demo
- 1x.pico
- 1x.extra-small
- 1x.small
- 1x.medium
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ spec:
out sizes.
enum:
- 1x.demo
- 1x.pico
- 1x.extra-small
- 1x.small
- 1x.medium
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ spec:
out sizes.
enum:
- 1x.demo
- 1x.pico
- 1x.extra-small
- 1x.small
- 1x.medium
Expand Down
1 change: 1 addition & 0 deletions operator/config/crd/bases/loki.grafana.com_lokistacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ spec:
out sizes.
enum:
- 1x.demo
- 1x.pico
- 1x.extra-small
- 1x.small
- 1x.medium
Expand Down
13 changes: 10 additions & 3 deletions operator/docs/operator/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1916,9 +1916,9 @@ DO NOT USE THIS IN PRODUCTION!</p>
</td>
</tr><tr><td><p>&#34;1x.extra-small&#34;</p></td>
<td><p>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!</p>
with extra small resources/limits requirements and HA support for all
Loki components. This size is dedicated for setup <strong>without</strong> the
requirement for single replication factor and auto-compaction.</p>
<p>FIXME: Add clear description of ingestion/query performance expectations.</p>
</td>
</tr><tr><td><p>&#34;1x.medium&#34;</p></td>
Expand All @@ -1928,6 +1928,13 @@ Loki components. This size is dedicated for setup <strong>with</strong> the
requirement for single replication factor and auto-compaction.</p>
<p>FIXME: Add clear description of ingestion/query performance expectations.</p>
</td>
</tr><tr><td><p>&#34;1x.pico&#34;</p></td>
<td><p>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 <strong>without</strong> the
requirement for single replication factor and auto-compaction.</p>
<p>FIXME: Add clear description of ingestion/query performance expectations.</p>
</td>
</tr><tr><td><p>&#34;1x.small&#34;</p></td>
<td><p>SizeOneXSmall defines the size of a single Loki deployment
with small resources/limits requirements and HA support for all
Expand Down
137 changes: 128 additions & 9 deletions operator/internal/manifests/internal/sizes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand All @@ -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
Expand Down

0 comments on commit 57de81d

Please sign in to comment.