<h1>Dockerfile</h1>

<pre><code>FROM ubuntu
MAINTAINER user@gmail.com
RUN apt-get update
RUN apt-get install -y openjdk-8-jdk
ADD build/libs/micro-service-gradle-0.0.1-SNAPSHOT.jar /var/local/
ENTRYPOINT exec java $JAVA_OPTS \
 -jar /var/local/micro-service-gradle-0.0.1-SNAPSHOT.jar
EXPOSE 8080
</code></pre>

<h1>deployment.yaml</h1>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: micro-service-gradle
  labels:
    app: micro-service-gradle
spec:
  replicas: 1
  selector:
    matchLabels:
      app: micro-service-gradle
  template:
    metadata:
      labels:
        app: micro-service-gradle
    spec:
      containers:
      - name: micro-service-gradle
        image: micro-service-gradle:latest
        ports:
        - containerPort: 8080
</code></pre>

<p>Deploying spring boot application in Kubernetes . Pod is not getting created. When i check kubectl get pods. it says CrashLoopBackOff. </p>

<pre><code>NAME                                  READY   STATUS             RESTARTS   AGE
micro-service-gradle-fc97c97b-8hwhg   0/1     CrashLoopBackOff   6          6m23s
</code></pre>

<p>I tried to check logs for the same container. Logs are empty</p>

<pre><code>kubectl logs -p micro-service-gradle-fc97c97b-8hwhg
</code></pre>

<p>I created the container manually using docker run. There is no issues in image and containers works fine.</p>

<p>How to verify the logs for why the pods in crash status.</p>

<p>You need to use</p>

<pre><code>kubectl describe pod micro-service-gradle-fc97c97b-8hwhg
</code></pre>

<p>to get the relevant logs. This should guide you to your problem.</p>
