Skip to content

Commit

Permalink
Add startupProbe (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhunzik authored Aug 5, 2024
1 parent 3049ba6 commit c4b19ba
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion operator/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION ?= 0.3.0
VERSION ?= 0.3.1
KEIP_INTEGRATION_IMAGE ?= ghcr.io/octoconsulting/keip/minimal-app:0.0.2

KUBECTL := kubectl
Expand Down
2 changes: 1 addition & 1 deletion operator/controller/integrationroute-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
spec:
containers:
- name: webhook
image: ghcr.io/octoconsulting/keip/route-webhook:0.6.0
image: ghcr.io/octoconsulting/keip/route-webhook:0.6.1
ports:
- containerPort: 7080
name: webhook-http
Expand Down
14 changes: 3 additions & 11 deletions operator/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@ Prerequisites:
- Metacontroller
- Keip CRDs and controller
- Access to a `keip-integration` image
- Cert-Manager

Running the example:
1. Install Cert-Manager:
```shell
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.0/cert-manager.yaml
```
2. Create JKS password secret:
```shell
kubectl create secret generic --from-literal=password=password jks-password
```
3. Run example:
Run the example:
```shell
kubectl apply -k example
```
*_Note_*: The example uses a keystore.jks file and a certificate created by [Cert Manager](https://cert-manager.io/).

This should result in the creation of the following resources:

Expand All @@ -44,6 +35,7 @@ kubectl get pod
NAME READY STATUS RESTARTS AGE
testroute-74d574bf85-tbv9m 1/1 Running 0 99s
```
*_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.

Check the pod's logs for the configured greeting and secret:
```shell
Expand Down
4 changes: 4 additions & 0 deletions operator/example/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resources:
- https://github.com/cert-manager/cert-manager/releases/download/v1.15.2/cert-manager.yaml
- testroute.yaml
- cert.yaml

Expand All @@ -19,3 +20,6 @@ secretGenerator:
- name: testroute-secret
literals:
- test.secret=pass123
- name: jks-password
literals:
- password=password
1 change: 1 addition & 0 deletions operator/webhook/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ pip-log.txt
.pytest_cache

# Local directives
.venv
test
requirements-dev.txt
2 changes: 1 addition & 1 deletion operator/webhook/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION ?= 0.6.0
VERSION ?= 0.6.1
HOST_PORT ?= 7080

IMG_REGISTRY := ghcr.io/octoconsulting
Expand Down
15 changes: 13 additions & 2 deletions operator/webhook/introute/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,26 @@ def _create_pod_template(parent, labels, integration_image):
"port": management_port,
"scheme": scheme
},
"initialDelaySeconds": 10,
"failureThreshold": 3,
"timeoutSeconds": 3
},
"readinessProbe": {
"httpGet": {
"path": "/actuator/health/readiness",
"port": management_port,
"scheme": scheme
},
"initialDelaySeconds": 10,
"failureThreshold": 2,
"timeoutSeconds": 3
},
"startupProbe": {
"httpGet": {
"path": "/actuator/health/liveness",
"port": management_port,
"scheme": scheme
},
"failureThreshold": 12,
"timeoutSeconds": 3
},
},
],
Expand Down
15 changes: 13 additions & 2 deletions operator/webhook/test/json/full-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,26 @@
"port": 8443,
"scheme": "HTTPS"
},
"initialDelaySeconds": 10
"failureThreshold": 3,
"timeoutSeconds": 3
},
"readinessProbe": {
"httpGet": {
"path": "/actuator/health/readiness",
"port": 8443,
"scheme": "HTTPS"
},
"initialDelaySeconds": 10
"failureThreshold": 2,
"timeoutSeconds": 3
},
"startupProbe": {
"httpGet": {
"path": "/actuator/health/liveness",
"port": 8443,
"scheme": "HTTPS"
},
"failureThreshold": 12,
"timeoutSeconds": 3
},
"env": [
{
Expand Down

0 comments on commit c4b19ba

Please sign in to comment.