File tree Expand file tree Collapse file tree
docs/content/en/docs/documentation/operations
sample-operators/operations/src/test/resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,3 +4,7 @@ weight: 80
44---
55
66This section covers operations-related features for running and managing operators in production.
7+
8+ See the
9+ [ ` operations ` sample operator] ( https://github.com/java-operator-sdk/java-operator-sdk/tree/main/sample-operators/operations )
10+ for a complete working example that demonstrates health probes, metrics, and Helm-based deployment.
Original file line number Diff line number Diff line change @@ -61,14 +61,23 @@ for a complete working example.
6161
6262## Kubernetes Deployment Configuration
6363
64- Once your operator exposes the probe endpoint, configure a readiness probe in your Deployment manifest:
64+ Once your operator exposes the probe endpoint, configure probes in your Deployment manifest. Both the
65+ startup and readiness probes can point to the same ` /healthz ` endpoint — the startup probe simply uses a
66+ higher ` failureThreshold ` to give the operator time to initialize:
6567
6668``` yaml
6769containers :
6870- name : operator
6971 ports :
7072 - name : probes
7173 containerPort : 8080
74+ startupProbe :
75+ httpGet :
76+ path : /healthz
77+ port : probes
78+ initialDelaySeconds : 1
79+ periodSeconds : 3
80+ failureThreshold : 20
7281 readinessProbe :
7382 httpGet :
7483 path : /healthz
@@ -78,8 +87,9 @@ containers:
7887 failureThreshold : 3
7988` ` `
8089
81- The readiness probe will mark the pod as not-ready until all informers have synced. After that, it
82- continues to monitor event source health at runtime.
90+ The startup probe gives the operator time to start (up to ~60 s with the settings above). Once the startup
91+ probe succeeds, the readiness probe takes over and will mark the pod as not-ready if any event source
92+ becomes unhealthy.
8393
8494## Helm Chart Support
8595
@@ -89,6 +99,9 @@ Enable them in your `values.yaml`:
8999` ` ` yaml
90100probes:
91101 port: 8080
102+ startup:
103+ enabled: true
104+ path: /healthz
92105 readiness:
93106 enabled: true
94107 path: /healthz
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ primaryResources:
3434 - metricshandlingcustomresource2s
3535
3636probes :
37+ startup :
38+ enabled : true
39+ path : /healthz
3740 readiness :
3841 enabled : true
3942 path : /healthz
You can’t perform that action at this time.
0 commit comments