<p>I am new to Kubernetes. I have setup kubernetes with 1 master and 3 slave nodes. I have created mysql and nginx pods and it is running on different nodes successfully. Now I want to deploy my application. It has nginx,php-fpm, PHPmodule and MySQL combination. How can I achieve this in Kubernetes? </p>

<p>Here is what I have tried for php-fpm,</p>

<p>cat php-fpm.yaml :</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: php-fpm
  labels:
    name: php-fpm
spec:
  containers:
    - resources:
        limits :
          cpu: 0.5
      image: php-fpm
      name: php-fpm
      env:
        - name: PHPFPM_SERVICE
          # change this

      ports:
        - containerPort: 9000
          name: php-fpm   
</code></pre>

<p>cat php-fpm-service.yaml : </p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    name: php-fpm
  name: php-fpm
spec:
  externalIPs:
    - 10.128.0.3
  ports:
    # the port that this service should serve on
    - port: 9000
  # label keys and values that must match in order to receive traffic for this service
  selector:
    name: php-fpm
</code></pre>

<p>But php-fpm Pod is not running; the output is below.</p>

<pre><code>NAME      READY     STATUS         RESTARTS   AGE
mysql     1/1       Running        0          1d
mysql1    1/1       Running        0          18h
nginx     1/1       Running        0          18h
php-fpm   0/1       ErrImagePull   0          1m
</code></pre>

<p>How can I get it running?</p>

<p>Your Pod fails to start because it can't find the image you specified on docker hub (<code>ErrImagePull</code>).</p>

<p>Change <code>php-fpm.yaml</code> like this:</p>

<pre><code>...
image: php:fpm
...
</code></pre>

<p>See the full list of <a href="https://hub.docker.com/_/php/" rel="nofollow noreferrer">official php image tags</a>.</p>

<p>To get a better overall idea I suggest read the <a href="https://github.com/kubernetes/kubernetes/blob/master/examples/mysql-wordpress-pd/README.md" rel="nofollow noreferrer">tutorial on running WordPress on kubernetes (using mysql)</a> before you try to roll your own solution.</p>
