Dockerfile
FROM ubuntu
MAINTAINER [email protected]
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
deployment.yaml
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
Deploying spring boot application in Kubernetes . Pod is not getting created. When i check kubectl get pods. it says CrashLoopBackOff.
NAME READY STATUS RESTARTS AGE
micro-service-gradle-fc97c97b-8hwhg 0/1 CrashLoopBackOff 6 6m23s
I tried to check logs for the same container. Logs are empty
kubectl logs -p micro-service-gradle-fc97c97b-8hwhg
I created the container manually using docker run. There is no issues in image and containers works fine.
How to verify the logs for why the pods in crash status.