Can someone please tell what is the issue with my yaml file for deployment. When I remove readiness probe, I can see my deplyoment in kubectl get deployments
as available. But with readiness probe, it remains unavailable as below.
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
neg-demo-app 1 1 1 0 2m33s
Below is my yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: neg-demo-app # Label for the Deployment
name: neg-demo-app # Name of Deployment
spec: # Deployment's specification
minReadySeconds: 60 # Number of seconds to wait after a Pod is created and its status is Ready
selector:
matchLabels:
run: neg-demo-app
template: # Pod template
metadata:
labels:
run: neg-demo-app # Labels Pods from this Deployment
spec: # Pod specification; each Pod created by this Deployment has this specification
containers:
- image: container_name # Application to run in Deployment's Pods
name: hostname # Container name
livenessProbe:
httpGet:
path: /healthz
port: 8080
scheme: HTTP
readinessProbe:
httpGet:
path: /healthz
port: 8080
scheme: HTTP
terminationGracePeriodSeconds: 60 # Number of seconds to wait for connections to terminate before shutting down Pods