From a1e6d6b763788a14f52de9c5e9aeff91623d0cda Mon Sep 17 00:00:00 2001 From: Pete Wall Date: Tue, 22 Oct 2024 23:05:46 +0200 Subject: [PATCH] Finish adding remote config to the other collectors Signed-off-by: Pete Wall --- charts/k8s-monitoring/README.md | 68 ++++++ .../k8s-monitoring/templates/_validations.tpl | 4 +- charts/k8s-monitoring/values.schema.json | 216 ++++++++++++++++++ charts/k8s-monitoring/values.yaml | 208 +++++++++++++++++ 4 files changed, 494 insertions(+), 2 deletions(-) diff --git a/charts/k8s-monitoring/README.md b/charts/k8s-monitoring/README.md index d7779b2e9..59f1dee3c 100644 --- a/charts/k8s-monitoring/README.md +++ b/charts/k8s-monitoring/README.md @@ -151,6 +151,19 @@ podLogs: | alloy-logs.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". | | alloy-logs.logging.format | string | `"logfmt"` | Format to use for writing Alloy log lines. | | alloy-logs.logging.level | string | `"info"` | Level at which Alloy log lines should be written. | +| alloy-logs.remoteConfig.auth.password | string | `""` | The password to use for the remote config server. | +| alloy-logs.remoteConfig.auth.passwordFrom | string | `""` | Raw config for accessing the password. | +| alloy-logs.remoteConfig.auth.passwordKey | string | `"password"` | The key for storing the username in the secret. | +| alloy-logs.remoteConfig.auth.type | string | `"none"` | The type of authentication to use for the remote config server. | +| alloy-logs.remoteConfig.auth.username | string | `""` | The username to use for the remote config server. | +| 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.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. | +| alloy-logs.remoteConfig.secret.namespace | string | `""` | The namespace for the secret. | +| alloy-logs.remoteConfig.url | string | `""` | The URL of the remote config server. | ### Collectors - Alloy Metrics @@ -163,6 +176,22 @@ podLogs: | alloy-metrics.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". | | alloy-metrics.logging.format | string | `"logfmt"` | Format to use for writing Alloy log lines. | | alloy-metrics.logging.level | string | `"info"` | Level at which Alloy log lines should be written. | +| alloy-metrics.remoteConfig.auth.password | string | `""` | The password to use for the remote config server. | +| alloy-metrics.remoteConfig.auth.passwordFrom | string | `""` | Raw config for accessing the password. | +| alloy-metrics.remoteConfig.auth.passwordKey | string | `"password"` | The key for storing the password in the secret. | +| alloy-metrics.remoteConfig.auth.type | string | `"none"` | The type of authentication to use for the remote config server. | +| alloy-metrics.remoteConfig.auth.username | string | `""` | The username to use for the remote config server. | +| alloy-metrics.remoteConfig.auth.usernameFrom | string | `""` | Raw config for accessing the password. | +| 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. | +| alloy-metrics.remoteConfig.secret.name | string | `""` | The name of the secret to create. | +| alloy-metrics.remoteConfig.secret.namespace | string | `""` | The namespace for the secret. | +| alloy-metrics.remoteConfig.url | string | `""` | The URL of the remote config server. | ### Collectors - Alloy Profiles @@ -174,6 +203,19 @@ podLogs: | alloy-profiles.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". | | alloy-profiles.logging.format | string | `"logfmt"` | Format to use for writing Alloy log lines. | | alloy-profiles.logging.level | string | `"info"` | Level at which Alloy log lines should be written. | +| alloy-profiles.remoteConfig.auth.password | string | `""` | The password to use for the remote config server. | +| alloy-profiles.remoteConfig.auth.passwordFrom | string | `""` | Raw config for accessing the password. | +| alloy-profiles.remoteConfig.auth.passwordKey | string | `"password"` | The key for storing the password in the secret. | +| alloy-profiles.remoteConfig.auth.type | string | `"none"` | The type of authentication to use for the remote config server. | +| alloy-profiles.remoteConfig.auth.username | string | `""` | The username to use for the remote config server. | +| 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.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. | +| alloy-profiles.remoteConfig.secret.namespace | string | `""` | The namespace for the secret. | +| alloy-profiles.remoteConfig.url | string | `""` | The URL of the remote config server. | ### Collectors - Alloy Receiver @@ -186,6 +228,19 @@ podLogs: | alloy-receiver.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". | | alloy-receiver.logging.format | string | `"logfmt"` | Format to use for writing Alloy log lines. | | alloy-receiver.logging.level | string | `"info"` | Level at which Alloy log lines should be written. | +| alloy-receiver.remoteConfig.auth.password | string | `""` | The password to use for the remote config server. | +| alloy-receiver.remoteConfig.auth.passwordFrom | string | `""` | Raw config for accessing the password. | +| alloy-receiver.remoteConfig.auth.passwordKey | string | `"password"` | The key for storing the password in the secret. | +| alloy-receiver.remoteConfig.auth.type | string | `"none"` | The type of authentication to use for the remote config server. | +| alloy-receiver.remoteConfig.auth.username | string | `""` | The username to use for the remote config server. | +| 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.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. | +| alloy-receiver.remoteConfig.secret.namespace | string | `""` | The namespace for the secret. | +| alloy-receiver.remoteConfig.url | string | `""` | The URL of the remote config server. | ### Collectors - Alloy Singleton @@ -198,6 +253,19 @@ podLogs: | alloy-singleton.liveDebugging.enabled | bool | `false` | Enable live debugging for the Alloy instance. Requires stability level to be set to "experimental". | | alloy-singleton.logging.format | string | `"logfmt"` | Format to use for writing Alloy log lines. | | alloy-singleton.logging.level | string | `"info"` | Level at which Alloy log lines should be written. | +| alloy-singleton.remoteConfig.auth.password | string | `""` | The password to use for the remote config server. | +| alloy-singleton.remoteConfig.auth.passwordFrom | string | `""` | Raw config for accessing the password. | +| alloy-singleton.remoteConfig.auth.passwordKey | string | `"password"` | The key for storing the password in the secret. | +| alloy-singleton.remoteConfig.auth.type | string | `"none"` | The type of authentication to use for the remote config server. | +| alloy-singleton.remoteConfig.auth.username | string | `""` | The username to use for the remote config server. | +| 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.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. | +| alloy-singleton.remoteConfig.secret.namespace | string | `""` | The namespace for the secret. | +| alloy-singleton.remoteConfig.url | string | `""` | The URL of the remote config server. | ### Features - Annotation Autodiscovery diff --git a/charts/k8s-monitoring/templates/_validations.tpl b/charts/k8s-monitoring/templates/_validations.tpl index 80f4eacc2..86a260d04 100644 --- a/charts/k8s-monitoring/templates/_validations.tpl +++ b/charts/k8s-monitoring/templates/_validations.tpl @@ -16,8 +16,8 @@ {{- $aFeatureIsEnabled = or $aFeatureIsEnabled (eq (include (printf "features.%s.enabled" $feature) (dict "Values" $.Values)) "true") }} {{- end }} {{- range $collector := ((include "collectors.list" .) | fromYamlArray ) }} - {{- $aFeatureIsEnabled = or $aFeatureIsEnabled (and (index $.Values $collector).remoteConfig.enabled) }} - {{- $aFeatureIsEnabled = or $aFeatureIsEnabled (and (index $.Values $collector).extraConfig) }} + {{- $aFeatureIsEnabled = or $aFeatureIsEnabled ((index $.Values $collector).remoteConfig.enabled) }} + {{- $aFeatureIsEnabled = or $aFeatureIsEnabled ((index $.Values $collector).extraConfig) }} {{- end }} {{- if not $aFeatureIsEnabled }} {{- $msg := list "" "No features are enabled. Please choose a feature to start monitoring. For example:" }} diff --git a/charts/k8s-monitoring/values.schema.json b/charts/k8s-monitoring/values.schema.json index 1a15cc177..b854a044c 100644 --- a/charts/k8s-monitoring/values.schema.json +++ b/charts/k8s-monitoring/values.schema.json @@ -110,6 +110,60 @@ "type": "string" } } + }, + "remoteConfig": { + "type": "object", + "properties": { + "auth": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "passwordFrom": { + "type": "string" + }, + "passwordKey": { + "type": "string" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + }, + "usernameFrom": { + "type": "string" + }, + "usernameKey": { + "type": "string" + } + } + }, + "enabled": { + "type": "boolean" + }, + "secret": { + "type": "object", + "properties": { + "create": { + "type": "null" + }, + "embed": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + } + } + }, + "url": { + "type": "string" + } + } } } }, @@ -412,6 +466,60 @@ "type": "string" } } + }, + "remoteConfig": { + "type": "object", + "properties": { + "auth": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "passwordFrom": { + "type": "string" + }, + "passwordKey": { + "type": "string" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + }, + "usernameFrom": { + "type": "string" + }, + "usernameKey": { + "type": "string" + } + } + }, + "enabled": { + "type": "boolean" + }, + "secret": { + "type": "object", + "properties": { + "create": { + "type": "null" + }, + "embed": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + } + } + }, + "url": { + "type": "string" + } + } } } }, @@ -507,6 +615,60 @@ "type": "string" } } + }, + "remoteConfig": { + "type": "object", + "properties": { + "auth": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "passwordFrom": { + "type": "string" + }, + "passwordKey": { + "type": "string" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + }, + "usernameFrom": { + "type": "string" + }, + "usernameKey": { + "type": "string" + } + } + }, + "enabled": { + "type": "boolean" + }, + "secret": { + "type": "object", + "properties": { + "create": { + "type": "null" + }, + "embed": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + } + } + }, + "url": { + "type": "string" + } + } } } }, @@ -618,6 +780,60 @@ "type": "string" } } + }, + "remoteConfig": { + "type": "object", + "properties": { + "auth": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "passwordFrom": { + "type": "string" + }, + "passwordKey": { + "type": "string" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + }, + "usernameFrom": { + "type": "string" + }, + "usernameKey": { + "type": "string" + } + } + }, + "enabled": { + "type": "boolean" + }, + "secret": { + "type": "object", + "properties": { + "create": { + "type": "null" + }, + "embed": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + } + } + }, + "url": { + "type": "string" + } + } } } }, diff --git a/charts/k8s-monitoring/values.yaml b/charts/k8s-monitoring/values.yaml index a1cd870d1..b0036b6aa 100644 --- a/charts/k8s-monitoring/values.yaml +++ b/charts/k8s-monitoring/values.yaml @@ -252,13 +252,21 @@ alloy-metrics: # -- The username to use for the remote config server. # @section -- Collectors - Alloy Metrics username: "" + # -- The key for storing the username in the secret. + # @section -- Collectors - Alloy Metrics usernameKey: "username" + # -- Raw config for accessing the password. + # @section -- Collectors - Alloy Metrics usernameFrom: "" # -- The password to use for the remote config server. # @section -- Collectors - Alloy Metrics password: "" + # -- The key for storing the password in the secret. + # @section -- Collectors - Alloy Metrics passwordKey: "password" + # -- Raw config for accessing the password. + # @section -- Collectors - Alloy Metrics passwordFrom: "" secret: @@ -352,6 +360,56 @@ alloy-singleton: # @section -- Collectors - Alloy Singleton extraConfig: "" + # Remote configuration from a remote config server. + remoteConfig: + # -- Enable fetching configuration from a remote config server. + # @section -- Collectors - Alloy Singleton + enabled: false + + # -- The URL of the remote config server. + # @section -- Collectors - Alloy Singleton + url: "" + + auth: + # -- The type of authentication to use for the remote config server. + # @section -- Collectors - Alloy Singleton + type: "none" + + # -- The username to use for the remote config server. + # @section -- Collectors - Alloy Singleton + username: "" + # -- The key for storing the username in the secret. + # @section -- Collectors - Alloy Singleton + usernameKey: "username" + # -- Raw config for accessing the username. + # @section -- Collectors - Alloy Singleton + usernameFrom: "" + + # -- The password to use for the remote config server. + # @section -- Collectors - Alloy Singleton + password: "" + # -- The key for storing the password in the secret. + # @section -- Collectors - Alloy Singleton + passwordKey: "password" + # -- Raw config for accessing the password. + # @section -- Collectors - Alloy Singleton + passwordFrom: "" + + secret: + # -- (bool) Whether to create a secret for the remote config server. + # @default -- `true` + # @section -- Collectors - Alloy Singleton + create: + # -- If true, skip secret creation and embed the credentials directly into the configuration. + # @section -- Collectors - Alloy Singleton + embed: false + # -- The name of the secret to create. + # @section -- Collectors - Alloy Singleton + name: "" + # -- The namespace for the secret. + # @section -- Collectors - Alloy Singleton + namespace: "" + logging: # -- Level at which Alloy log lines should be written. # @section -- Collectors - Alloy Singleton @@ -410,6 +468,56 @@ alloy-logs: # @section -- Collectors - Alloy Logs extraConfig: "" + # Remote configuration from a remote config server. + remoteConfig: + # -- Enable fetching configuration from a remote config server. + # @section -- Collectors - Alloy Logs + enabled: false + + # -- The URL of the remote config server. + # @section -- Collectors - Alloy Logs + url: "" + + auth: + # -- The type of authentication to use for the remote config server. + # @section -- Collectors - Alloy Logs + type: "none" + + # -- The username to use for the remote config server. + # @section -- Collectors - Alloy Logs + username: "" + # -- The key for storing the username in the secret. + # @section -- Collectors - Alloy Logs + usernameKey: "username" + # -- Raw config for accessing the username. + # @section -- Collectors - Alloy Logs + usernameFrom: "" + + # -- The password to use for the remote config server. + # @section -- Collectors - Alloy Logs + password: "" + # -- The key for storing the username in the secret. + # @section -- Collectors - Alloy Logs + passwordKey: "password" + # -- Raw config for accessing the password. + # @section -- Collectors - Alloy Logs + passwordFrom: "" + + secret: + # -- (bool) Whether to create a secret for the remote config server. + # @default -- `true` + # @section -- Collectors - Alloy Logs + create: + # -- If true, skip secret creation and embed the credentials directly into the configuration. + # @section -- Collectors - Alloy Logs + embed: false + # -- The name of the secret to create. + # @section -- Collectors - Alloy Logs + name: "" + # -- The namespace for the secret. + # @section -- Collectors - Alloy Logs + namespace: "" + logging: # -- Level at which Alloy log lines should be written. # @section -- Collectors - Alloy Logs @@ -468,6 +576,56 @@ alloy-receiver: # @section -- Collectors - Alloy Receiver extraConfig: "" + # Remote configuration from a remote config server. + remoteConfig: + # -- Enable fetching configuration from a remote config server. + # @section -- Collectors - Alloy Receiver + enabled: false + + # -- The URL of the remote config server. + # @section -- Collectors - Alloy Receiver + url: "" + + auth: + # -- The type of authentication to use for the remote config server. + # @section -- Collectors - Alloy Receiver + type: "none" + + # -- The username to use for the remote config server. + # @section -- Collectors - Alloy Receiver + username: "" + # -- The key for storing the username in the secret. + # @section -- Collectors - Alloy Receiver + usernameKey: "username" + # -- Raw config for accessing the username. + # @section -- Collectors - Alloy Receiver + usernameFrom: "" + + # -- The password to use for the remote config server. + # @section -- Collectors - Alloy Receiver + password: "" + # -- The key for storing the password in the secret. + # @section -- Collectors - Alloy Receiver + passwordKey: "password" + # -- Raw config for accessing the password. + # @section -- Collectors - Alloy Receiver + passwordFrom: "" + + secret: + # -- (bool) Whether to create a secret for the remote config server. + # @default -- `true` + # @section -- Collectors - Alloy Receiver + create: + # -- If true, skip secret creation and embed the credentials directly into the configuration. + # @section -- Collectors - Alloy Receiver + embed: false + # -- The name of the secret to create. + # @section -- Collectors - Alloy Receiver + name: "" + # -- The namespace for the secret. + # @section -- Collectors - Alloy Receiver + namespace: "" + logging: # -- Level at which Alloy log lines should be written. # @section -- Collectors - Alloy Receiver @@ -519,6 +677,56 @@ alloy-profiles: # @section -- Collectors - Alloy Profiles extraConfig: "" + # Remote configuration from a remote config server. + remoteConfig: + # -- Enable fetching configuration from a remote config server. + # @section -- Collectors - Alloy Profiles + enabled: false + + # -- The URL of the remote config server. + # @section -- Collectors - Alloy Profiles + url: "" + + auth: + # -- The type of authentication to use for the remote config server. + # @section -- Collectors - Alloy Profiles + type: "none" + + # -- The username to use for the remote config server. + # @section -- Collectors - Alloy Profiles + username: "" + # -- The key for storing the username in the secret. + # @section -- Collectors - Alloy Profiles + usernameKey: "username" + # -- Raw config for accessing the username. + # @section -- Collectors - Alloy Profiles + usernameFrom: "" + + # -- The password to use for the remote config server. + # @section -- Collectors - Alloy Profiles + password: "" + # -- The key for storing the password in the secret. + # @section -- Collectors - Alloy Profiles + passwordKey: "password" + # -- Raw config for accessing the password. + # @section -- Collectors - Alloy Profiles + passwordFrom: "" + + secret: + # -- (bool) Whether to create a secret for the remote config server. + # @default -- `true` + # @section -- Collectors - Alloy Profiles + create: + # -- If true, skip secret creation and embed the credentials directly into the configuration. + # @section -- Collectors - Alloy Profiles + embed: false + # -- The name of the secret to create. + # @section -- Collectors - Alloy Profiles + name: "" + # -- The namespace for the secret. + # @section -- Collectors - Alloy Profiles + namespace: "" + logging: # -- Level at which Alloy log lines should be written. # @section -- Collectors - Alloy Profiles