Skip to content

Commit c4b19ba

Browse files
authored
Add startupProbe (#19)
1 parent 3049ba6 commit c4b19ba

File tree

8 files changed

+37
-18
lines changed

8 files changed

+37
-18
lines changed

operator/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION ?= 0.3.0
1+
VERSION ?= 0.3.1
22
KEIP_INTEGRATION_IMAGE ?= ghcr.io/octoconsulting/keip/minimal-app:0.0.2
33

44
KUBECTL := kubectl

operator/controller/integrationroute-controller.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ spec:
5050
spec:
5151
containers:
5252
- name: webhook
53-
image: ghcr.io/octoconsulting/keip/route-webhook:0.6.0
53+
image: ghcr.io/octoconsulting/keip/route-webhook:0.6.1
5454
ports:
5555
- containerPort: 7080
5656
name: webhook-http

operator/example/README.md

+3-11
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@ Prerequisites:
88
- Metacontroller
99
- Keip CRDs and controller
1010
- Access to a `keip-integration` image
11-
- Cert-Manager
1211

13-
Running the example:
14-
1. Install Cert-Manager:
15-
```shell
16-
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.0/cert-manager.yaml
17-
```
18-
2. Create JKS password secret:
19-
```shell
20-
kubectl create secret generic --from-literal=password=password jks-password
21-
```
22-
3. Run example:
12+
Run the example:
2313
```shell
2414
kubectl apply -k example
2515
```
16+
*_Note_*: The example uses a keystore.jks file and a certificate created by [Cert Manager](https://cert-manager.io/).
2617

2718
This should result in the creation of the following resources:
2819

@@ -44,6 +35,7 @@ kubectl get pod
4435
NAME READY STATUS RESTARTS AGE
4536
testroute-74d574bf85-tbv9m 1/1 Running 0 99s
4637
```
38+
*_Note_*: Cert Manager takes a few seconds to create the certificate and keystore secret. The testroute pod will not start until the keystore.jks secret is available to mount.
4739

4840
Check the pod's logs for the configured greeting and secret:
4941
```shell

operator/example/kustomization.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
resources:
2+
- https://github.com/cert-manager/cert-manager/releases/download/v1.15.2/cert-manager.yaml
23
- testroute.yaml
34
- cert.yaml
45

@@ -19,3 +20,6 @@ secretGenerator:
1920
- name: testroute-secret
2021
literals:
2122
- test.secret=pass123
23+
- name: jks-password
24+
literals:
25+
- password=password

operator/webhook/.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ pip-log.txt
1111
.pytest_cache
1212

1313
# Local directives
14+
.venv
1415
test
1516
requirements-dev.txt

operator/webhook/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION ?= 0.6.0
1+
VERSION ?= 0.6.1
22
HOST_PORT ?= 7080
33

44
IMG_REGISTRY := ghcr.io/octoconsulting

operator/webhook/introute/sync.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,26 @@ def _create_pod_template(parent, labels, integration_image):
291291
"port": management_port,
292292
"scheme": scheme
293293
},
294-
"initialDelaySeconds": 10,
294+
"failureThreshold": 3,
295+
"timeoutSeconds": 3
295296
},
296297
"readinessProbe": {
297298
"httpGet": {
298299
"path": "/actuator/health/readiness",
299300
"port": management_port,
300301
"scheme": scheme
301302
},
302-
"initialDelaySeconds": 10,
303+
"failureThreshold": 2,
304+
"timeoutSeconds": 3
305+
},
306+
"startupProbe": {
307+
"httpGet": {
308+
"path": "/actuator/health/liveness",
309+
"port": management_port,
310+
"scheme": scheme
311+
},
312+
"failureThreshold": 12,
313+
"timeoutSeconds": 3
303314
},
304315
},
305316
],

operator/webhook/test/json/full-response.json

+13-2
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,26 @@
8282
"port": 8443,
8383
"scheme": "HTTPS"
8484
},
85-
"initialDelaySeconds": 10
85+
"failureThreshold": 3,
86+
"timeoutSeconds": 3
8687
},
8788
"readinessProbe": {
8889
"httpGet": {
8990
"path": "/actuator/health/readiness",
9091
"port": 8443,
9192
"scheme": "HTTPS"
9293
},
93-
"initialDelaySeconds": 10
94+
"failureThreshold": 2,
95+
"timeoutSeconds": 3
96+
},
97+
"startupProbe": {
98+
"httpGet": {
99+
"path": "/actuator/health/liveness",
100+
"port": 8443,
101+
"scheme": "HTTPS"
102+
},
103+
"failureThreshold": 12,
104+
"timeoutSeconds": 3
94105
},
95106
"env": [
96107
{

0 commit comments

Comments
 (0)