Skip to content

Commit d94c57e

Browse files
committed
add readiness and liveness for vpa admission
1 parent 9bc4220 commit d94c57e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

vertical-pod-autoscaler/deploy/admission-controller-deployment.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ spec:
4343
- containerPort: 8000
4444
- name: prometheus
4545
containerPort: 8944
46+
livenessProbe:
47+
httpGet:
48+
path: /healthz
49+
port: 8000
50+
scheme: HTTPS
51+
initialDelaySeconds: 5
52+
periodSeconds: 10
53+
failureThreshold: 3
54+
readinessProbe:
55+
httpGet:
56+
path: /healthz
57+
port: 8000
58+
scheme: HTTPS
59+
periodSeconds: 10
60+
failureThreshold: 3
4661
volumes:
4762
- name: tls-certs
4863
secret:

vertical-pod-autoscaler/pkg/admission-controller/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ func main() {
151151
as.Serve(w, r)
152152
healthCheck.UpdateLastActivity()
153153
})
154+
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
155+
healthCheck.ServeHTTP(w, r)
156+
healthCheck.UpdateLastActivity()
157+
})
154158
var mutatingWebhookClient typedadmregv1.MutatingWebhookConfigurationInterface
155159
if *registerWebhook {
156160
mutatingWebhookClient = kubeClient.AdmissionregistrationV1().MutatingWebhookConfigurations()

0 commit comments

Comments
 (0)