diff --git a/charts/k8s-monitoring/README.md b/charts/k8s-monitoring/README.md index f3ab50e4a..6be24158c 100644 --- a/charts/k8s-monitoring/README.md +++ b/charts/k8s-monitoring/README.md @@ -161,6 +161,8 @@ podLogs: | alloy-logs.remoteConfig.auth.usernameFrom | string | `""` | Raw config for accessing the username. | | alloy-logs.remoteConfig.auth.usernameKey | string | `"username"` | The key for storing the username in the secret. | | alloy-logs.remoteConfig.enabled | bool | `false` | Enable fetching configuration from a remote config server. | +| alloy-logs.remoteConfig.extraAttributes | object | `{}` | Attributes to be added to this collector when requesting configuration. | +| alloy-logs.remoteConfig.pollFrequency | string | `"5m"` | The frequency at which to poll the remote config server for updates. | | alloy-logs.remoteConfig.secret.create | bool | `true` | Whether to create a secret for the remote config server. | | alloy-logs.remoteConfig.secret.embed | bool | `false` | If true, skip secret creation and embed the credentials directly into the configuration. | | alloy-logs.remoteConfig.secret.name | string | `""` | The name of the secret to create. | @@ -187,7 +189,6 @@ podLogs: | alloy-metrics.remoteConfig.auth.usernameKey | string | `"username"` | The key for storing the username in the secret. | | alloy-metrics.remoteConfig.enabled | bool | `false` | Enable fetching configuration from a remote config server. | | alloy-metrics.remoteConfig.extraAttributes | object | `{}` | Attributes to be added to this collector when requesting configuration. | -| alloy-metrics.remoteConfig.id | string | `--` | The unique identifier for this Alloy instance. | | alloy-metrics.remoteConfig.pollFrequency | string | `"5m"` | The frequency at which to poll the remote config server for updates. | | alloy-metrics.remoteConfig.secret.create | bool | `true` | Whether to create a secret for the remote config server. | | alloy-metrics.remoteConfig.secret.embed | bool | `false` | If true, skip secret creation and embed the credentials directly into the configuration. | @@ -213,6 +214,8 @@ podLogs: | alloy-profiles.remoteConfig.auth.usernameFrom | string | `""` | Raw config for accessing the username. | | alloy-profiles.remoteConfig.auth.usernameKey | string | `"username"` | The key for storing the username in the secret. | | alloy-profiles.remoteConfig.enabled | bool | `false` | Enable fetching configuration from a remote config server. | +| alloy-profiles.remoteConfig.extraAttributes | object | `{}` | Attributes to be added to this collector when requesting configuration. | +| alloy-profiles.remoteConfig.pollFrequency | string | `"5m"` | The frequency at which to poll the remote config server for updates. | | alloy-profiles.remoteConfig.secret.create | bool | `true` | Whether to create a secret for the remote config server. | | alloy-profiles.remoteConfig.secret.embed | bool | `false` | If true, skip secret creation and embed the credentials directly into the configuration. | | alloy-profiles.remoteConfig.secret.name | string | `""` | The name of the secret to create. | @@ -238,6 +241,8 @@ podLogs: | alloy-receiver.remoteConfig.auth.usernameFrom | string | `""` | Raw config for accessing the username. | | alloy-receiver.remoteConfig.auth.usernameKey | string | `"username"` | The key for storing the username in the secret. | | alloy-receiver.remoteConfig.enabled | bool | `false` | Enable fetching configuration from a remote config server. | +| alloy-receiver.remoteConfig.extraAttributes | object | `{}` | Attributes to be added to this collector when requesting configuration. | +| alloy-receiver.remoteConfig.pollFrequency | string | `"5m"` | The frequency at which to poll the remote config server for updates. | | alloy-receiver.remoteConfig.secret.create | bool | `true` | Whether to create a secret for the remote config server. | | alloy-receiver.remoteConfig.secret.embed | bool | `false` | If true, skip secret creation and embed the credentials directly into the configuration. | | alloy-receiver.remoteConfig.secret.name | string | `""` | The name of the secret to create. | @@ -263,6 +268,8 @@ podLogs: | alloy-singleton.remoteConfig.auth.usernameFrom | string | `""` | Raw config for accessing the username. | | alloy-singleton.remoteConfig.auth.usernameKey | string | `"username"` | The key for storing the username in the secret. | | alloy-singleton.remoteConfig.enabled | bool | `false` | Enable fetching configuration from a remote config server. | +| alloy-singleton.remoteConfig.extraAttributes | object | `{}` | Attributes to be added to this collector when requesting configuration. | +| alloy-singleton.remoteConfig.pollFrequency | string | `"5m"` | The frequency at which to poll the remote config server for updates. | | alloy-singleton.remoteConfig.secret.create | bool | `true` | Whether to create a secret for the remote config server. | | alloy-singleton.remoteConfig.secret.embed | bool | `false` | If true, skip secret creation and embed the credentials directly into the configuration. | | alloy-singleton.remoteConfig.secret.name | string | `""` | The name of the secret to create. | diff --git a/charts/k8s-monitoring/docs/examples/remote-config/README.md b/charts/k8s-monitoring/docs/examples/remote-config/README.md index e6c3fb9a6..9b1806179 100644 --- a/charts/k8s-monitoring/docs/examples/remote-config/README.md +++ b/charts/k8s-monitoring/docs/examples/remote-config/README.md @@ -5,7 +5,22 @@ # Remote Config This example demonstrates how to configure Alloy to utilize -[remote configuration](https://grafana.com/docs/alloy/latest/reference/config-blocks/remotecfg/). +[remote configuration](https://grafana.com/docs/alloy/latest/reference/config-blocks/remotecfg/). These two environment +variables must be set: + +* `GCLOUD_FM_COLLECTOR_ID` - The collector id. It should uniquely identify this Alloy instance. The value in practice is: + * For Deployments: `--` + * For StatefulSets: `--` + * For DaemonSets: `--` +* `GCLOUD_RW_API_KEY` - The Grafana Cloud Access Policy token that has following scopes: + * `fleet-management:read` + * `logs:write` + * `metrics:write` + * `traces:write` + * `profiles:write` + +The values file below shows enabling the `alloy-metrics` StatefulSet and the `alloy-logs` DaemonSets and a convenient +way to set the environment variables automatically. ## Values @@ -16,13 +31,55 @@ cluster: alloy-metrics: enabled: true + remoteConfig: + enabled: true + url: https://remote-config.example.com/alloy + auth: + type: basic + username: my-remote-cfg-user + passwordFrom: sys.env("GCLOUD_RW_API_KEY") alloy: stabilityLevel: public-preview + extraEnv: + - name: CLUSTER_NAME + value: remote-config-example-cluster + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(POD_NAME) + - name: GCLOUD_RW_API_KEY + value: my-remote-cfg-password + +alloy-logs: + enabled: true remoteConfig: enabled: true url: "https://remote-config.example.com/alloy" auth: - type: "basic" + type: basic username: "my-remote-cfg-user" - password: "my-remote-cfg-password" + passwordFrom: sys.env("GCLOUD_RW_API_KEY") + alloy: + stabilityLevel: public-preview + extraEnv: + - name: CLUSTER_NAME + value: remote-config-example-cluster + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(NODE_NAME) + - name: GCLOUD_RW_API_KEY + value: "my-remote-cfg-password" ``` diff --git a/charts/k8s-monitoring/docs/examples/remote-config/alloy-logs.alloy b/charts/k8s-monitoring/docs/examples/remote-config/alloy-logs.alloy new file mode 100644 index 000000000..37c7a6c2c --- /dev/null +++ b/charts/k8s-monitoring/docs/examples/remote-config/alloy-logs.alloy @@ -0,0 +1,26 @@ + + + +remote.kubernetes.secret "alloy_logs_remote_cfg" { + name = "alloy-logs-remote-cfg-k8smon-k8s-monitoring" + namespace = "default" +} + +remotecfg { + id = sys.env("GCLOUD_FM_COLLECTOR_ID") + url = "https://remote-config.example.com/alloy" + basic_auth { + username = nonsensitive(remote.kubernetes.secret.alloy_logs_remote_cfg.data["username"]) + password = sys.env("GCLOUD_RW_API_KEY") + } + poll_frequency = "5m" + attributes = { + "platform" = "kubernetes", + "source" = "k8s-monitoring", + "sourceVersion" = "2.0.4", + "release" = "k8smon", + "cluster" = "remote-config-example-cluster", + "namespace" = "default", + "workloadType" = "daemonset", + } +} diff --git a/charts/k8s-monitoring/docs/examples/remote-config/alloy-metrics.alloy b/charts/k8s-monitoring/docs/examples/remote-config/alloy-metrics.alloy index c4b0b5105..afac66932 100644 --- a/charts/k8s-monitoring/docs/examples/remote-config/alloy-metrics.alloy +++ b/charts/k8s-monitoring/docs/examples/remote-config/alloy-metrics.alloy @@ -7,16 +7,20 @@ remote.kubernetes.secret "alloy_metrics_remote_cfg" { } remotecfg { + id = sys.env("GCLOUD_FM_COLLECTOR_ID") url = "https://remote-config.example.com/alloy" basic_auth { username = nonsensitive(remote.kubernetes.secret.alloy_metrics_remote_cfg.data["username"]) - password = remote.kubernetes.secret.alloy_metrics_remote_cfg.data["password"] + password = sys.env("GCLOUD_RW_API_KEY") } - id = "remote-config-example-cluster-default-" + constants.hostname poll_frequency = "5m" attributes = { - "cluster" = "remote-config-example-cluster", "platform" = "kubernetes", + "source" = "k8s-monitoring", + "sourceVersion" = "2.0.4", + "release" = "k8smon", + "cluster" = "remote-config-example-cluster", + "namespace" = "default", "workloadType" = "statefulset", } } diff --git a/charts/k8s-monitoring/docs/examples/remote-config/description.txt b/charts/k8s-monitoring/docs/examples/remote-config/description.txt index 5252b703b..a60f92035 100644 --- a/charts/k8s-monitoring/docs/examples/remote-config/description.txt +++ b/charts/k8s-monitoring/docs/examples/remote-config/description.txt @@ -1,4 +1,19 @@ # Remote Config This example demonstrates how to configure Alloy to utilize -[remote configuration](https://grafana.com/docs/alloy/latest/reference/config-blocks/remotecfg/). +[remote configuration](https://grafana.com/docs/alloy/latest/reference/config-blocks/remotecfg/). These two environment +variables must be set: + +* `GCLOUD_FM_COLLECTOR_ID` - The collector id. It should uniquely identify this Alloy instance. The value in practice is: + * For Deployments: `--` + * For StatefulSets: `--` + * For DaemonSets: `--` +* `GCLOUD_RW_API_KEY` - The Grafana Cloud Access Policy token that has following scopes: + * `fleet-management:read` + * `logs:write` + * `metrics:write` + * `traces:write` + * `profiles:write` + +The values file below shows enabling the `alloy-metrics` StatefulSet and the `alloy-logs` DaemonSets and a convenient +way to set the environment variables automatically. diff --git a/charts/k8s-monitoring/docs/examples/remote-config/output.yaml b/charts/k8s-monitoring/docs/examples/remote-config/output.yaml index eb75ef5fc..3dc598a56 100644 --- a/charts/k8s-monitoring/docs/examples/remote-config/output.yaml +++ b/charts/k8s-monitoring/docs/examples/remote-config/output.yaml @@ -1,4 +1,20 @@ --- +# Source: k8s-monitoring/charts/alloy-logs/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: k8smon-alloy-logs + namespace: default + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy + app.kubernetes.io/component: rbac +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount @@ -24,7 +40,17 @@ metadata: type: Opaque data: username: "bXktcmVtb3RlLWNmZy11c2Vy" - password: "bXktcmVtb3RlLWNmZy1wYXNzd29yZA==" +# create: true +--- +# Source: k8s-monitoring/templates/remote_config_secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: "alloy-logs-remote-cfg-k8smon-k8s-monitoring" + namespace: "default" +type: Opaque +data: + username: "bXktcmVtb3RlLWNmZy11c2Vy" --- # Source: k8s-monitoring/templates/alloy-config.yaml apiVersion: v1 @@ -43,20 +69,159 @@ data: } remotecfg { + id = sys.env("GCLOUD_FM_COLLECTOR_ID") url = "https://remote-config.example.com/alloy" basic_auth { username = nonsensitive(remote.kubernetes.secret.alloy_metrics_remote_cfg.data["username"]) - password = remote.kubernetes.secret.alloy_metrics_remote_cfg.data["password"] + password = sys.env("GCLOUD_RW_API_KEY") } - id = "remote-config-example-cluster-default-" + constants.hostname poll_frequency = "5m" attributes = { - "cluster" = "remote-config-example-cluster", "platform" = "kubernetes", + "source" = "k8s-monitoring", + "sourceVersion" = "2.0.4", + "release" = "k8smon", + "cluster" = "remote-config-example-cluster", + "namespace" = "default", "workloadType" = "statefulset", } } --- +# Source: k8s-monitoring/templates/alloy-config.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: k8smon-alloy-logs + namespace: default +data: + config.alloy: |- + + + + remote.kubernetes.secret "alloy_logs_remote_cfg" { + name = "alloy-logs-remote-cfg-k8smon-k8s-monitoring" + namespace = "default" + } + + remotecfg { + id = sys.env("GCLOUD_FM_COLLECTOR_ID") + url = "https://remote-config.example.com/alloy" + basic_auth { + username = nonsensitive(remote.kubernetes.secret.alloy_logs_remote_cfg.data["username"]) + password = sys.env("GCLOUD_RW_API_KEY") + } + poll_frequency = "5m" + attributes = { + "platform" = "kubernetes", + "source" = "k8s-monitoring", + "sourceVersion" = "2.0.4", + "release" = "k8smon", + "cluster" = "remote-config-example-cluster", + "namespace" = "default", + "workloadType" = "daemonset", + } + } +--- +# Source: k8s-monitoring/charts/alloy-logs/templates/rbac.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: k8smon-alloy-logs + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy + app.kubernetes.io/component: rbac +rules: + # Rules which allow discovery.kubernetes to function. + - apiGroups: + - "" + - "discovery.k8s.io" + - "networking.k8s.io" + resources: + - endpoints + - endpointslices + - ingresses + - nodes + - nodes/proxy + - nodes/metrics + - 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 + # needed for remote.kubernetes.* + - apiGroups: [""] + resources: + - "configmaps" + - "secrets" + verbs: + - get + - list + - watch + # needed for otelcol.processor.k8sattributes + - apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["get", "list", "watch"] + - apiGroups: ["extensions"] + resources: ["replicasets"] + verbs: ["get", "list", "watch"] +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/rbac.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -157,6 +322,29 @@ rules: resources: ["replicasets"] verbs: ["get", "list", "watch"] --- +# Source: k8s-monitoring/charts/alloy-logs/templates/rbac.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: k8smon-alloy-logs + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy + app.kubernetes.io/component: rbac +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: k8smon-alloy-logs +subjects: + - kind: ServiceAccount + name: k8smon-alloy-logs + namespace: default +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/rbac.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -180,6 +368,32 @@ subjects: name: k8smon-alloy-metrics namespace: default --- +# Source: k8s-monitoring/charts/alloy-logs/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: k8smon-alloy-logs + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy + app.kubernetes.io/component: networking +spec: + type: ClusterIP + selector: + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + internalTrafficPolicy: Cluster + ports: + - name: http-metrics + port: 12345 + targetPort: 12345 + protocol: "TCP" +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/cluster_service.yaml apiVersion: v1 kind: Service @@ -239,6 +453,139 @@ spec: targetPort: 12345 protocol: "TCP" --- +# Source: k8s-monitoring/charts/alloy-logs/templates/controllers/daemonset.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: k8smon-alloy-logs + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy +spec: + minReadySeconds: 10 + selector: + matchLabels: + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: alloy + k8s.grafana.com/logs.job: integrations/alloy + labels: + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + spec: + serviceAccountName: k8smon-alloy-logs + containers: + - name: alloy + image: docker.io/grafana/alloy:v1.6.1 + imagePullPolicy: IfNotPresent + args: + - run + - /etc/alloy/config.alloy + - --storage.path=/tmp/alloy + - --server.http.listen-addr=0.0.0.0:12345 + - --server.http.ui-path-prefix=/ + - --stability.level=public-preview + env: + - name: ALLOY_DEPLOY_MODE + value: "helm" + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - + name: CLUSTER_NAME + value: remote-config-example-cluster + - + name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - + name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - + name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(NODE_NAME) + - + name: GCLOUD_RW_API_KEY + value: my-remote-cfg-password + ports: + - containerPort: 12345 + name: http-metrics + readinessProbe: + httpGet: + path: /-/ready + port: 12345 + scheme: HTTP + initialDelaySeconds: 10 + timeoutSeconds: 1 + securityContext: + allowPrivilegeEscalation: false + capabilities: + add: + - CHOWN + - DAC_OVERRIDE + - FOWNER + - FSETID + - KILL + - SETGID + - SETUID + - SETPCAP + - NET_BIND_SERVICE + - NET_RAW + - SYS_CHROOT + - MKNOD + - AUDIT_WRITE + - SETFCAP + drop: + - ALL + seccompProfile: + type: RuntimeDefault + volumeMounts: + - name: config + mountPath: /etc/alloy + - name: varlog + mountPath: /var/log + readOnly: true + - name: dockercontainers + mountPath: /var/lib/docker/containers + readOnly: true + - name: config-reloader + image: ghcr.io/jimmidyson/configmap-reload:v0.14.0 + args: + - --volume-dir=/etc/alloy + - --webhook-url=http://localhost:12345/-/reload + volumeMounts: + - name: config + mountPath: /etc/alloy + resources: + requests: + cpu: 1m + memory: 5Mi + dnsPolicy: ClusterFirst + nodeSelector: + kubernetes.io/os: linux + volumes: + - name: config + configMap: + name: k8smon-alloy-logs + - name: varlog + hostPath: + path: /var/log + - name: dockercontainers + hostPath: + path: /var/lib/docker/containers +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/controllers/statefulset.yaml apiVersion: apps/v1 kind: StatefulSet @@ -292,6 +639,25 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + - + name: CLUSTER_NAME + value: remote-config-example-cluster + - + name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - + name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - + name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(POD_NAME) + - + name: GCLOUD_RW_API_KEY + value: my-remote-cfg-password ports: - containerPort: 12345 name: http-metrics diff --git a/charts/k8s-monitoring/docs/examples/remote-config/values.yaml b/charts/k8s-monitoring/docs/examples/remote-config/values.yaml index 2b56be0b0..aaa5e5966 100644 --- a/charts/k8s-monitoring/docs/examples/remote-config/values.yaml +++ b/charts/k8s-monitoring/docs/examples/remote-config/values.yaml @@ -4,12 +4,54 @@ cluster: alloy-metrics: enabled: true + remoteConfig: + enabled: true + url: https://remote-config.example.com/alloy + auth: + type: basic + username: my-remote-cfg-user + passwordFrom: sys.env("GCLOUD_RW_API_KEY") alloy: stabilityLevel: public-preview + extraEnv: + - name: CLUSTER_NAME + value: remote-config-example-cluster + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(POD_NAME) + - name: GCLOUD_RW_API_KEY + value: my-remote-cfg-password + +alloy-logs: + enabled: true remoteConfig: enabled: true url: "https://remote-config.example.com/alloy" auth: - type: "basic" + type: basic username: "my-remote-cfg-user" - password: "my-remote-cfg-password" + passwordFrom: sys.env("GCLOUD_RW_API_KEY") + alloy: + stabilityLevel: public-preview + extraEnv: + - name: CLUSTER_NAME + value: remote-config-example-cluster + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(NODE_NAME) + - name: GCLOUD_RW_API_KEY + value: "my-remote-cfg-password" diff --git a/charts/k8s-monitoring/templates/collectors/_collector_remoteConfig.tpl b/charts/k8s-monitoring/templates/collectors/_collector_remoteConfig.tpl index fbf38dfa4..9838ee076 100644 --- a/charts/k8s-monitoring/templates/collectors/_collector_remoteConfig.tpl +++ b/charts/k8s-monitoring/templates/collectors/_collector_remoteConfig.tpl @@ -6,22 +6,22 @@ {{- include "secret.alloy" (deepCopy $ | merge (dict "object" .)) | nindent 0 }} {{- end }} remotecfg { + id = sys.env("GCLOUD_FM_COLLECTOR_ID") url = {{ .url | quote }} {{- if eq (include "secrets.authType" .) "basic" }} basic_auth { username = {{ include "secrets.read" (dict "object" . "key" "auth.username" "nonsensitive" true) }} password = {{ include "secrets.read" (dict "object" . "key" "auth.password") }} } -{{- end -}} -{{- if .id }} - id = {{ .id | quote }} -{{- else }} - id = "{{ $.Values.cluster.name }}-{{ $.Release.Namespace }}-" + constants.hostname {{- end }} poll_frequency = {{ .pollFrequency | quote }} attributes = { - "cluster" = {{ $.Values.cluster.name | quote }}, "platform" = "kubernetes", + "source" = "{{ $.Chart.Name }}", + "sourceVersion" = "{{ $.Chart.Version }}", + "release" = "{{ $.Release.Name }}", + "cluster" = {{ $.Values.cluster.name | quote }}, + "namespace" = {{ $.Release.Namespace | quote }}, "workloadType" = {{ (index $.Values $.collectorName).controller.type | quote }}, {{- range $key, $value := .extraAttributes }} {{ $key | quote }} = {{ $value | quote }}, @@ -32,6 +32,49 @@ remotecfg { {{- end -}} {{- end -}} +{{- define "collectors.validate.remoteConfig" }} +{{- if (index .Values .collectorName).enabled }} + {{- if (index .Values .collectorName).remoteConfig.enabled }} + {{- if not (has (index .Values .collectorName).alloy.stabilityLevel (list "public-preview" "experimental")) }} + {{- $msg := list "" "The remote configuration feature requires Alloy to use the \"public-preview\" stability level. Please set:" }} + {{- $msg = append $msg (printf "%s:" .collectorName ) }} + {{- $msg = append $msg " alloy:" }} + {{- $msg = append $msg " stabilityLevel: public-preview" }} + {{- fail (join "\n" $msg) }} + {{- end }} + {{- $hasCollectorIdEnv := false }} + {{- $hasAPIKey := false }} + {{- range $env := (index .Values .collectorName).alloy.extraEnv }} + {{- if eq $env.name "GCLOUD_FM_COLLECTOR_ID" }}{{ $hasCollectorIdEnv = true }}{{- end }} + {{- if eq $env.name "GCLOUD_RW_API_KEY" }}{{ $hasAPIKey = true }}{{- end }} + {{- end }} + {{- if not $hasCollectorIdEnv }} + {{- $msg := list "" "The remote configuration feature requires the environment variable GCLOUD_FM_COLLECTOR_ID to be set. Please set:" }} + {{- $msg = append $msg (printf "%s:" .collectorName ) }} + {{- $msg = append $msg " alloy:" }} + {{- $msg = append $msg " extraEnv:" }} + {{- $msg = append $msg " - name: GCLOUD_FM_COLLECTOR_ID" }} + {{- $msg = append $msg " value: " }} + {{- fail (join "\n" $msg) }} + {{- end }} + {{- if not $hasAPIKey }} + {{- $msg := list "" "The remote configuration feature requires the environment variable GCLOUD_RW_API_KEY to be set. Please set:" }} + {{- $msg = append $msg (printf "%s:" .collectorName ) }} + {{- $msg = append $msg " alloy:" }} + {{- $msg = append $msg " extraEnv:" }} + {{- $msg = append $msg " - name: GCLOUD_RW_API_KEY" }} + {{- $msg = append $msg " value: " }} + {{- $msg = append $msg " key: " }} + {{- fail (join "\n" $msg) }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} + {{- define "secrets.list.remoteConfig" -}} - auth.username - auth.password diff --git a/charts/k8s-monitoring/templates/collectors/_collector_validations.tpl b/charts/k8s-monitoring/templates/collectors/_collector_validations.tpl index 737e72df6..e66c975ab 100644 --- a/charts/k8s-monitoring/templates/collectors/_collector_validations.tpl +++ b/charts/k8s-monitoring/templates/collectors/_collector_validations.tpl @@ -32,18 +32,3 @@ {{- end }} {{- end }} {{- end }} - -{{- define "collectors.validate.remoteConfig" }} -{{- if (index .Values .collectorName).enabled }} - {{- if (index .Values .collectorName).remoteConfig.enabled }} - {{- if not (has (index .Values .collectorName).alloy.stabilityLevel (list "public-preview" "experimental")) }} - {{- $msg := list "" "The remote configuratino feature requires Alloy to use the \"public-preview\" stability level. Please set:" }} - {{- $msg = append $msg (printf "%s:" .collectorName ) }} - {{- $msg = append $msg " alloy:" }} - {{- $msg = append $msg " stabilityLevel: public-preview" }} - {{- fail (join "\n" $msg) }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} - diff --git a/charts/k8s-monitoring/tests/platform/remote-config/.rendered/output.yaml b/charts/k8s-monitoring/tests/platform/remote-config/.rendered/output.yaml index d0236132b..2f01e54cb 100644 --- a/charts/k8s-monitoring/tests/platform/remote-config/.rendered/output.yaml +++ b/charts/k8s-monitoring/tests/platform/remote-config/.rendered/output.yaml @@ -1,4 +1,20 @@ --- +# Source: k8s-monitoring/charts/alloy-logs/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: k8smon-alloy-logs + namespace: default + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy + app.kubernetes.io/component: rbac +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount @@ -26,21 +42,165 @@ data: + remote.kubernetes.secret "alloy_metrics_remote_cfg" { + name = "grafana-cloud-credentials" + namespace = "default" + } + remotecfg { + id = sys.env("GCLOUD_FM_COLLECTOR_ID") url = "https://fleet-management-prod-008.grafana.net" basic_auth { - username = env("GRAFANA_CLOUD_FLEET_MGMT_USER") - password = env("GRAFANA_CLOUD_FLEET_MGMT_TOKEN") + username = nonsensitive(remote.kubernetes.secret.alloy_metrics_remote_cfg.data["GRAFANA_CLOUD_FLEET_MGMT_USER"]) + password = remote.kubernetes.secret.alloy_metrics_remote_cfg.data["GRAFANA_CLOUD_FLEET_MGMT_TOKEN"] } - id = "remote-config-test-default-" + constants.hostname poll_frequency = "5m" attributes = { - "cluster" = "remote-config-test", "platform" = "kubernetes", + "source" = "k8s-monitoring", + "sourceVersion" = "2.0.4", + "release" = "k8smon", + "cluster" = "remote-config-test", + "namespace" = "default", "workloadType" = "statefulset", } } --- +# Source: k8s-monitoring/templates/alloy-config.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: k8smon-alloy-logs + namespace: default +data: + config.alloy: |- + + + + remote.kubernetes.secret "alloy_logs_remote_cfg" { + name = "grafana-cloud-credentials" + namespace = "default" + } + + remotecfg { + id = sys.env("GCLOUD_FM_COLLECTOR_ID") + url = "https://fleet-management-prod-008.grafana.net" + basic_auth { + username = nonsensitive(remote.kubernetes.secret.alloy_logs_remote_cfg.data["GRAFANA_CLOUD_FLEET_MGMT_USER"]) + password = remote.kubernetes.secret.alloy_logs_remote_cfg.data["GRAFANA_CLOUD_FLEET_MGMT_TOKEN"] + } + poll_frequency = "5m" + attributes = { + "platform" = "kubernetes", + "source" = "k8s-monitoring", + "sourceVersion" = "2.0.4", + "release" = "k8smon", + "cluster" = "remote-config-test", + "namespace" = "default", + "workloadType" = "daemonset", + } + } +--- +# Source: k8s-monitoring/charts/alloy-logs/templates/rbac.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: k8smon-alloy-logs + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy + app.kubernetes.io/component: rbac +rules: + # Rules which allow discovery.kubernetes to function. + - apiGroups: + - "" + - "discovery.k8s.io" + - "networking.k8s.io" + resources: + - endpoints + - endpointslices + - ingresses + - nodes + - nodes/proxy + - nodes/metrics + - 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 + # needed for remote.kubernetes.* + - apiGroups: [""] + resources: + - "configmaps" + - "secrets" + verbs: + - get + - list + - watch + # needed for otelcol.processor.k8sattributes + - apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["get", "list", "watch"] + - apiGroups: ["extensions"] + resources: ["replicasets"] + verbs: ["get", "list", "watch"] +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/rbac.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -141,6 +301,29 @@ rules: resources: ["replicasets"] verbs: ["get", "list", "watch"] --- +# Source: k8s-monitoring/charts/alloy-logs/templates/rbac.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: k8smon-alloy-logs + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy + app.kubernetes.io/component: rbac +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: k8smon-alloy-logs +subjects: + - kind: ServiceAccount + name: k8smon-alloy-logs + namespace: default +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/rbac.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -164,6 +347,32 @@ subjects: name: k8smon-alloy-metrics namespace: default --- +# Source: k8s-monitoring/charts/alloy-logs/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: k8smon-alloy-logs + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy + app.kubernetes.io/component: networking +spec: + type: ClusterIP + selector: + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + internalTrafficPolicy: Cluster + ports: + - name: http-metrics + port: 12345 + targetPort: 12345 + protocol: "TCP" +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/cluster_service.yaml apiVersion: v1 kind: Service @@ -223,6 +432,145 @@ spec: targetPort: 12345 protocol: "TCP" --- +# Source: k8s-monitoring/charts/alloy-logs/templates/controllers/daemonset.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: k8smon-alloy-logs + labels: + helm.sh/chart: alloy-logs-0.11.0 + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + + app.kubernetes.io/version: "v1.6.1" + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: alloy +spec: + minReadySeconds: 10 + selector: + matchLabels: + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: alloy + k8s.grafana.com/logs.job: integrations/alloy + labels: + app.kubernetes.io/name: alloy-logs + app.kubernetes.io/instance: k8smon + spec: + serviceAccountName: k8smon-alloy-logs + containers: + - name: alloy + image: docker.io/grafana/alloy:v1.6.1 + imagePullPolicy: IfNotPresent + args: + - run + - /etc/alloy/config.alloy + - --storage.path=/tmp/alloy + - --server.http.listen-addr=0.0.0.0:12345 + - --server.http.ui-path-prefix=/ + - --stability.level=public-preview + env: + - name: ALLOY_DEPLOY_MODE + value: "helm" + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - + name: CLUSTER_NAME + valueFrom: + configMapKeyRef: + key: CLUSTER + name: test-variables + - + name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - + name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - + name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(NODE_NAME) + - + name: GCLOUD_RW_API_KEY + valueFrom: + secretKeyRef: + key: GRAFANA_CLOUD_FLEET_MGMT_TOKEN + name: grafana-cloud-credentials + ports: + - containerPort: 12345 + name: http-metrics + readinessProbe: + httpGet: + path: /-/ready + port: 12345 + scheme: HTTP + initialDelaySeconds: 10 + timeoutSeconds: 1 + securityContext: + allowPrivilegeEscalation: false + capabilities: + add: + - CHOWN + - DAC_OVERRIDE + - FOWNER + - FSETID + - KILL + - SETGID + - SETUID + - SETPCAP + - NET_BIND_SERVICE + - NET_RAW + - SYS_CHROOT + - MKNOD + - AUDIT_WRITE + - SETFCAP + drop: + - ALL + seccompProfile: + type: RuntimeDefault + volumeMounts: + - name: config + mountPath: /etc/alloy + - name: varlog + mountPath: /var/log + readOnly: true + - name: dockercontainers + mountPath: /var/lib/docker/containers + readOnly: true + - name: config-reloader + image: ghcr.io/jimmidyson/configmap-reload:v0.14.0 + args: + - --volume-dir=/etc/alloy + - --webhook-url=http://localhost:12345/-/reload + volumeMounts: + - name: config + mountPath: /etc/alloy + resources: + requests: + cpu: 1m + memory: 5Mi + dnsPolicy: ClusterFirst + nodeSelector: + kubernetes.io/os: linux + volumes: + - name: config + configMap: + name: k8smon-alloy-logs + - name: varlog + hostPath: + path: /var/log + - name: dockercontainers + hostPath: + path: /var/lib/docker/containers +--- # Source: k8s-monitoring/charts/alloy-metrics/templates/controllers/statefulset.yaml apiVersion: apps/v1 kind: StatefulSet @@ -276,11 +624,31 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName - envFrom: - - secretRef: - name: grafana-cloud-credentials - - configMapRef: - name: test-variables + - + name: CLUSTER_NAME + valueFrom: + configMapKeyRef: + key: CLUSTER + name: test-variables + - + name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - + name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - + name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(POD_NAME) + - + name: GCLOUD_RW_API_KEY + valueFrom: + secretKeyRef: + key: GRAFANA_CLOUD_FLEET_MGMT_TOKEN + name: grafana-cloud-credentials ports: - containerPort: 12345 name: http-metrics @@ -338,3 +706,4 @@ spec: --- # Source: k8s-monitoring/templates/remote_config_secret.yaml # create: false +# create: false diff --git a/charts/k8s-monitoring/tests/platform/remote-config/deployments/query-test.yaml b/charts/k8s-monitoring/tests/platform/remote-config/deployments/query-test.yaml index 9a1292d6b..e48ea74f7 100644 --- a/charts/k8s-monitoring/tests/platform/remote-config/deployments/query-test.yaml +++ b/charts/k8s-monitoring/tests/platform/remote-config/deployments/query-test.yaml @@ -33,11 +33,15 @@ spec: - secretRef: {name: grafana-cloud-credentials} - configMapRef: {name: test-variables} queries: - - query: alloy_build_info{cluster="$CLUSTER"} + # Statefulset Metric + - query: alloy_build_info{collector_id="$CLUSTER-default-k8smon-alloy-metrics-0"} + type: promql + # Daemonset Metric + - query: alloy_build_info{collector_id="$CLUSTER-default-$CLUSTER-control-plane"} type: promql # DPM check - - query: avg(count_over_time(scrape_samples_scraped{cluster="$CLUSTER"}[1m])) + - query: avg(count_over_time(scrape_samples_scraped{collector_id=~"$CLUSTER.*"}[1m])) type: promql expect: value: 1 diff --git a/charts/k8s-monitoring/tests/platform/remote-config/values.yaml b/charts/k8s-monitoring/tests/platform/remote-config/values.yaml index 842005f2d..528fda9a7 100644 --- a/charts/k8s-monitoring/tests/platform/remote-config/values.yaml +++ b/charts/k8s-monitoring/tests/platform/remote-config/values.yaml @@ -9,12 +9,68 @@ alloy-metrics: url: https://fleet-management-prod-008.grafana.net auth: type: basic - usernameFrom: env("GRAFANA_CLOUD_FLEET_MGMT_USER") - passwordFrom: env("GRAFANA_CLOUD_FLEET_MGMT_TOKEN") + usernameKey: GRAFANA_CLOUD_FLEET_MGMT_USER + passwordKey: GRAFANA_CLOUD_FLEET_MGMT_TOKEN + secret: + create: false + name: grafana-cloud-credentials alloy: stabilityLevel: public-preview - envFrom: - - secretRef: - name: grafana-cloud-credentials - - configMapRef: - name: test-variables + extraEnv: + - name: CLUSTER_NAME + valueFrom: + configMapKeyRef: + name: test-variables + key: CLUSTER + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(POD_NAME) + - name: GCLOUD_RW_API_KEY + valueFrom: + secretKeyRef: + name: grafana-cloud-credentials + key: GRAFANA_CLOUD_FLEET_MGMT_TOKEN + +alloy-logs: + enabled: true + remoteConfig: + enabled: true + url: https://fleet-management-prod-008.grafana.net + auth: + type: basic + usernameKey: GRAFANA_CLOUD_FLEET_MGMT_USER + passwordKey: GRAFANA_CLOUD_FLEET_MGMT_TOKEN + secret: + create: false + name: grafana-cloud-credentials + alloy: + stabilityLevel: public-preview + extraEnv: + - name: CLUSTER_NAME + valueFrom: + configMapKeyRef: + name: test-variables + key: CLUSTER + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: GCLOUD_FM_COLLECTOR_ID + value: $(CLUSTER_NAME)-$(NAMESPACE)-$(NODE_NAME) + - name: GCLOUD_RW_API_KEY + valueFrom: + secretKeyRef: + name: grafana-cloud-credentials + key: GRAFANA_CLOUD_FLEET_MGMT_TOKEN + diff --git a/charts/k8s-monitoring/values.schema.json b/charts/k8s-monitoring/values.schema.json index f29ade4c5..f92458109 100644 --- a/charts/k8s-monitoring/values.schema.json +++ b/charts/k8s-monitoring/values.schema.json @@ -159,6 +159,12 @@ "enabled": { "type": "boolean" }, + "extraAttributes": { + "type": "object" + }, + "pollFrequency": { + "type": "string" + }, "secret": { "type": "object", "properties": { @@ -343,9 +349,6 @@ "extraAttributes": { "type": "object" }, - "id": { - "type": "string" - }, "pollFrequency": { "type": "string" }, @@ -523,6 +526,12 @@ "enabled": { "type": "boolean" }, + "extraAttributes": { + "type": "object" + }, + "pollFrequency": { + "type": "string" + }, "secret": { "type": "object", "properties": { @@ -688,6 +697,12 @@ "enabled": { "type": "boolean" }, + "extraAttributes": { + "type": "object" + }, + "pollFrequency": { + "type": "string" + }, "secret": { "type": "object", "properties": { @@ -853,6 +868,12 @@ "enabled": { "type": "boolean" }, + "extraAttributes": { + "type": "object" + }, + "pollFrequency": { + "type": "string" + }, "secret": { "type": "object", "properties": { diff --git a/charts/k8s-monitoring/values.yaml b/charts/k8s-monitoring/values.yaml index 8e64759b0..59c3b47a1 100644 --- a/charts/k8s-monitoring/values.yaml +++ b/charts/k8s-monitoring/values.yaml @@ -332,11 +332,6 @@ alloy-metrics: # @section -- Collectors - Alloy Metrics namespace: "" - # -- (string) The unique identifier for this Alloy instance. - # @default -- `--` - # @section -- Collectors - Alloy Metrics - id: "" - # -- The frequency at which to poll the remote config server for updates. # @section -- Collectors - Alloy Metrics pollFrequency: 5m @@ -463,6 +458,14 @@ alloy-singleton: # @section -- Collectors - Alloy Singleton namespace: "" + # -- The frequency at which to poll the remote config server for updates. + # @section -- Collectors - Alloy Singleton + pollFrequency: 5m + + # -- Attributes to be added to this collector when requesting configuration. + # @section -- Collectors - Alloy Singleton + extraAttributes: {} + logging: # -- Level at which Alloy log lines should be written. # @section -- Collectors - Alloy Singleton @@ -576,6 +579,14 @@ alloy-logs: # @section -- Collectors - Alloy Logs namespace: "" + # -- The frequency at which to poll the remote config server for updates. + # @section -- Collectors - Alloy Logs + pollFrequency: 5m + + # -- Attributes to be added to this collector when requesting configuration. + # @section -- Collectors - Alloy Logs + extraAttributes: {} + logging: # -- Level at which Alloy log lines should be written. # @section -- Collectors - Alloy Logs @@ -697,6 +708,14 @@ alloy-receiver: # @section -- Collectors - Alloy Receiver namespace: "" + # -- The frequency at which to poll the remote config server for updates. + # @section -- Collectors - Alloy Receiver + pollFrequency: 5m + + # -- Attributes to be added to this collector when requesting configuration. + # @section -- Collectors - Alloy Receiver + extraAttributes: {} + logging: # -- Level at which Alloy log lines should be written. # @section -- Collectors - Alloy Receiver @@ -811,6 +830,14 @@ alloy-profiles: # @section -- Collectors - Alloy Profiles namespace: "" + # -- The frequency at which to poll the remote config server for updates. + # @section -- Collectors - Alloy Profiles + pollFrequency: 5m + + # -- Attributes to be added to this collector when requesting configuration. + # @section -- Collectors - Alloy Profiles + extraAttributes: {} + logging: # -- Level at which Alloy log lines should be written. # @section -- Collectors - Alloy Profiles