<p>For our CI pipeline I setup a Kubernetes pod config (see below). There is one issue that the php app can't connect to the mysql container because it can't resolve the host "mysql".
Error message:</p>

<pre><code>mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known
</code></pre>

<p>pod  config:</p>

<pre><code>apiVersion: v1
kind: Pod
spec:
  containers:
  - name: php
    image: docker.pkg.github.com/foo-org/bar-php/bar-php:latest
  - name: nginx
    image: docker.pkg.github.com/foo-org/bar-nginx/bar-nginx:latest
    command:
    - cat
    tty: true
  - name: mysql
    image: docker.pkg.github.com/foo-org/bar-mysql/bar-mysql:latest
    env:
    - name: MYSQL_ROOT_PASSWORD
      value: bazz
    ports:
    - containerPort: 3306
    readinessProbe:
      tcpSocket:
        port: 3306
      initialDelaySeconds: 5
    tty: true
  imagePullSecrets:
  - name: ci-gh-registry
</code></pre>

<p>This runs in GKE but I guess this doesn't make a difference?</p>

<p>Any ideas why and how to fix it?</p>

user1587047
<p>provide host as <code>127.0.0.1</code> or <code>localhost</code> instead of <code>mysql</code> containers in a pod communicate over localhost</p>
