Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
LOG-1894: Update Loki Operand to 2.4.1 (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-GV committed Dec 7, 2021
1 parent 314f701 commit 91d6601
Show file tree
Hide file tree
Showing 28 changed files with 765 additions and 128 deletions.
11 changes: 9 additions & 2 deletions api/v1beta1/lokistack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,19 @@ type LokiTemplateSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Query Frontend pods"
QueryFrontend *LokiComponentSpec `json:"queryFrontend,omitempty"`

// Gateway defines the lokistack-gateway component spec.
// Gateway defines the lokistack gateway component spec.
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Gateway pods"
Gateway *LokiComponentSpec `json:"gateway,omitempty"`

// IndexGateway defines the index gateway component spec.
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Index Gateway pods"
IndexGateway *LokiComponentSpec `json:"indexGateway,omitempty"`
}

// ObjectStorageSecretSpec is a secret reference containing name only, no namespace.
Expand Down Expand Up @@ -416,7 +423,7 @@ type IngestionLimitSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors="urn:alm:descriptor:com.tectonic.ui:number",displayName="Max Global Streams per Tenant"
MaxGlobalStreamsPerTenant int32 `json:"maxGlobalStreamsPerTenant,omitempty"`

// MaxLineSize defines the aximum line size on ingestion path. Units in Bytes.
// MaxLineSize defines the maximum line size on ingestion path. Units in Bytes.
//
// +optional
// +kubebuilder:validation:Optional
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions bundle/manifests/loki-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ spec:
path: limits.global.ingestion.maxLabelValueLength
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxLineSize defines the aximum line size on ingestion path. Units
in Bytes.
- description: MaxLineSize defines the maximum line size on ingestion path.
Units in Bytes.
displayName: Max Line Size
path: limits.global.ingestion.maxLineSize
x-descriptors:
Expand Down Expand Up @@ -191,8 +191,8 @@ spec:
path: limits.tenants.ingestion.maxLabelValueLength
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxLineSize defines the aximum line size on ingestion path. Units
in Bytes.
- description: MaxLineSize defines the maximum line size on ingestion path.
Units in Bytes.
displayName: Max Line Size
path: limits.tenants.ingestion.maxLineSize
x-descriptors:
Expand Down Expand Up @@ -272,14 +272,22 @@ spec:
path: template.distributor.replicas
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Gateway defines the lokistack-gateway component spec.
- description: Gateway defines the lokistack gateway component spec.
displayName: Gateway pods
path: template.gateway
- description: Replicas defines the number of replica pods of the component.
displayName: Replicas
path: template.gateway.replicas
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: IndexGateway defines the index gateway component spec.
displayName: Index Gateway pods
path: template.indexGateway
- description: Replicas defines the number of replica pods of the component.
displayName: Replicas
path: template.indexGateway.replicas
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Ingester defines the ingester component spec.
displayName: Ingester pods
path: template.ingester
Expand Down Expand Up @@ -589,7 +597,7 @@ spec:
- /manager
env:
- name: RELATED_IMAGE_LOKI
value: quay.io/openshift-logging/loki:v2.2.0-10
value: quay.io/openshift-logging/loki:v2.4.1
- name: RELATED_IMAGE_GATEWAY
value: quay.io/observatorium/api:latest
- name: RELATED_IMAGE_OPA
Expand Down
65 changes: 62 additions & 3 deletions bundle/manifests/loki.openshift.io_lokistacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
format: int32
type: integer
maxLineSize:
description: MaxLineSize defines the aximum line size
description: MaxLineSize defines the maximum line size
on ingestion path. Units in Bytes.
format: int32
type: integer
Expand Down Expand Up @@ -157,7 +157,7 @@ spec:
format: int32
type: integer
maxLineSize:
description: MaxLineSize defines the aximum line size
description: MaxLineSize defines the maximum line size
on ingestion path. Units in Bytes.
format: int32
type: integer
Expand Down Expand Up @@ -351,7 +351,66 @@ spec:
type: array
type: object
gateway:
description: Gateway defines the lokistack-gateway component spec.
description: Gateway defines the lokistack gateway component spec.
properties:
nodeSelector:
additionalProperties:
type: string
description: NodeSelector defines the labels required by a
node to schedule the component onto it.
type: object
replicas:
description: Replicas defines the number of replica pods of
the component.
format: int32
type: integer
tolerations:
description: Tolerations defines the tolerations required
by a node to schedule the component onto it.
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified,
allowed values are NoSchedule, PreferNoSchedule and
NoExecute.
type: string
key:
description: Key is the taint key that the toleration
applies to. Empty means match all taint keys. If the
key is empty, operator must be Exists; this combination
means to match all values and all keys.
type: string
operator:
description: Operator represents a key's relationship
to the value. Valid operators are Exists and Equal.
Defaults to Equal. Exists is equivalent to wildcard
for value, so that a pod can tolerate all taints of
a particular category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period
of time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the
taint forever (do not evict). Zero and negative values
will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration
matches to. If the operator is Exists, the value should
be empty, otherwise just a regular string.
type: string
type: object
type: array
type: object
indexGateway:
description: IndexGateway defines the index gateway component
spec.
properties:
nodeSelector:
additionalProperties:
Expand Down
42 changes: 39 additions & 3 deletions config/crd/bases/loki.openshift.io_lokistacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
format: int32
type: integer
maxLineSize:
description: MaxLineSize defines the aximum line size on ingestion path. Units in Bytes.
description: MaxLineSize defines the maximum line size on ingestion path. Units in Bytes.
format: int32
type: integer
type: object
Expand Down Expand Up @@ -121,7 +121,7 @@ spec:
format: int32
type: integer
maxLineSize:
description: MaxLineSize defines the aximum line size on ingestion path. Units in Bytes.
description: MaxLineSize defines the maximum line size on ingestion path. Units in Bytes.
format: int32
type: integer
type: object
Expand Down Expand Up @@ -258,7 +258,43 @@ spec:
type: array
type: object
gateway:
description: Gateway defines the lokistack-gateway component spec.
description: Gateway defines the lokistack gateway component spec.
properties:
nodeSelector:
additionalProperties:
type: string
description: NodeSelector defines the labels required by a node to schedule the component onto it.
type: object
replicas:
description: Replicas defines the number of replica pods of the component.
format: int32
type: integer
tolerations:
description: Tolerations defines the tolerations required by a node to schedule the component onto it.
items:
description: The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.
type: string
operator:
description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.
type: string
type: object
type: array
type: object
indexGateway:
description: IndexGateway defines the index gateway component spec.
properties:
nodeSelector:
additionalProperties:
Expand Down
18 changes: 13 additions & 5 deletions config/manifests/bases/loki-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ spec:
path: limits.global.ingestion.maxLabelValueLength
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxLineSize defines the aximum line size on ingestion path. Units
in Bytes.
- description: MaxLineSize defines the maximum line size on ingestion path.
Units in Bytes.
displayName: Max Line Size
path: limits.global.ingestion.maxLineSize
x-descriptors:
Expand Down Expand Up @@ -170,8 +170,8 @@ spec:
path: limits.tenants.ingestion.maxLabelValueLength
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:number
- description: MaxLineSize defines the aximum line size on ingestion path. Units
in Bytes.
- description: MaxLineSize defines the maximum line size on ingestion path.
Units in Bytes.
displayName: Max Line Size
path: limits.tenants.ingestion.maxLineSize
x-descriptors:
Expand Down Expand Up @@ -251,14 +251,22 @@ spec:
path: template.distributor.replicas
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Gateway defines the lokistack-gateway component spec.
- description: Gateway defines the lokistack gateway component spec.
displayName: Gateway pods
path: template.gateway
- description: Replicas defines the number of replica pods of the component.
displayName: Replicas
path: template.gateway.replicas
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: IndexGateway defines the index gateway component spec.
displayName: Index Gateway pods
path: template.indexGateway
- description: Replicas defines the number of replica pods of the component.
displayName: Replicas
path: template.indexGateway.replicas
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Ingester defines the ingester component spec.
displayName: Ingester pods
path: template.ingester
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ spec:
- name: manager
env:
- name: RELATED_IMAGE_LOKI
value: docker.io/grafana/loki:2.2.0
value: docker.io/grafana/loki:2.4.1
- name: RELATED_IMAGE_GATEWAY
value: quay.io/observatorium/api:latest
2 changes: 1 addition & 1 deletion config/overlays/openshift/manager_related_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
- name: manager
env:
- name: RELATED_IMAGE_LOKI
value: quay.io/openshift-logging/loki:v2.2.0-10
value: quay.io/openshift-logging/loki:v2.4.1
- name: RELATED_IMAGE_GATEWAY
value: quay.io/observatorium/api:latest
- name: RELATED_IMAGE_OPA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ spec:
- name: manager
env:
- name: RELATED_IMAGE_LOKI
value: docker.io/grafana/loki:2.2.0
value: docker.io/grafana/loki:2.4.1
- name: RELATED_IMAGE_GATEWAY
value: quay.io/observatorium/api:latest
6 changes: 6 additions & 0 deletions internal/manifests/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@ func BuildAll(opts Options) ([]client.Object, error) {
return nil, err
}

