Skip to content

Commit

Permalink
fix: liveness and readiness probes added to k8s specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Vladimirovich Nacharov committed Feb 24, 2021
1 parent 61a00f5 commit 450968d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions charts/kafka-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@ spec:
- name: metrics
containerPort: 9308
protocol: TCP
livenessProbe:
failureThreshold: 1
httpGet:
path: /healthz
port: metrics
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 9
readinessProbe:
failureThreshold: 1
httpGet:
path: /healthz
port: metrics
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 9

{{- if .Values.kafkaExporter.tls.enabled }}
volumeMounts:
- name: tls-certs
Expand Down
4 changes: 4 additions & 0 deletions kafka_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ func main() {
</body>
</html>`))
})
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
// need more specific sarama check
w.Write([]byte("ok"))
})

plog.Infoln("Listening on", *listenAddress)
plog.Fatal(http.ListenAndServe(*listenAddress, nil))
Expand Down

0 comments on commit 450968d

Please sign in to comment.