1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-29 02:45:06 +00:00

Check webhooks are present during liveness (#1748)

Fixes #1747

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
This commit is contained in:
treydock 2021-03-31 15:44:56 -04:00 committed by GitHub
parent 0131f375f1
commit 91713ee566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View file

@ -78,7 +78,7 @@ livenessProbe:
port: 9443
scheme: HTTPS
initialDelaySeconds: 10
periodSeconds: 10
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 2
successThreshold: 1

View file

@ -2443,13 +2443,13 @@ spec:
image: ghcr.io/kyverno/kyverno:v1.3.5-rc1
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
failureThreshold: 2
httpGet:
path: /health/liveness
port: 9443
scheme: HTTPS
initialDelaySeconds: 5
periodSeconds: 10
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 5
name: kyverno

View file

@ -76,10 +76,10 @@ spec:
path: /health/liveness
port: 9443
scheme: HTTPS
initialDelaySeconds: 5
periodSeconds: 10
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 4
failureThreshold: 2
successThreshold: 1
readinessProbe:
httpGet:

View file

@ -221,7 +221,11 @@ func NewWebhookServer(
// Fail this request if Kubernetes should restart this instance
mux.HandlerFunc("GET", config.LivenessServicePath, func(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
w.WriteHeader(http.StatusOK)
if err := ws.webhookRegister.Check(); err != nil {
w.WriteHeader(http.StatusInternalServerError)
} else {
w.WriteHeader(http.StatusOK)
}
})
// Handle Readiness responds to a Kubernetes Readiness probe