Skip to content

Commit

Permalink
feat(operator): introduce 1x.pico size
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoBraveCoding committed Oct 7, 2024
1 parent c2f38e1 commit 1e2bd01
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 9 deletions.
14 changes: 11 additions & 3 deletions operator/apis/loki/v1/lokistack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-03T12:34:36Z"
createdAt: "2024-10-07T15:57:33Z"
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 @@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: docker.io/grafana/loki-operator:0.6.2
createdAt: "2024-10-03T12:34:33Z"
createdAt: "2024-10-07T15:57:31Z"
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 @@ -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-03T12:34:39Z"
createdAt: "2024-10-07T15:57:35Z"
description: |
The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging.
## Prerequisites and Requirements
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 @@ -1961,9 +1961,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 @@ -1973,6 +1973,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
117 changes: 117 additions & 0 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("1"),
corev1.ResourceMemory: resource.MustParse("1.5Gi"),
},
},
Ruler: ResourceRequirements{
Requests: map[corev1.ResourceName]resource.Quantity{
corev1.ResourceCPU: resource.MustParse("1"),
corev1.ResourceMemory: resource.MustParse("2Gi"),
},
PVCSize: resource.MustParse("10Gi"),
},
Ingester: ResourceRequirements{
PVCSize: resource.MustParse("10Gi"),
Requests: map[corev1.ResourceName]resource.Quantity{
corev1.ResourceCPU: resource.MustParse("1"),
corev1.ResourceMemory: resource.MustParse("4Gi"),
},
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("1"),
corev1.ResourceMemory: resource.MustParse("1Gi"),
},
},
Gateway: corev1.ResourceRequirements{
Requests: map[corev1.ResourceName]resource.Quantity{
corev1.ResourceCPU: resource.MustParse("250m"),
corev1.ResourceMemory: resource.MustParse("500Mi"),
},
},
IndexGateway: ResourceRequirements{
PVCSize: resource.MustParse("50Gi"),
Requests: map[corev1.ResourceName]resource.Quantity{
corev1.ResourceCPU: resource.MustParse("250m"),
corev1.ResourceMemory: resource.MustParse("500Mi"),
},
},
WALStorage: ResourceRequirements{
PVCSize: resource.MustParse("150Gi"),
},
},
lokiv1.SizeOneXExtraSmall: {
Querier: corev1.ResourceRequirements{
Requests: map[corev1.ResourceName]resource.Quantity{
Expand Down Expand Up @@ -283,6 +341,65 @@ 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,
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: 2,
},
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 Down

0 comments on commit 1e2bd01

Please sign in to comment.