Kubernetes and readinessprobe

2/28/2019

I have specified a deployment in kubernetes :

apiVersion: v1
kind: List
items:
- apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: quote-data
    namespace: default
  spec:
    progressDeadlineSeconds: 600
    replicas: 2
    revisionHistoryLimit: 10
    selector:
      matchLabels:
        run: quote-data
    strategy:
      rollingUpdate:
        maxSurge: 25%
        maxUnavailable: 25%
      type: RollingUpdate
    template:
      metadata:
        labels:
          run: quote-data
      spec:
        containers:
        - image: quote-data:2
          imagePullPolicy: Always
          name: quote-data
          readinessProbe:
            httpGet:
              path: /api/data/health
              port: 5000
            initialDelaySeconds: 5
            periodSeconds: 5
            failureThreshold: 1
            successThreshold: 1
          ports:
          - containerPort: 5000
            protocol: TCP

Can we use the readinessprobe to disable the traffic for this pod (few minutes after the start phase) ?

In my test, the service (type: LoadBalancer) continue to send the traffic on the bad pod even if the readinessprobe is failed. In the service, the Ready status of the pod = false but the service still continues to send on the wrong pod

UPDATE : it seems work with a curl but not with Postman. I have a pods different between two request with a simple curl command. I have always the same pod with Postman

-- geffback
kubernetes

0 Answers