indexGatewayObjs, err := BuildIndexGateway(opts)
if err != nil {
return nil, err
}

res = append(res, cm)
res = append(res, distributorObjs...)
res = append(res, ingesterObjs...)
res = append(res, querierObjs...)
res = append(res, compactorObjs...)
res = append(res, queryFrontendObjs...)
res = append(res, indexGatewayObjs...)
res = append(res, BuildLokiGossipRingService(opts.Name))

if opts.Flags.EnableGateway {
Expand Down
3 changes: 2 additions & 1 deletion internal/manifests/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestBuildAll_WithFeatureFlags_EnableServiceMonitors(t *testing.T) {
},
{
desc: "service monitor per component created",
MonitorCount: 6,
MonitorCount: 7,
BuildOptions: Options{
Name: "test",
Namespace: "test",
Expand Down Expand Up @@ -191,6 +191,7 @@ func TestBuildAll_WithFeatureFlags_EnableCertificateSigningService(t *testing.T)
NewQuerierHTTPService(tst.BuildOptions),
NewQueryFrontendHTTPService(tst.BuildOptions),
NewCompactorHTTPService(tst.BuildOptions),
NewIndexGatewayHTTPService(tst.BuildOptions),
NewGatewayHTTPService(tst.BuildOptions),
}

Expand Down
11 changes: 9 additions & 2 deletions internal/manifests/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package manifests
import (
"crypto/sha1"
"fmt"
"strings"

"github.com/ViaQ/loki-operator/internal/manifests/internal/config"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -59,7 +58,11 @@ func ConfigOptions(opt Options) config.Options {
FQDN: fqdn(NewQuerierHTTPService(opt).GetName(), opt.Namespace),
Port: httpPort,
},
StorageDirectory: strings.TrimRight(dataDirectory, "/"),
IndexGateway: config.Address{
FQDN: fqdn(NewIndexGatewayGRPCService(opt).GetName(), opt.Namespace),
Port: grpcPort,
},
StorageDirectory: dataDirectory,
ObjectStorage: config.ObjectStorage{
Endpoint: opt.ObjectStorage.Endpoint,
Buckets: opt.ObjectStorage.Buckets,
Expand All @@ -71,6 +74,10 @@ func ConfigOptions(opt Options) config.Options {
QuerierCPULimits: opt.ResourceRequirements.Querier.Requests.Cpu().Value(),
QueryFrontendReplicas: opt.Stack.Template.QueryFrontend.Replicas,
},
WriteAheadLog: config.WriteAheadLog{
Directory: walDirectory,
IngesterMemoryRequest: opt.ResourceRequirements.Ingester.Requests.Memory().Value(),
},
}
}

Expand Down

0 comments on commit 91d6601

Please sign in to comment.