Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
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
9 changes: 4 additions & 5 deletions production/tanka/grafana-agent/v1/lib/integrations.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@ local container = k.core.v1.container;
// https://github.com/grafana/agent/blob/main/docs/configuration-reference.md#integrations_config
withIntegrations(integrations):: {
assert std.objectHasAll(self, '_mode') : |||
withLokiConfig must be merged with the result of calling new.
withIntegrations must be merged with the result of calling new.
|||,
_integrations:: integrations,
},

// TODO(rfratto): only enable this when node_exporter is used.
integrationsMixin:: {
container+::
container.mixin.securityContext.withPrivileged(true) +
container.mixin.securityContext.withRunAsUser(0),

local controller = self.agent._controller,
agent+::
local controller = self._controller,
agent+:
// procfs, sysfs, rotfs
k.util.hostVolumeMount('proc', '/proc', '/host/proc', readOnly=true) +
k.util.hostVolumeMount('sys', '/sys', '/host/sys', readOnly=true) +
k.util.hostVolumeMount('root', '/', '/host/root', readOnly=true) +

controller.mixin.spec.template.spec.withHostPid(true) +
controller.mixin.spec.template.spec.withHostPID(true) +
controller.mixin.spec.template.spec.withHostNetwork(true),
},
}
2 changes: 2 additions & 0 deletions production/tanka/grafana-agent/v1/main.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ local service = k.core.v1.service;
else {},
} + (
if has_loki_config then $.lokiPermissionsMixin else {}
) + (
if has_integrations && std.objectHas(this._integrations, 'node_exporter') then $.integrationsMixin else {}
),

agent_etc: if std.length(etc_instances) > 0 then
Expand Down