Skip to content

Commit

Permalink
Add missing probes (knative-extensions#1095)
Browse files Browse the repository at this point in the history
* add probes

* make thresholds different

* cleanup

* add delay for webhook
  • Loading branch information
skonto authored Apr 25, 2023
1 parent 4f982a2 commit 718312e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func main() {
Port: webhook.PortFromEnv(8443),
})

ctx = sharedmain.WithHealthProbesDisabled(ctx)
sharedmain.WebhookMainWithContext(
ctx, "net-istio-webhook",
certificates.NewController,
Expand Down
17 changes: 17 additions & 0 deletions config/500-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,28 @@ spec:
seccompProfile:
type: RuntimeDefault

readinessProbe:
httpGet:
path: /readiness
port: probes
scheme: HTTP
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /health
port: probes
scheme: HTTP
periodSeconds: 5
failureThreshold: 6

ports:
- name: metrics
containerPort: 9090
- name: profiling
containerPort: 8008
- name: probes
containerPort: 8080

# Unlike other controllers, this doesn't need a Service defined for metrics and
# profiling because it opts out of the mesh (see annotation above).
20 changes: 20 additions & 0 deletions config/500-webhook-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ spec:
seccompProfile:
type: RuntimeDefault

readinessProbe:
periodSeconds: 1
httpGet:
scheme: HTTPS
port: 8443
httpHeaders:
- name: k-kubelet-probe
value: "webhook"
failureThreshold: 3
livenessProbe:
periodSeconds: 1
httpGet:
scheme: HTTPS
port: 8443
httpHeaders:
- name: k-kubelet-probe
value: "webhook"
failureThreshold: 6
initialDelaySeconds: 20

ports:
- name: metrics
containerPort: 9090
Expand Down

0 comments on commit 718312e

Please sign in to comment.