Skip to content

Commit

Permalink
Make Loki Compute resources configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Sanmukhani committed May 21, 2021
1 parent 78fff4b commit 494442b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/observatorium_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ type LokiSpec struct {
Version string `json:"version,omitempty"`
// VolumeClaimTemplate
VolumeClaimTemplate VolumeClaimTemplate `json:"volumeClaimTemplate"`
// Compute Resources required by each component containers.
// +optional
Resources map[string]v1.ResourceRequirements `json:"resources,omitempty"`
}

// ObservatoriumStatus defines the observed state of Observatorium
Expand Down
7 changes: 7 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions jsonnet/obs-operator.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ local operatorObs = obs {
image: if std.objectHas(cr.spec.loki, 'image') then cr.spec.loki.image else obs.loki.config.image,
replicas: if std.objectHas(cr.spec.loki, 'replicas') then cr.spec.loki.replicas else obs.loki.config.replicas,
version: if std.objectHas(cr.spec.loki, 'version') then cr.spec.loki.version else obs.loki.config.version,
resources: if std.objectHas(cr.spec.loki, 'resources') then cr.spec.loki.resources else obs.loki.config.resources,
objectStorageConfig: if cr.spec.objectStorageConfig.loki != null then cr.spec.objectStorageConfig.loki else obs.loki.config.objectStorageConfig,
}) else {},

Expand Down
25 changes: 25 additions & 0 deletions manifests/crds/core.observatorium.io_observatoria.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,31 @@ spec:
type: integer
description: Loki replicas per component
type: object
resources:
additionalProperties:
description: ResourceRequirements describes the compute resource requirements.
properties:
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
type: object
type: object
description: Compute Resources required by each component containers.
type: object
version:
description: Version of Loki image to be deployed
type: string
Expand Down

0 comments on commit 494442b

Please sign in to comment.