Skip to content

Commit cc3131d

Browse files
committed
wip
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent c527bf1 commit cc3131d

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

docs/content/en/docs/documentation/operations/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ weight: 80
44
---
55

66
This 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.

docs/content/en/docs/documentation/operations/health-probes.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff 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
6769
containers:
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
90100
probes:
91101
port: 8080
102+
startup:
103+
enabled: true
104+
path: /healthz
92105
readiness:
93106
enabled: true
94107
path: /healthz

sample-operators/operations/src/test/resources/helm-values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ primaryResources:
3434
- metricshandlingcustomresource2s
3535

3636
probes:
37+
startup:
38+
enabled: true
39+
path: /healthz
3740
readiness:
3841
enabled: true
3942
path: /healthz

0 commit comments

Comments
 (0)