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
1 change: 1 addition & 0 deletions operations/helm/charts/grafana-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Unreleased
- Add support for adding Annotations to Service (@ofirshtrull)
- Add `agent.envFrom` value. (@carlosjgp)
- Add `controller.hostNetwork` value. (@carlosjgp)
- Add `controller.dnsPolicy` value. (@carlosjgp)

### Bugfixes

Expand Down
1 change: 1 addition & 0 deletions operations/helm/charts/grafana-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ use the older mode (called "static mode"), set the `agent.mode` value to
| controller.autoscaling.minReplicas | int | `1` | The lower limit for the number of replicas to which the autoscaler can scale down. |
| controller.autoscaling.targetCPUUtilizationPercentage | int | `0` | Average CPU utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetCPUUtilizationPercentage` to 0 will disable CPU scaling. |
| controller.autoscaling.targetMemoryUtilizationPercentage | int | `80` | Average Memory utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetMemoryUtilizationPercentage` to 0 will disable Memory scaling. |
| controller.dnsPolicy | string | `"ClusterFirst"` | Configures the DNS policy for the pod. https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy |
| controller.hostNetwork | bool | `false` | Configures Pods to use the host network. When set to true, the ports that will be used must be specified. |
| controller.podAnnotations | object | `{}` | Extra pod annotations to add. |
| controller.podLabels | object | `{}` | Extra pod labels to add. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Test rendering of the chart with the controller explicitly set to DaemonSet.
controller:
type: daemonset
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ spec:
priorityClassName: {{ .Values.controller.priorityClassName }}
{{- end }}
{{- if .Values.controller.hostNetwork }}
hostNetwork: {{ .Values.controller.hostNetwork }}
hostNetwork: {{ .Values.controller.hostNetwork }}
{{- end }}
dnsPolicy: {{ .Values.controller.dnsPolicy }}
{{- with .Values.controller.affinity }}
affinity:
{{- toYaml . | nindent 4 }}
Expand Down
3 changes: 3 additions & 0 deletions operations/helm/charts/grafana-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ controller:
# -- Configures Pods to use the host network. When set to true, the ports that will be used must be specified.
hostNetwork: false

# -- Configures the DNS policy for the pod. https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy
dnsPolicy: ClusterFirst

# -- Update strategy for updating deployed Pods.
updateStrategy: {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# Source: grafana-agent/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-agent
labels:
helm.sh/chart: grafana-agent
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
app.kubernetes.io/version: "vX.Y.Z"
app.kubernetes.io/managed-by: Helm
data:
config.river: |-
logging {
level = "info"
format = "logfmt"
}

discovery.kubernetes "pods" {
role = "pod"
}

discovery.kubernetes "nodes" {
role = "node"
}

discovery.kubernetes "services" {
role = "service"
}

discovery.kubernetes "endpoints" {
role = "endpoints"
}

discovery.kubernetes "endpointslices" {
role = "endpointslice"
}

discovery.kubernetes "ingresses" {
role = "ingress"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
# Source: grafana-agent/templates/controllers/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: grafana-agent
labels:
helm.sh/chart: grafana-agent
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
app.kubernetes.io/version: "vX.Y.Z"
app.kubernetes.io/managed-by: Helm
spec:
minReadySeconds: 10
selector:
matchLabels:
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
template:
metadata:
labels:
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
spec:
serviceAccount: grafana-agent
containers:
- name: grafana-agent
image: grafana/agent:v0.32.1
imagePullPolicy: IfNotPresent
args:
- run
- /etc/agent/config.river
- --storage.path=/tmp/agent
- --server.http.listen-addr=0.0.0.0:80
env:
- name: AGENT_MODE
value: flow
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
ports:
- containerPort: 80
name: http-metrics
- containerPort: 12347
name: faro
readinessProbe:
httpGet:
path: /-/ready
port: 80
initialDelaySeconds: 10
timeoutSeconds: 1
volumeMounts:
- name: config
mountPath: /etc/agent
- name: config-reloader
image: jimmidyson/configmap-reload:v0.8.0
args:
- --volume-dir=/etc/agent
- --webhook-url=http://localhost:80/-/reload
volumeMounts:
- name: config
mountPath: /etc/agent
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
volumes:
- name: config
configMap:
name: grafana-agent
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
# Source: grafana-agent/templates/rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: grafana-agent
labels:
helm.sh/chart: grafana-agent
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
app.kubernetes.io/version: "vX.Y.Z"
app.kubernetes.io/managed-by: Helm
rules:
# Rules which allow discovery.kubernetes to function.
- apiGroups:
- ""
- "discovery.k8s.io"
- "networking.k8s.io"
resources:
- endpoints
- endpointslices
- ingresses
- nodes
- nodes/proxy
- pods
- services
verbs:
- get
- list
- watch
# Rules which allow loki.source.kubernetes and loki.source.podlogs to work.
- apiGroups:
- ""
resources:
- pods
- pods/log
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- "monitoring.grafana.com"
resources:
- podlogs
verbs:
- get
- list
- watch
# Rules which allow mimir.rules.kubernetes to work.
- apiGroups: ["monitoring.coreos.com"]
resources:
- prometheusrules
verbs:
- get
- list
- watch
- nonResourceURLs:
- /metrics
verbs:
- get
# Rules for prometheus.kubernetes.*
- apiGroups: ["monitoring.coreos.com"]
resources:
- podmonitors
- servicemonitors
- probes
verbs:
- get
- list
- watch
# Rules which allow eventhandler to work.
- apiGroups:
- ""
resources:
- events
verbs:
- get
- list
- watch
---
# Source: grafana-agent/templates/rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: grafana-agent
labels:
helm.sh/chart: grafana-agent
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
app.kubernetes.io/version: "vX.Y.Z"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: grafana-agent
subjects:
- kind: ServiceAccount
name: grafana-agent
namespace: default
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# Source: grafana-agent/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: grafana-agent
labels:
helm.sh/chart: grafana-agent
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
app.kubernetes.io/version: "vX.Y.Z"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
ports:
- name: http-metrics
port: 80
targetPort: 80
protocol: "TCP"
- name: faro
port: 12347
targetPort: 12347
protocol: "TCP"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Source: grafana-agent/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: grafana-agent
labels:
helm.sh/chart: grafana-agent
app.kubernetes.io/name: grafana-agent
app.kubernetes.io/instance: grafana-agent
app.kubernetes.io/version: "vX.Y.Z"
app.kubernetes.io/managed-by: Helm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/agent
dnsPolicy: ClusterFirst
volumes:
- name: config
configMap:
Expand Down
Loading