Basic Prometheus support (#28)

Co-authored-by: Marco Franssen <[email protected]>
This commit is contained in:
kfox1111
2023-02-24 22:39:15 +01:00
committed by GitHub
co-authored by Marco Franssen
parent 495d9d67e8
commit 35eb3bb42e
15 changed files with 114 additions and 7 deletions
@@ -64,6 +64,7 @@ A Helm chart to install the SPIRE server.
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| socketPath | string | `"/run/spire/server-sockets/spire-server.sock"` | |
| telemetry.prometheus.enabled | bool | `false` | |
| tolerations | list | `[]` | |
| topologySpreadConstraints | list | `[]` | |
| trustDomain | string | `"example.org"` | |
@@ -81,3 +81,12 @@ data:
live_path = "/live"
ready_path = "/ready"
}
{{- if (dig "telemetry" "prometheus" "enabled" .Values.telemetry.prometheus.enabled .Values.global) }}
telemetry {
Prometheus {
host = "0.0.0.0"
port = 9988
}
}
{{- end }}
@@ -14,7 +14,7 @@ data:
labels:
{{- include "spire-server.labels" . | nindent 8 }}
metrics:
bindAddress: 127.0.0.1:8082
bindAddress: 0.0.0.0:8082
healthProbe:
bindAddress: 127.0.0.1:8083
leaderElection:
@@ -1,3 +1,4 @@
{{- $configSum := (include (print $.Template.BasePath "/configmap.yaml") . | sha256sum) }}
{{- $fullname := include "spire-server.fullname" . }}
apiVersion: apps/v1
kind: StatefulSet
@@ -15,10 +16,11 @@ spec:
{{- include "spire-server.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
checksum/config: {{ $configSum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "spire-server.selectorLabels" . | nindent 8 }}
spec:
@@ -45,6 +47,10 @@ spec:
protocol: TCP
- containerPort: 8080
name: healthz
{{- if (dig "telemetry" "prometheus" "enabled" .Values.telemetry.prometheus.enabled .Values.global) }}
- containerPort: 9988
name: prom
{{- end }}
livenessProbe:
httpGet:
path: /live
@@ -92,6 +98,10 @@ spec:
protocol: TCP
- containerPort: 8008
name: healthz
{{- if (dig "telemetry" "prometheus" "enabled" .Values.telemetry.prometheus.enabled .Values.global) }}
- containerPort: 8082
name: prom2
{{- end }}
# TODO: implement probes
# livenessProbe:
# httpGet:
@@ -159,3 +159,7 @@ controllerManager:
# spiffe.io/spiffe-id: "true"
dnsNameTemplates: []
# - '{{ index .PodMeta.Labels "app.kubernetes.io/name" }}.{{ .PodMeta.Namespace }}.svc.cluster.local'
telemetry:
prometheus:
enabled: false