Skip to content

Commit

Permalink
improved readiness and liveness probes
Browse files Browse the repository at this point in the history
  • Loading branch information
damoon committed May 23, 2021
1 parent b310eb0 commit 63eddc5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
9 changes: 7 additions & 2 deletions service-dependencies/minio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ spec:
requests:
cpu: "100m"
memory: "1Gi"
readinessProbe:
livenessProbe:
httpGet:
path: /minio/health/live
port: 9000
readinessProbe:
httpGet:
path: /minio/health/cluster
port: 9000
lifecycle:
preStop:
exec:
command:
- sh
- -c
- "sleep 10"
- until [[ $(curl --silent --fail --max-time 5 --write-out "%{http_code}" http://127.0.0.1:9000/minio/health/cluster\?maintenance\=true) = "200" ]]; do sleep 1; done
volumeMounts:
- name: data
mountPath: /home/shared
Expand Down Expand Up @@ -102,6 +106,7 @@ spec:
- |
set -euxo pipefail
mc config host add minio http://wedding-minio:9000 $(cat /secret/minio/MINIO_ACCESS_KEY) $(cat /secret/minio/MINIO_SECRET_KEY)
until timeout 10 mc admin info minio; do sleep 1; done
mc mb minio/contexts --ignore-existing
mc mb minio/registry --ignore-existing
resources:
Expand Down
15 changes: 6 additions & 9 deletions service-dependencies/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ spec:
requests:
cpu: "100m"
memory: "500Mi"
livenessProbe:
httpGet:
path: /v2/
port: 5000
readinessProbe:
httpGet:
path: /debug/health
port: 5001
path: /v2/_catalog
port: 5000
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -140,10 +144,3 @@ data:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
debug:
addr: :5001
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
10 changes: 5 additions & 5 deletions tests/Tiltfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@

local_resource ('test build',
'timeout 60 bash docker-build.sh',
'timeout 120 bash docker-build.sh',
deps=['..'],
resource_deps=['wedding'],
allow_parallel=True,
)

local_resource ('test pull tag push',
'timeout 100 bash docker-pull-tag-push.sh',
'timeout 200 bash docker-pull-tag-push.sh',
deps=['..'],
resource_deps=['wedding'],
allow_parallel=True,
)

local_resource ('test inspect',
'timeout 100 bash docker-inspect.sh',
'timeout 200 bash docker-inspect.sh',
deps=['..'],
resource_deps=['wedding'],
allow_parallel=True,
)

local_resource ('test max memory',
'timeout 60 bash docker-max-memory.sh',
'timeout 120 bash docker-max-memory.sh',
deps=['..'],
resource_deps=['wedding'],
allow_parallel=True,
)

local_resource ('test tilt ci',
'timeout 170 bash tilt-ci.sh',
'timeout 360 bash tilt-ci.sh',
deps=['..'],
resource_deps=['wedding'],
allow_parallel=True,
Expand Down

0 comments on commit 63eddc5

Please sign in to comment.