Services
Services are containers that run beside the job for as long as it runs, such as a database for its tests. They are ready before the first step and removed with the job. The job and its services share one network namespace: steps reach a service at localhost:<port> and at <name>:<port>.
name: image is short for {image: …}. A service also takes env, command (replaces the image's CMD), entrypoint (replaces its ENTRYPOINT and drops its CMD), ports and ready.
Readiness
A service is ready when its ready: script succeeds (run in the service with sh -c); else when its image's HEALTHCHECK says healthy; else once its ports:, or the ports its image exposes, are listening. It has 60 seconds by default (ready: {timeout: 2m} changes that). A service that isn't ready in time fails the job with reason setup.
Names are DNS labels (lowercase letters, digits and -), and two services of a job can't listen on the same port. Services only run beside container jobs.