Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operator: Add automatic stream sharding support #11091

Merged
merged 22 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c937d89
Add field desiredRate to LimitsTemplateSpec
periklis Oct 31, 2023
17908d8
Add validation for desiredRate field
periklis Oct 31, 2023
4098203
Replace defaults per-stream-rate limits with desired rate
periklis Oct 31, 2023
e8d74df
Add config rendering for desiredRate
periklis Oct 31, 2023
2a24330
Update API docs
periklis Oct 31, 2023
096c6d2
Add changelog entry
periklis Oct 31, 2023
092bd15
Apply suggestions from code review
periklis Oct 31, 2023
56c39f6
Address code review suggestions
periklis Oct 31, 2023
d4e2b23
Address code review suggestions
periklis Oct 31, 2023
55a0376
Address code review suggestions
periklis Oct 31, 2023
dc013a1
Simplify validation
periklis Nov 2, 2023
f2b5666
Merge remote-tracking branch 'upstream/main' into operator-auto-strea…
periklis Nov 20, 2023
e022a27
Merge branch 'main' into operator-auto-stream-sharding
periklis Nov 20, 2023
0cce214
Merge branch 'main' into operator-auto-stream-sharding
periklis Nov 20, 2023
30dd998
Apply code review suggenstions
periklis Nov 21, 2023
9130cc7
Merge branch 'main' into operator-auto-stream-sharding
periklis Nov 21, 2023
b853b43
Regenerate manifests
periklis Nov 21, 2023
8cf9c35
Remove validation and default per-stream-rate-limit to 5MB
periklis Nov 21, 2023
c317919
Apply code review suggestions
periklis Nov 22, 2023
bfdd6cd
Merge branch 'main' into operator-auto-stream-sharding
periklis Nov 22, 2023
bb1eb7a
Merge branch 'main' into operator-auto-stream-sharding
periklis Nov 23, 2023
d1c2a82
Apply code review suggestions
periklis Nov 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Main

