Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
influxdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
influxdb
Commits
e7d499c3
Unverified
Commit
e7d499c3
authored
Aug 17, 2023
by
Josh Powers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
telegraf: add secret store support
parent
65564b14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
0 deletions
+134
-0
secretstores.yaml
charts/telegraf/ci/secretstores.yaml
+16
-0
_helpers.tpl
charts/telegraf/templates/_helpers.tpl
+118
-0
No files found.
charts/telegraf/ci/secretstores.yaml
0 → 100644
View file @
e7d499c3
config
:
secretstores
:
-
http
:
id
:
mystore
url
:
'
http://localhost/secrets'
-
oauth2
:
id
:
azure_ad
service
:
azureAD
tenant_id
:
3da608ee-a0cc-47ec-906a-fe202bd77f8d
token_expiry_margin
:
10s
token
:
-
key
:
my_token
client_id
:
my_id
client_secret
:
my_secret
scopes
:
-
<<CLIENT_ID>>/.default
charts/telegraf/templates/_helpers.tpl
View file @
e7d499c3
...
...
@@ -539,6 +539,116 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- end -}}
{{- define "secretstores.v1" -}}
{{- range $secretstoresIdx, $configObject := . -}}
{{- range $secretstore, $config := . -}}
[[secretstores.{{- $secretstore }}]]
{{- if $config -}}
{{- $tp := typeOf $config -}}
{{- if eq $tp "map[string]interface {}" -}}
{{- range $key, $value := $config -}}
{{- $tp := typeOf $value -}}
{{- if eq $tp "string" }}
{{ $key }} = {{ $value | quote }}
{{- end }}
{{- if eq $tp "float64" }}
{{ $key }} = {{ $value | int64 }}
{{- end }}
{{- if eq $tp "int" }}
{{ $key }} = {{ $value | int64 }}
{{- end }}
{{- if eq $tp "bool" }}
{{ $key }} = {{ $value }}
{{- end }}
{{- if eq $tp "[]interface {}" }}
{{- if eq (index $value 0 | typeOf) "map[string]interface {}" -}}
{{- range $b, $val := $value }}
[[secretstore.{{- $secretstore }}.{{- $key }}]]
{{- range $k, $v := $val }}
{{- $tps := typeOf $v }}
{{- if eq $tps "string" }}
{{ $k }} = {{ $v | quote }}
{{- end }}
{{- if eq $tps "float64" }}
{{ $k }} = {{ $v | int64 }}
{{- end }}
{{- if eq $tps "bool" }}
{{ $k }} = {{ $v }}
{{- end }}
{{- end }}
{{- end }}
{{- else }}
{{ $key }} = [
{{- $numOut := len $value }}
{{- $numOut := sub $numOut 1 }}
{{- range $b, $val := $value }}
{{- $i := int64 $b }}
{{- $tp := typeOf $val }}
{{- if eq $tp "string" }}
{{ $val | quote }}
{{- end }}
{{- if eq $tp "float64" }}
{{- if eq $key "percentiles" }}
{{- $xval := float64 (int64 $val) }}
{{- if eq $val $xval }}
{{ $val | int64 }}.0
{{- else }}
{{ $val | float64 }}
{{- end }}
{{- else }}
{{ $val | int64 }}
{{- end }}
{{- end }}
{{- if ne $i $numOut -}}
,
{{- end -}}
{{- end }}
]
{{- end }}
{{- end }}
{{- end }}
{{- range $key, $value := $config -}}
{{- $tp := typeOf $value -}}
{{- if eq $tp "map[string]interface {}" }}
[secretstore.{{ $secretstore }}.{{ $key }}]
{{- range $k, $v := $value }}
{{- $tps := typeOf $v }}
{{- if eq $tps "string" }}
{{ $k }} = {{ $v | quote }}
{{- end }}
{{- if eq $tps "[]interface {}"}}
{{ $k }} = [
{{- $numOut := len $v }}
{{- $numOut := sub $numOut 1 }}
{{- range $b, $val := $v }}
{{- $i := int64 $b }}
{{- if eq $i $numOut }}
{{ $val | quote }}
{{- else }}
{{ $val | quote }},
{{- end }}
{{- end }}
]
{{- end }}
{{- end }}
{{- range $k, $v := $value }}
{{- $tps := typeOf $v }}
{{- if eq $tps "map[string]interface {}"}}
[secretstore.{{ $secretstore }}.{{ $key }}.{{ $k }}]
{{- range $foo, $bar := $v }}
{{ $foo }} = {{ $bar | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{ end }}
{{- end }}
{{- end -}}
{
{
/*
Backward
compatible
version
support
.
*/
}
}
...
...
@@ -559,6 +669,10 @@ Backward compatible version support.
{{- include "section" (prepend . "aggregators") -}}
{{- end -}}
{{- define "secretstores" -}}
{{- include "section" (prepend . "secretstores") -}}
{{- end -}}
{{- define "detect.version" -}}
{{ (default 1 .Values.tplVersion) | int64 }}
{{- end -}}
...
...
@@ -589,6 +703,10 @@ Backward compatible version support.
{{ include "section.v2" (list "outputs" .) }}
{{- end -}}
{{- define "secretstores.v2" -}}
{{ include "section.v2" (list "secretstores" .) }}
{{- end -}}
{{- define "section.v2" -}}
{{- $name := index . 0 -}}
{{- with index . 1 -}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment