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

fix: set GO usage environment variables from resource limits #42

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
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
49 changes: 34 additions & 15 deletions resources/kubernetes/operator/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ defaultCRConfig:
targetAllocator:
enabled: false # Enable/disable the Operator's Target allocator.
# Refer to: https://github.com/open-telemetry/opentelemetry-operator/tree/main/cmd/otel-allocator
env:
- name: ELASTIC_AGENT_OTEL
value: '"true"'
- name: ELASTIC_ENDPOINT
valueFrom:
secretKeyRef:
name: elastic-secret-otel
key: elastic_endpoint
- name: ELASTIC_API_KEY
valueFrom:
secretKeyRef:
name: elastic-secret-otel
key: elastic_api_key

clusterRole:
rules:
Expand All @@ -59,6 +46,19 @@ collectors:
# requests:
# cpu: 100m
# memory: 500Mi
env:
- name: ELASTIC_AGENT_OTEL
value: '"true"'
- name: ELASTIC_ENDPOINT
valueFrom:
secretKeyRef:
name: elastic-secret-otel
key: elastic_endpoint
- name: ELASTIC_API_KEY
valueFrom:
secretKeyRef:
name: elastic-secret-otel
key: elastic_api_key
config:
exporters:
# [Debug exporter](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/debugexporter/README.md)
Expand Down Expand Up @@ -219,11 +219,30 @@ collectors:
# Configure the pods resources to control CPU and memory usage.
resources:
limits:
cpu: 100m
memory: 500Mi
cpu: 1500m
memory: 1500Mi
requests:
cpu: 100m
memory: 500Mi
env:
- name: ELASTIC_AGENT_OTEL
value: '"true"'
- name: ELASTIC_ENDPOINT
valueFrom:
secretKeyRef:
name: elastic-secret-otel
key: elastic_endpoint
- name: ELASTIC_API_KEY
valueFrom:
secretKeyRef:
name: elastic-secret-otel
key: elastic_api_key
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
resource: limits.cpu
- name: GOMEMLIMIT
value: "1025MiB"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can write a script to keep this 90% (or lower if we want to go lower) of the memory limit? Will be a bit easier to manage and update in future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, that would be a better setting. As discussed, we can help with open-telemetry/opentelemetry-collector-contrib#30289 moving it forward.

presets:
logsCollection:
enabled: true # Enable/disable the collection of node's logs.
Expand Down