From fe7a49fa0954dd91cf9af3d207451ae1fd6295b3 Mon Sep 17 00:00:00 2001 From: ChaosGramer Date: Sat, 16 Nov 2019 17:05:52 +0100 Subject: [PATCH] add readiness and liveness probe as example Signed-off-by: Jan Vaehsen (Windows) --- .../deployment+service.privileged.yaml | 18 ++++++++++++++++++ .../deployment+service.rootless.yaml | 18 ++++++++++++++++++ examples/kubernetes/pod.privileged.yaml | 16 ++++++++++++++++ examples/kubernetes/pod.rootless.yaml | 16 ++++++++++++++++ .../kubernetes/statefulset.privileged.yaml | 16 ++++++++++++++++ examples/kubernetes/statefulset.rootless.yaml | 16 ++++++++++++++++ 6 files changed, 100 insertions(+) diff --git a/examples/kubernetes/deployment+service.privileged.yaml b/examples/kubernetes/deployment+service.privileged.yaml index 70dbe844..a140d6f1 100644 --- a/examples/kubernetes/deployment+service.privileged.yaml +++ b/examples/kubernetes/deployment+service.privileged.yaml @@ -28,6 +28,24 @@ spec: - /certs/cert.pem - --tlskey - /certs/key.pem +# the probe below will only work after Release v0.6.3 + readinessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 +# the probe below will only work after Release v0.6.3 + livenessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 securityContext: privileged: true ports: diff --git a/examples/kubernetes/deployment+service.rootless.yaml b/examples/kubernetes/deployment+service.rootless.yaml index 14075a1e..4addbc79 100644 --- a/examples/kubernetes/deployment+service.rootless.yaml +++ b/examples/kubernetes/deployment+service.rootless.yaml @@ -33,6 +33,24 @@ spec: - --tlskey - /certs/key.pem - --oci-worker-no-process-sandbox +# the probe below will only work after Release v0.6.3 + readinessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 +# the probe below will only work after Release v0.6.3 + livenessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 securityContext: # To change UID/GID, you need to rebuild the image runAsUser: 1000 diff --git a/examples/kubernetes/pod.privileged.yaml b/examples/kubernetes/pod.privileged.yaml index 4406f140..79d37cd4 100644 --- a/examples/kubernetes/pod.privileged.yaml +++ b/examples/kubernetes/pod.privileged.yaml @@ -6,5 +6,21 @@ spec: containers: - name: buildkitd image: moby/buildkit:master + readinessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 + livenessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 securityContext: privileged: true diff --git a/examples/kubernetes/pod.rootless.yaml b/examples/kubernetes/pod.rootless.yaml index be4f09aa..814e225d 100644 --- a/examples/kubernetes/pod.rootless.yaml +++ b/examples/kubernetes/pod.rootless.yaml @@ -12,6 +12,22 @@ spec: image: moby/buildkit:master-rootless args: - --oci-worker-no-process-sandbox + readinessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 + livenessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 securityContext: # To change UID/GID, you need to rebuild the image runAsUser: 1000 diff --git a/examples/kubernetes/statefulset.privileged.yaml b/examples/kubernetes/statefulset.privileged.yaml index 91c9cdde..ce606fe5 100644 --- a/examples/kubernetes/statefulset.privileged.yaml +++ b/examples/kubernetes/statefulset.privileged.yaml @@ -19,5 +19,21 @@ spec: containers: - name: buildkitd image: moby/buildkit:master + readinessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 + livenessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 securityContext: privileged: true diff --git a/examples/kubernetes/statefulset.rootless.yaml b/examples/kubernetes/statefulset.rootless.yaml index c60f6368..10754468 100644 --- a/examples/kubernetes/statefulset.rootless.yaml +++ b/examples/kubernetes/statefulset.rootless.yaml @@ -25,6 +25,22 @@ spec: image: moby/buildkit:master-rootless args: - --oci-worker-no-process-sandbox + readinessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 + livenessProbe: + exec: + command: + - buildctl + - debug + - workers + initialDelaySeconds: 5 + periodSeconds: 30 securityContext: # To change UID/GID, you need to rebuild the image runAsUser: 1000