I want to run two containers on a single pod.
container1 is a test that tries to connect to a SQL Server Database that runs on container2.
How can I make sure that the sql container (container2) will run and be ready before container1 starts?
initContainer won't work here, as it will run before both containers.
This is my compose.yaml:
apiVersion: v1
kind: Pod
metadata:
name: sql-test-pod
labels:
name: sql-test
spec:
restartPolicy: Never
containers:
- name: my-sqldb
image: docker-registry.com/database
imagePullPolicy: Always
resources:
limits:
memory: "4096Mi"
cpu: "750m"
requests:
memory: "4096Mi"
cpu: "750m"
- name: tests
tty: true
stdin: true
image: docker-registry.com/test
imagePullPolicy: Always
resources:
limits:
memory: "4096Mi"
cpu: "750m"
requests:
memory: "4096Mi"
cpu: "750m"
env:
- name: sqlhostname
value: "SqlHostnamePlaceholder"
nodeSelector:
kubernetes.io/os: windows
tolerations:
- key: "windows"
operator: "Equal"
value: "2019"
effect: "NoSchedule"