- [11091](https://github.com/grafana/loki/pull/11091) **periklis**: Add automatic stream sharding support
- [11022](https://github.com/grafana/loki/pull/11022) **JoaoBraveCoding**: Remove outdated BoltDB dashboards
- [10932](https://github.com/grafana/loki/pull/10932) **JoaoBraveCoding**: Adds new value v13 to schema
- [11232](https://github.com/grafana/loki/pull/11232) **periklis**: Update dependencies and dev tools
Expand Down
8 changes: 8 additions & 0 deletions operator/apis/loki/v1/lokistack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,14 @@ type IngestionLimitSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors="urn:alm:descriptor:com.tectonic.ui:number",displayName="Max Line Size"
MaxLineSize int32 `json:"maxLineSize,omitempty"`

// PerStreamDesiredRate defines the desired ingestion rate per second that LokiStack should
// target applying automatic stream sharding. Units MB.
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors="urn:alm:descriptor:com.tectonic.ui:number",displayName="Per Stream Desired Rate (in MB)"
PerStreamDesiredRate int32 `json:"perStreamDesiredRate,omitempty"`

// PerStreamRateLimit defines the maximum byte rate per second per stream. Units MB.
//
// +optional
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.5.0
createdAt: "2023-11-03T11:44:16Z"
createdAt: "2023-11-23T11:25:33Z"
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 Expand Up @@ -336,6 +336,12 @@ spec:
path: limits.global.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.global.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down Expand Up @@ -420,6 +426,12 @@ spec:
path: limits.tenants.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.tenants.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ spec:
on ingestion path. Units in Bytes.
format: int32
type: integer
perStreamDesiredRate:
description: PerStreamDesiredRate defines the desired
ingestion rate per second that LokiStack should target
applying automatic stream sharding. Units MB.
format: int32
type: integer
perStreamRateLimit:
description: PerStreamRateLimit defines the maximum byte
rate per second per stream. Units MB.
Expand Down Expand Up @@ -262,6 +268,12 @@ spec:
on ingestion path. Units in Bytes.
format: int32
type: integer
perStreamDesiredRate:
description: PerStreamDesiredRate defines the desired
ingestion rate per second that LokiStack should target
applying automatic stream sharding. Units MB.
format: int32
type: integer
perStreamRateLimit:
description: PerStreamRateLimit defines the maximum
byte rate per second per stream. Units MB.
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.5.0
createdAt: "2023-11-03T11:44:14Z"
createdAt: "2023-11-23T11:25:30Z"
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 Expand Up @@ -336,6 +336,12 @@ spec:
path: limits.global.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.global.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down Expand Up @@ -420,6 +426,12 @@ spec:
path: limits.tenants.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.tenants.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ spec:
on ingestion path. Units in Bytes.
format: int32
type: integer
perStreamDesiredRate:
description: PerStreamDesiredRate defines the desired
ingestion rate per second that LokiStack should target
applying automatic stream sharding. Units MB.
format: int32
type: integer
perStreamRateLimit:
description: PerStreamRateLimit defines the maximum byte
rate per second per stream. Units MB.
Expand Down Expand Up @@ -262,6 +268,12 @@ spec:
on ingestion path. Units in Bytes.
format: int32
type: integer
perStreamDesiredRate:
description: PerStreamDesiredRate defines the desired
ingestion rate per second that LokiStack should target
applying automatic stream sharding. Units MB.
format: int32
type: integer
perStreamRateLimit:
description: PerStreamRateLimit defines the maximum
byte rate per second per stream. Units MB.
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: "2023-11-03T11:44:18Z"
createdAt: "2023-11-23T11:25: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 Expand Up @@ -349,6 +349,12 @@ spec:
path: limits.global.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.global.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down Expand Up @@ -433,6 +439,12 @@ spec:
path: limits.tenants.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.tenants.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ spec:
on ingestion path. Units in Bytes.
format: int32
type: integer
perStreamDesiredRate:
description: PerStreamDesiredRate defines the desired
ingestion rate per second that LokiStack should target
applying automatic stream sharding. Units MB.
format: int32
type: integer
perStreamRateLimit:
description: PerStreamRateLimit defines the maximum byte
rate per second per stream. Units MB.
Expand Down Expand Up @@ -262,6 +268,12 @@ spec:
on ingestion path. Units in Bytes.
format: int32
type: integer
perStreamDesiredRate:
description: PerStreamDesiredRate defines the desired
ingestion rate per second that LokiStack should target
applying automatic stream sharding. Units MB.
format: int32
type: integer
perStreamRateLimit:
description: PerStreamRateLimit defines the maximum
byte rate per second per stream. Units MB.
Expand Down
12 changes: 12 additions & 0 deletions operator/config/crd/bases/loki.grafana.com_lokistacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ spec:
on ingestion path. Units in Bytes.
format: int32
type: integer
perStreamDesiredRate:
description: PerStreamDesiredRate defines the desired
ingestion rate per second that LokiStack should target
applying automatic stream sharding. Units MB.
format: int32
type: integer
perStreamRateLimit:
description: PerStreamRateLimit defines the maximum byte
rate per second per stream. Units MB.
Expand Down Expand Up @@ -244,6 +250,12 @@ spec:
on ingestion path. Units in Bytes.
format: int32
type: integer
perStreamDesiredRate:
description: PerStreamDesiredRate defines the desired
ingestion rate per second that LokiStack should target
applying automatic stream sharding. Units MB.
format: int32
type: integer
perStreamRateLimit:
description: PerStreamRateLimit defines the maximum
byte rate per second per stream. Units MB.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ spec:
path: limits.global.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.global.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down Expand Up @@ -333,6 +339,12 @@ spec:
path: limits.tenants.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.tenants.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ spec:
path: limits.global.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.global.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down Expand Up @@ -333,6 +339,12 @@ spec:
path: limits.tenants.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.tenants.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ spec:
path: limits.global.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.global.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down Expand Up @@ -345,6 +351,12 @@ spec:
path: limits.tenants.ingestion.maxLineSize
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamDesiredRate defines the desired ingestion rate per second
that LokiStack should target applying automatic stream sharding. Units MB.
displayName: Per Stream Desired Rate (in MB)
path: limits.tenants.ingestion.perStreamDesiredRate
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: PerStreamRateLimit defines the maximum byte rate per second per
stream. Units MB.
displayName: Maximum byte rate per second per stream (in MB)
Expand Down
13 changes: 13 additions & 0 deletions operator/docs/operator/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,19 @@ int32
</tr>
<tr>
<td>
<code>perStreamDesiredRate</code><br/>
<em>
int32
</em>
</td>
<td>
<em>(Optional)</em>
<p>PerStreamDesiredRate defines the desired ingestion rate per second that LokiStack should
target applying automatic stream sharding. Units MB.</p>
</td>
</tr>
<tr>
<td>
<code>perStreamRateLimit</code><br/>
<em>
int32
Expand Down
Loading
Loading