File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
deploy/charts/venafi-kubernetes-agent/templates Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 94
94
- containerPort : 8081
95
95
name : http-metrics
96
96
{{- end }}
97
+ livenessProbe :
98
+ httpGet :
99
+ path : /healthz
100
+ port : 8081
101
+ initialDelaySeconds : 15
102
+ periodSeconds : 20
103
+ readinessProbe :
104
+ httpGet :
105
+ path : /readyz
106
+ port : 8081
107
+ initialDelaySeconds : 5
108
+ periodSeconds : 10
97
109
{{- with .Values.nodeSelector }}
98
110
nodeSelector :
99
111
{{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change @@ -80,6 +80,18 @@ func Run(cmd *cobra.Command, args []string) {
80
80
go func () {
81
81
prometheus .MustRegister (metricPayloadSize )
82
82
metricsServer := http .NewServeMux ()
83
+
84
+ // Health check endpoint. Since we haven't figured a good way of knowning
85
+ // what "ready" means for the agent, we just return 200 OK inconditionally.
86
+ // The goal is to satisfy some Kubernetes distributions, like OpenShift,
87
+ // that require a liveness and health probe to be present for each pod.
88
+ metricsServer .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
89
+ w .WriteHeader (http .StatusOK )
90
+ })
91
+ metricsServer .HandleFunc ("/readyz" , func (w http.ResponseWriter , r * http.Request ) {
92
+ w .WriteHeader (http .StatusOK )
93
+ })
94
+
83
95
metricsServer .Handle ("/metrics" , promhttp .Handler ())
84
96
err := http .ListenAndServe (":8081" , metricsServer )
85
97
if err != nil && ! errors .Is (err , http .ErrServerClosed ) {
You can’t perform that action at this time.
0 commit comments