title: Error - Back-off restarting failed container while creating a service
body: <p>As stated in the title I am experiencing error </p>
  
  <blockquote>
    <p>Back-off restarting failed container while creating a service</p>
  </blockquote>
  
  <p>I've seen questions on Stack Overflow but I am still not sure how to resolve it.</p>
  
  <p>This is my <strong>deployment yaml file</strong>:</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: book-api
  spec:
    replicas: 1
    revisionHistoryLimit: 10
    template:
      metadata:
        name: book-api
        labels:
          app: book-api
      spec:
        containers:
        - name: book-api
          image: newmaster/kubecourse-books:v1
          ports:
          - name: http
            containerPort: 3000
  </code></pre>
  
  <p>while the <strong>service deployment file</strong> is:</p>
  
  <pre><code>kind: Service
  apiVersion: v1
  metadata:
    name: exampleservice
  spec:
    selector:
      app: myapp
    ports:
      - protocol: "TCP"
        # Port accessible inside cluster
        port: 8081
        # Port to forward to inside the pod
        targetPort: 8080
        # Port accessible outside cluster
        nodePort: 30000
    type: LoadBalancer
  </code></pre>
  
  <p>This is my Dockerfile:</p>
  
  <pre><code>FROM node:alpine
  
  # Create app directory
  WORKDIR /src
  
  # Install app dependencies
  COPY package.json /src/
  COPY package-lock.json /src/
  
  RUN npm install
  
  # Bundle app source
  ADD . /src
  
  RUN npm run build
  
  EXPOSE 3000
  
  CMD [ "npm", "run serve" ]
  </code></pre>
  
  <p>I have no idea how to resolve this issue, I am newbie in the Kubernetes and DevOps world.
  Repo is over here: <a href="https://github.com/codemasternode/BookService.Kubecourse.git" rel="nofollow noreferrer">https://github.com/codemasternode/BookService.Kubecourse.git</a></p>