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
d594cfb7
Commit
d594cfb7
authored
Dec 15, 2019
by
Cees-Jan Kiewiet
Committed by
Kubernetes Prow Robot
Dec 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[stable/telegraf] Add health output and probes (#19607)
Signed-off-by:
Cees-Jan Kiewiet
<
ceesjank@gmail.com
>
parent
40aac55f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
9 deletions
+94
-9
Chart.yaml
stable/telegraf/Chart.yaml
+1
-1
_helpers.tpl
stable/telegraf/templates/_helpers.tpl
+61
-8
deployment.yaml
stable/telegraf/templates/deployment.yaml
+15
-0
service.yaml
stable/telegraf/templates/service.yaml
+10
-0
values.yaml
stable/telegraf/values.yaml
+7
-0
No files found.
stable/telegraf/Chart.yaml
View file @
d594cfb7
apiVersion
:
v1
apiVersion
:
v1
name
:
telegraf
name
:
telegraf
version
:
1.
3
.0
version
:
1.
4
.0
appVersion
:
1.12
appVersion
:
1.12
deprecated
:
false
deprecated
:
false
description
:
Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
description
:
Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
...
...
stable/telegraf/templates/_helpers.tpl
View file @
d594cfb7
...
@@ -67,23 +67,24 @@ Create chart name and version as used by the chart label.
...
@@ -67,23 +67,24 @@ Create chart name and version as used by the chart label.
{{- define "outputs" -}}
{{- define "outputs" -}}
{{- range $outputIdx, $configObject := . -}}
{{- range $outputIdx, $configObject := . -}}
{{- range $output, $config := . }}
{{- range $output, $config := . -}}
[[outputs.{{ $output }}]]
{{- if $config }}
[[outputs.{{- $output }}]]
{{- if $config -}}
{{- $tp := typeOf $config -}}
{{- $tp := typeOf $config -}}
{{- if eq $tp "map[string]interface {}" -}}
{{- if eq $tp "map[string]interface {}" -}}
{{- range $key, $value := $config -}}
{{- range $key, $value := $config -}}
{{- $tp := typeOf $value
}}
{{- $tp := typeOf $value -
}}
{{- if eq $tp "string"
}}
{{- if eq $tp "string"
}}
{{ $key }} = {{ $value | quote }}
{{ $key }} = {{ $value | quote }}
{{- end }}
{{- end }}
{{- if eq $tp "float64"
}}
{{- if eq $tp "float64"
}}
{{ $key }} = {{ $value | int64 }}
{{ $key }} = {{ $value | int64 }}
{{- end }}
{{- end }}
{{- if eq $tp "int"
}}
{{- if eq $tp "int"
}}
{{ $key }} = {{ $value | int64 }}
{{ $key }} = {{ $value | int64 }}
{{- end }}
{{- end }}
{{- if eq $tp "bool"
}}
{{- if eq $tp "bool"
}}
{{ $key }} = {{ $value }}
{{ $key }} = {{ $value }}
{{- end }}
{{- end }}
{{- if eq $tp "[]interface {}" }}
{{- if eq $tp "[]interface {}" }}
...
@@ -92,18 +93,70 @@ Create chart name and version as used by the chart label.
...
@@ -92,18 +93,70 @@ Create chart name and version as used by the chart label.
{{- $numOut := sub $numOut 1 }}
{{- $numOut := sub $numOut 1 }}
{{- range $b, $val := $value }}
{{- range $b, $val := $value }}
{{- $i := int64 $b }}
{{- $i := int64 $b }}
{{- $tp := typeOf $val }}
{{- if eq $i $numOut }}
{{- if eq $i $numOut }}
{{- if eq $tp "string" }}
{{ $val | quote }}
{{ $val | quote }}
{{- end }}
{{- if eq $tp "float64" }}
{{ $val | int64 }}
{{- end }}
{{- else }}
{{- else }}
{{- if eq $tp "string" }}
{{ $val | quote }},
{{ $val | quote }},
{{- end}}
{{- if eq $tp "float64" }}
{{ $val | int64 }},
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
]
]
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- range $key, $value := $config -}}
{{- $tp := typeOf $value -}}
{{- if eq $tp "map[string]interface {}" }}
[[outputs.{{ $output }}.{{ $key }}]]
{{- range $k, $v := $value }}
{{- $tps := typeOf $v }}
{{- if eq $tps "string" }}
{{ $k }} = {{ $v | quote }}
{{- end }}
{{- if eq $tps "float64" }}
{{ $k }} = {{ $v | int64 }}.0
{{- end }}
{{- if eq $tps "int64" }}
{{ $k }} = {{ $v | int64 }}
{{- end }}
{{- if eq $tps "bool" }}
{{ $k }} = {{ $v }}
{{- end }}
{{- if eq $tps "[]interface {}"}}
{{ $k }} = [
{{- $numOut := len $value }}
{{- $numOut := sub $numOut 1 }}
{{- range $b, $val := $v }}
{{- $i := int64 $b }}
{{- if eq $i $numOut }}
{{ $val | quote }}
{{- else }}
{{ $val | quote }},
{{- end }}
{{- end }}
]
{{- end }}
{{- if eq $tps "map[string]interface {}"}}
[[outputs.{{ $output }}.{{ $key }}.{{ $k }}]]
{{- range $foo, $bar := $v }}
{{ $foo }} = {{ $bar | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{ end }}
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
...
...
stable/telegraf/templates/deployment.yaml
View file @
d594cfb7
...
@@ -38,6 +38,21 @@ spec:
...
@@ -38,6 +38,21 @@ spec:
-
name
:
{{
.name
}}
-
name
:
{{
.name
}}
mountPath
:
{{
.mountPath
}}
mountPath
:
{{
.mountPath
}}
{{
- end
}}
{{
- end
}}
{{
- range $objectKey
,
$objectValue
:
= .Values.config.outputs
}}
{{
- range $key
,
$value
:
= . -
}}
{{
- $tp
:
= typeOf $value -
}}
{{
- if eq $key "health"
}}
livenessProbe
:
httpGet
:
path
:
/
port
:
{{
trimPrefix "http
:
//
:
"
$value.service_address
|
int64
}}
readinessProbe:
httpGet:
path:
/
port:
{{
trimPrefix
"
http
:
//
:
"
$value.service_address
|
int64
}}
{{-
end
}}
{{-
end
}}
{{-
end
}}
{{-
if
.Values.imagePullSecrets
}}
{{-
if
.Values.imagePullSecrets
}}
imagePullSecrets:
imagePullSecrets:
{{
toYaml
.Values.imagePullSecrets
|
indent
8
}}
{{
toYaml
.Values.imagePullSecrets
|
indent
8
}}
...
...
stable/telegraf/templates/service.yaml
View file @
d594cfb7
...
@@ -15,6 +15,16 @@ metadata:
...
@@ -15,6 +15,16 @@ metadata:
spec
:
spec
:
type
:
{{
.Values.service.type
}}
type
:
{{
.Values.service.type
}}
ports
:
ports
:
{{
- range $objectKey
,
$objectValue
:
= .Values.config.outputs
}}
{{
- range $key
,
$value
:
= . -
}}
{{
- $tp
:
= typeOf $value -
}}
{{
- if eq $key "health"
}}
-
port
:
{{
trimPrefix "http
:
//
:
"
$value.service_address
|
int64
}}
targetPort:
{{
trimPrefix
"
http
:
//
:
"
$value.service_address
|
int64
}}
name:
"
health"
{{
- end
}}
{{
- end
}}
{{
- end
}}
{{
- range $objectKey
,
$objectValue
:
= .Values.config.inputs
}}
{{
- range $objectKey
,
$objectValue
:
= .Values.config.inputs
}}
{{
- range $key
,
$value
:
= . -
}}
{{
- range $key
,
$value
:
= . -
}}
{{
- $tp
:
= typeOf $value -
}}
{{
- $tp
:
= typeOf $value -
}}
...
...
stable/telegraf/values.yaml
View file @
d594cfb7
...
@@ -60,6 +60,13 @@ config:
...
@@ -60,6 +60,13 @@ config:
problem
:
2
problem
:
2
critical
:
3
critical
:
3
outputs
:
outputs
:
-
health
:
service_address
:
"
http://:8888"
compares
:
field
:
buffer_size
lt
:
5000.0
contains
:
field
:
buffer_size
-
influxdb
:
-
influxdb
:
urls
:
urls
:
-
"
http://influxdb.monitoring.svc:8086"
-
"
http://influxdb.monitoring.svc:8086"
...
...
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