title: What is the equivalent for depends_on in kubernetes
body: <p>I have a docker compose file with the following entries</p>
  
  <hr>
  
  <pre><code>version: '2.1'
  
  services:
    mysql:
      container_name: mysql 
      image: mysql:latest 
      volumes:
        - ./mysqldata:/var/lib/mysql 
      environment: 
        MYSQL_ROOT_PASSWORD: 'password' 
      ports: 
        - '3306:3306' 
      healthcheck: 
          test: ["CMD", "curl", "-f", "http://localhost:3306"] 
          interval: 30s 
          timeout: 10s 
          retries: 5 
  
    test1: 
      container_name: test1 
      image: test1:latest 
      ports: 
        - '4884:4884' 
        - '8443' 
      depends_on: 
        mysql: 
          condition: service_healthy 
      links: 
       - mysql 
  </code></pre>
  
  <p>The Test-1 container is dependent on mysql and it needs to be up and running.</p>
  
  <p>In docker this can be controlled using health check and depends_on attributes. 
  The health check equivalent in kubernetes is readinessprobe which i have already created but how do we control the container startup in the pod's?????</p>
  
  <p>Any directions on this is greatly appreciated.</p>
  
  <p>My Kubernetes file:</p>
  
  <pre><code>apiVersion: apps/v1beta1 
  kind: Deployment 
  metadata: 
    name: deployment 
  spec: 
    replicas: 1 
    template: 
      metadata: 
        labels: 
          app: deployment 
  
      spec: 
        containers: 
        - name: mysqldb 
          image: "dockerregistry:mysqldatabase" 
          imagePullPolicy: Always 
          ports: 
          - containerPort: 3306 
          readinessProbe: 
            tcpSocket: 
              port: 3306 
            initialDelaySeconds: 15 
            periodSeconds: 10 
        - name: test1 
          image: "dockerregistry::test1" 
          imagePullPolicy: Always 
          ports: 
          - containerPort: 3000 
  </code></pre>