I'm trying to deploy my spring boot application to local kubernates cluster. I have performed the below steps 1.created the application build the image and pushed to docker hub registry 2.created the secret and configured 3.created the deployment file and executed But Pod was not getting created as I'm getting containerCreationError in the status .when I checked the logs I can see that image has been successfully pulled but the below error occurs
kublet Error: Error response from daemon: No command specified
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-app-deployment
labels:
name: auth-app-deployment
spec:
replicas: 1
selector:
matchLabels:
name: auth-app
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
name: auth-app
spec:
imagePullSecrets:
- name: regcred
containers:
- name: auth-app
image: vishnusnair1995/vsn-tec:auth
imagePullPolicy: Always
ports:
- containerPort: 9999
env:
- name: SPRING_PROFILES_ACTIVE
value: prod
livenessProbe:
httpGet:
path: /actuator/health
port: 9999
initialDelaySeconds: 30
periodSeconds: 40
readinessProbe:
httpGet:
path: /actuator/health
port: 9999
initialDelaySeconds: 30
periodSeconds: 40
restartPolicy: Always
FROM openjdk:8
COPY build/libs/auth-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
DOCKERFILE
From my understanding the issue is only when we are pulling the image from remote registry, because what I observed is that when I build the docker image in local and change the imagePullPolicy : IfNotPresent pod was getting created with out any issues