Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example that demonstrates waiting for a sidecar to become Ready #1622

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions examples/taskruns/sidecar-ready.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
generateName: sidecar-ready-
spec:
taskSpec:
sidecars:
- name: slow-sidecar
image: ubuntu
command: ['sleep', 'infinity']
# The sidecar takes 5s to report as Ready, even after it starts. If the
# step runs as soon as the sidecar starts, it will fail because
# /shared/ready isn't available yet.
readinessProbe:
exec:
command:
- sh
- -c
- sleep 5 && touch /shared/ready
volumeMounts:
- name: shared
mountPath: /shared

steps:
- name: check-ready
image: ubuntu
# The step will only succeed if the sidecar has written this file, which
# it does 5s after it starts, before it reports Ready.
command: ['cat', '/shared/ready']
imjasonh marked this conversation as resolved.
Show resolved Hide resolved
volumeMounts:
- name: shared
mountPath: /shared

# Sidecars don't have /workspace mounted by default, so we have to define
# our own shared volume.
volumes:
- name: shared
emptyDir: {}