Skip to content


A sidecar is another container that executes concurrently in the same pod as the main container and is useful in creating multi-container pods.

kind: Workflow
  generateName: sidecar-nginx-
  entrypoint: sidecar-nginx-example
  - name: sidecar-nginx-example
      image: appropriate/curl
      command: [sh, -c]
      # Try to read from nginx web server until it comes up
      args: ["until `curl -G '' >& /tmp/out`; do echo sleep && sleep 1; done && cat /tmp/out"]
    # Create a simple nginx web server
    - name: nginx
      image: nginx:1.13
      command: [nginx, -g, daemon off;]

In the above example, we create a sidecar container that runs Nginx as a simple web server. The order in which containers come up is random, so in this example the main container polls the Nginx container until it is ready to service requests. This is a good design pattern when designing multi-container systems: always wait for any services you need to come up before running your main code.

Have a question?

Search on GitHub Discussions and Slack.