Skip to content

Commit

Permalink
feat: Cleanup values.yaml with sensible defaults (#256)
Browse files Browse the repository at this point in the history
Send everything to the logs path ("/v2/otel").
This means that we can remove the entity-specific exporter, and use
either the ENTITY or OBSERVE token as authorization in the logs path.

Remove image tag and pull policy from default values: this means that
the helm charts, unless we override these with custom values, will use
the latest (publicly released) agent image, and will ALWAYS pull it.

If we specify a custom image, imagePullPolicy is automatically changed
to "IfNotPresent", which is what we want. To avoid confusion, since the
pull policy has amazing defaults, we completely remove it!

Change deployment template: remove chartVersion as default image tag,
since the two are completely uncorrelated and it makes no sense to use
that default. Instead, only specify an image tag when it's set
explicitly in the variables. Otherwise, just omit the tag, which
defaults to "latest".

Same goes for the iamgePullPolicy, only set it when explicitly defined,
otherwise use the defaults!
  • Loading branch information
obs-gh-enricogiorio authored Nov 7, 2024
1 parent ebb76d3 commit 0db5a37
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 38 deletions.
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: agent
description: Chart to install K8s collection stack based on Observe Agent
type: application
version: 0.28.3
version: 0.29.0
appVersion: "1.1.0"
dependencies:
- name: opentelemetry-collector
Expand Down
12 changes: 6 additions & 6 deletions charts/agent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# agent

![Version: 0.28.3](https://img.shields.io/badge/Version-0.28.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square)
![Version: 0.29.0](https://img.shields.io/badge/Version-0.29.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square)

> [!CAUTION]
> This chart is under active development and is not meant to be installed yet.
Expand Down Expand Up @@ -82,7 +82,7 @@ Chart to install K8s collection stack based on Observe Agent
| cluster-events.extraVolumes[0].name | string | `"observe-agent-deployment-config"` | |
| cluster-events.image.pullPolicy | string | `"IfNotPresent"` | |
| cluster-events.image.repository | string | `"observeinc/observe-agent"` | |
| cluster-events.image.tag | string | `"1.3.0"` | |
| cluster-events.image.tag | string | `"1.4.0"` | |
| cluster-events.initContainers[0].env[0].name | string | `"NAMESPACE"` | |
| cluster-events.initContainers[0].env[0].valueFrom.fieldRef.fieldPath | string | `"metadata.namespace"` | |
| cluster-events.initContainers[0].image | string | `"observeinc/kube-cluster-info:v0.11.1"` | |
Expand Down Expand Up @@ -147,7 +147,7 @@ Chart to install K8s collection stack based on Observe Agent
| cluster-metrics.extraVolumes[0].name | string | `"observe-agent-deployment-config"` | |
| cluster-metrics.image.pullPolicy | string | `"IfNotPresent"` | |
| cluster-metrics.image.repository | string | `"observeinc/observe-agent"` | |
| cluster-metrics.image.tag | string | `"1.3.0"` | |
| cluster-metrics.image.tag | string | `"1.4.0"` | |
| cluster-metrics.initContainers[0].env[0].name | string | `"NAMESPACE"` | |
| cluster-metrics.initContainers[0].env[0].valueFrom.fieldRef.fieldPath | string | `"metadata.namespace"` | |
| cluster-metrics.initContainers[0].image | string | `"observeinc/kube-cluster-info:v0.11.1"` | |
Expand Down Expand Up @@ -219,7 +219,7 @@ Chart to install K8s collection stack based on Observe Agent
| monitor.extraVolumes[0].name | string | `"observe-agent-deployment-config"` | |
| monitor.image.pullPolicy | string | `"IfNotPresent"` | |
| monitor.image.repository | string | `"observeinc/observe-agent"` | |
| monitor.image.tag | string | `"1.3.0"` | |
| monitor.image.tag | string | `"1.4.0"` | |
| monitor.initContainers[0].env[0].name | string | `"NAMESPACE"` | |
| monitor.initContainers[0].env[0].valueFrom.fieldRef.fieldPath | string | `"metadata.namespace"` | |
| monitor.initContainers[0].image | string | `"observeinc/kube-cluster-info:v0.11.1"` | |
Expand Down Expand Up @@ -307,7 +307,7 @@ Chart to install K8s collection stack based on Observe Agent
| node-logs-metrics.extraVolumes[4].name | string | `"hostfs"` | |
| node-logs-metrics.image.pullPolicy | string | `"IfNotPresent"` | |
| node-logs-metrics.image.repository | string | `"observeinc/observe-agent"` | |
| node-logs-metrics.image.tag | string | `"1.3.0"` | |
| node-logs-metrics.image.tag | string | `"1.4.0"` | |
| node-logs-metrics.initContainers[0].env[0].name | string | `"NAMESPACE"` | |
| node-logs-metrics.initContainers[0].env[0].valueFrom.fieldRef.fieldPath | string | `"metadata.namespace"` | |
| node-logs-metrics.initContainers[0].image | string | `"observeinc/kube-cluster-info:v0.11.1"` | |
Expand Down Expand Up @@ -362,5 +362,5 @@ Chart to install K8s collection stack based on Observe Agent
| observe.entityToken.create | bool | `false` | |
| observe.entityToken.use | bool | `false` | |
| observe.entityToken.value | string | `""` | |
| observe.token.create | bool | `true` | |
| observe.token.create | bool | `false` | |
| observe.token.value | string | `""` | |
15 changes: 1 addition & 14 deletions charts/agent/templates/_cluster-events-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ extensions:

exporters:
{{- include "config.exporters.debug" . | nindent 2 }}
{{ if .Values.observe.entityToken.use }}
{{- include "config.exporters.otlphttp.observe.entity" . | nindent 2 }}
{{ end }}
{{- include "config.exporters.otlphttp.observe.base" . | nindent 2 }}

receivers:
# this is used to create a cluster resource by pulling namespaces and then dropping all but kube-system with filter processor
Expand Down Expand Up @@ -430,23 +427,13 @@ service:
extensions: [health_check]
pipelines:
logs/objects:
receivers: [k8sobjects/objects]
processors: [memory_limiter, batch, resource/observe_common, transform/object, observek8sattributes]
exporters: [otlphttp/observe/base, debug/override]
logs/cluster:
receivers: [k8sobjects/cluster]
processors: [memory_limiter, batch, resource/observe_common, filter/cluster, transform/cluster]
exporters: [otlphttp/observe/base, debug/override]
{{ if .Values.observe.entityToken.use -}}
logs/entity:
receivers: [k8sobjects/objects]
processors: [memory_limiter, batch, resource/observe_common, transform/object, observek8sattributes]
exporters: [otlphttp/observe/entity, debug/override]
logs/cluster/entity:
logs/cluster:
receivers: [k8sobjects/cluster]
processors: [memory_limiter, batch, resource/observe_common, filter/cluster, transform/cluster]
exporters: [otlphttp/observe/entity, debug/override]
{{- end }}

{{- include "config.service.telemetry" . | nindent 2 }}

Expand Down
6 changes: 5 additions & 1 deletion charts/agent/templates/_config-exporters.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ otlphttp/observe/base:

{{- define "config.exporters.otlphttp.observe.entity" -}}
otlphttp/observe/entity:
logs_endpoint: "{{ .Values.observe.collectionEndpoint.value | toString | trimSuffix "/" }}/v1/kubernetes/v1/entity"
endpoint: "{{ .Values.observe.collectionEndpoint.value | toString | trimSuffix "/" }}/v2/otel"
headers:
{{- if .Values.observe.entityToken.use -}}
authorization: "Bearer ${env:ENTITY_TOKEN}"
{{- else }}
authorization: "${env:OBSERVE_TOKEN}"
{{- end }}
sending_queue:
enabled: {{ .Values.agent.config.global.exporters.sendingQueue.enabled }}
retry_on_failure:
Expand Down
22 changes: 6 additions & 16 deletions charts/agent/values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# This section is for configuring agent to send data to Observe endpoints
# we recommend using --set token.value=YOUR_TOKEN for values you want to keep secret
# supplying a token creates a secret on your cluster
observe:
# If create = false it is assumed that a secret named agent-credentials with key: OBSERVE_TOKEN already exists
token:
create: true
create: false
value: ""
collectionEndpoint:
# ex - https://12345678.collect.observeinc.com
Expand Down Expand Up @@ -66,7 +64,7 @@ node:
# Log rotation glob assumes rename of file follows this pattern *.log.*
include: '["/var/log/pods/*/*/*.log", "/var/log/pods/*/*/*.log.*", "/var/log/kube-apiserver-audit.log"]'
# A list of file glob patterns to exclude from reading. This is applied against the paths matched by include. Need to put inside of '' to avoid helm stripping commas and quotes.
# Log rotation exclude glob assumes files previously rotated and renamed are zipped after latest rotated file is created
# Log rotation exclude glob assumes files previously rotated and renamed are zipped after 1.4.0 rotated file is created
exclude: '["/var/log/pods/*/*/*.log.*.gz"]'
# time unit 1m, 1h
lookbackPeriod: 24h
Expand Down Expand Up @@ -152,9 +150,7 @@ cluster-events:

image:
repository: observeinc/observe-agent
# Overrides the image tag whose default is the chart appVersion.
# The service's name will be applied to the end of this value.
tag: "1.3.0"
tag: 1.4.0
pullPolicy: IfNotPresent

command:
Expand Down Expand Up @@ -291,9 +287,7 @@ cluster-metrics:

image:
repository: observeinc/observe-agent
# # Overrides the image tag whose default is the chart appVersion.
# # The service's name will be applied to the end of this value.
tag: "1.3.0"
tag: 1.4.0
pullPolicy: IfNotPresent

command:
Expand Down Expand Up @@ -422,9 +416,7 @@ node-logs-metrics:

image:
repository: observeinc/observe-agent
# # Overrides the image tag whose default is the chart appVersion.
# # The service's name will be applied to the end of this value.
tag: "1.3.0"
tag: 1.4.0
pullPolicy: IfNotPresent

command:
Expand Down Expand Up @@ -586,9 +578,7 @@ monitor:

image:
repository: observeinc/observe-agent
# # Overrides the image tag whose default is the chart appVersion.
# # The service's name will be applied to the end of this value.
tag: "1.3.0"
tag: 1.4.0
pullPolicy: IfNotPresent

command:
Expand Down
1 change: 1 addition & 0 deletions integration/modules/deploy_helm/values/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ observe:
collectionEndpoint:
value: ${observe_url}
token:
create: true
value: ${observe_token}
cluster:
namespaceOverride:
Expand Down
1 change: 1 addition & 0 deletions integration/modules/deploy_helm/values/node_affinity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ observe:
collectionEndpoint:
value: ${observe_url}
token:
create: true
value: ${observe_token}
cluster:
namespaceOverride:
Expand Down
1 change: 1 addition & 0 deletions integration/modules/deploy_helm/values/node_taint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ observe:
collectionEndpoint:
value: ${observe_url}
token:
create: true
value: ${observe_token}
cluster:
namespaceOverride:
Expand Down

0 comments on commit 0db5a37

Please sign in to comment.