-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: start introducing the remotecfg component.
Not working because the secret management templates are tied specifically to destinations Signed-off-by: Pete Wall <pete.wall@grafana.com>
- Loading branch information
Showing
10 changed files
with
197 additions
and
4 deletions.
There are no files selected for viewing
Empty file.
12 changes: 12 additions & 0 deletions
12
charts/k8s-monitoring/docs/examples/remote-config/values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cluster: | ||
Check failure on line 1 in charts/k8s-monitoring/docs/examples/remote-config/values.yaml GitHub Actions / runner / yamllint
|
||
name: remote-config-example-cluster | ||
|
||
alloy-metrics: | ||
enabled: true | ||
remoteConfig: | ||
enabled: true | ||
url: "https://remote-config.example.com/alloy" | ||
auth: | ||
type: "basic" | ||
username: "my-remote-cfg-user" | ||
password: "my-remote-cfg-password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
charts/k8s-monitoring/templates/collectors/_collector_extraConfig.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{{- define "collectors.extraConfig.alloy" -}} | ||
{{- if (index .Values .collectorName).extraConfig }} | ||
{{ (index .Values .collectorName).extraConfig | trim }} | ||
{{- end }} | ||
{{- end -}} |
34 changes: 34 additions & 0 deletions
34
charts/k8s-monitoring/templates/collectors/_collector_remoteConfig.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{{- define "collectors.remoteConfig.alloy" -}} | ||
{{- with (index .Values .collectorName).remoteConfig }} | ||
{{- if .enabled }} | ||
remotecfg { | ||
url = {{ .url | quote }} | ||
{{- if eq .auth.type "basic" }} | ||
basic_auth { | ||
username = {{ include "destinations.secret.read" (dict "destination" . "key" "auth.username" "nonsensitive" true) }} | ||
password = {{ include "destinations.secret.read" (dict "destination" . "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", | ||
"workloadType": {{ (index $.Values $.collectorName).controller.type | quote }}, | ||
{{- range $key, $value := .extraAttributes }} | ||
{{ $key | quote }} = {{ $value | quote }}, | ||
{{- end -}} | ||
} | ||
} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- define "collectors.remoteConfig.secrets" -}} | ||
- auth.username | ||
- auth.password | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters