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 9494 - containerPort : 8081
9595 name : http-metrics
9696 {{- 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
97109 {{- with .Values.nodeSelector }}
98110 nodeSelector :
99111 {{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change @@ -80,6 +80,18 @@ func Run(cmd *cobra.Command, args []string) {
8080 go func () {
8181 prometheus .MustRegister (metricPayloadSize )
8282 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+
8395 metricsServer .Handle ("/metrics" , promhttp .Handler ())
8496 err := http .ListenAndServe (":8081" , metricsServer )
8597 if err != nil && ! errors .Is (err , http .ErrServerClosed ) {
You can’t perform that action at this time.
0 commit comments