Skip to content

Commit

Permalink
feat: support zap logger config (#76)
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Leroy <[email protected]>

Signed-off-by: Maxime Leroy <[email protected]>
  • Loading branch information
maxime1907 authored Oct 31, 2022
1 parent 3dfae57 commit 9fe320b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/goldpinger/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "v3.6.1"
appVersion: "v3.7.0"
description: Goldpinger makes calls between its instances for visibility and alerting.
home: https://github.com/bloomberg/goldpinger
maintainers:
Expand All @@ -11,4 +11,4 @@ name: goldpinger
sources:
- https://github.com/bloomberg/goldpinger
- https://github.com/okgolove/helm-charts
version: 5.4.4
version: 5.5.0
8 changes: 8 additions & 0 deletions charts/goldpinger/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "goldpinger.fullname" . }}-zap
labels:
{{- include "goldpinger.labels" . | nindent 4 }}
data:
zap.json: {{ .Values.goldpinger.zapConfig | toJson }}
7 changes: 7 additions & 0 deletions charts/goldpinger/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ spec:
- name: goldpinger-daemon
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: zap
mountPath: /config
env:
- name: HOSTNAME
valueFrom:
Expand Down Expand Up @@ -73,6 +76,10 @@ spec:
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: zap
configMap:
name: {{ include "goldpinger.fullname" . }}-zap
{{- range $k := .Values.extraEnv }}
{{- if and (eq $k.name "USE_HOST_IP") (eq $k.value "true") }}
hostNetwork: true
Expand Down
22 changes: 22 additions & 0 deletions charts/goldpinger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ serviceAccount:

goldpinger:
port: 80
zapConfig: |
{
"level": "info",
"encoding": "json",
"outputPaths": [
"stdout"
],
"errorOutputPaths": [
"stderr"
],
"initialFields": {
},
"encoderConfig": {
"messageKey": "message",
"levelKey": "level",
"levelEncoder": "lowercase",
"timeKey": "ts",
"timeEncoder": "ISO8601",
"callerKey": "caller",
"callerEncoder": "Short"
}
}
extraEnv: []

Expand Down

0 comments on commit 9fe320b

Please sign in to comment.