ufoscout/docker-compose-wait

What is alternative docker-compose-wait for kubernetes?

patsevanton opened this issue · 2 comments

Hello! Thanks for docker-compose-wait!
I try transfer docker-compose to kubernetes.
But original docker-compose dont support WAIT_HOSTS.
What is alternative docker-compose-wait for kubernetes?
How wait another pod/service in kubernetes?
Thanks!

@patsevanton
hi, I don't understand what you mean. Could you please rephrase your question?

Anyhow, I mostly use docker-compose-wait only on Kubernetes and there are no issues.
In fact, to use it in K8s, you have to:

  1. create your docker image adding the wait script as described in the readme.md file
  2. add the WAIT_HOSTS env variable to your k8s deployment descriptor

For example:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: MySuperApp
  name: MySuperApp
spec:
  replicas: 1
  strategy: {}
  selector:
    matchLabels:
      name: MySuperApp
  template:
    metadata:
      labels:
        name: MySuperApp
    spec:
      containers:
      - image: MySuperApp:latest
        name: MySuperApp
        imagePullPolicy: Always
        env:
        - name: WAIT_HOSTS
          value: $(DB_SERVICE_HOST):$(DB_SERVICE_PORT)
        - name: WAIT_BEFORE_HOSTS
          value: "10"
status: {}

Thanks!
I will try!