I am trying to get readiness probe to work for a pod

I am trying to get kubernetes readiness probe to work for a deployment running on AKS. The cluster I am deploying to has 3 nodes with 1 tainted with node.kubernetes.io/unschedulable:NoSchedule. There are no other taints on any of the other nodes.

Let’s say the 2 nodes without the taint names are node1 and node2.

My deployment yaml look like this:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-test
spec:
  selector:
    matchLabels:
      web-app: my-test
  replicas: 2
  strategy:
    type: ~
  template:
    metadata:
      name: my-test
      labels:
        web-app: my-test
    spec:
      containers:
        - name: my-test
          image: myacr.azurecr.io/mytest:latest
          readinessProbe:
            httpGet:
              path: /api/mytest/readiness
              port: 5878
            initialDelaySeconds: 3
            periodSeconds: 3
            timeoutSeconds: 1

When I deploy the yaml with kubectl apply -f .my-deployment.yaml.

The result is the first POD goes to 1/1 Running as it should, but the second one stays as 0/1 Running. When I do command kubectl describe pod, it states Warning Unhealthy 2m26s kubelet Readiness probe failed: Get "http://10.122.0.145:5878/api/mytest/readiness": dial tcp 10.122.0.145:5878: i/o timeout (Client.Timeout exceeded while awaiting headers)

If I take out the readinessProbe from the deployment, as shown below:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-test
spec:
  selector:
    matchLabels:
      web-app: my-test
  replicas: 2
  strategy:
    type: ~
  template:
    metadata:
      name: my-test
      labels:
        web-app: my-test
    spec:
      containers:
        - name: my-test
          image: myacr.azurecr.io/mytest:latest

Both pods work with 1/1 Running, as they should. I can also tell the traffic is going to both pods. I can also tell a Pod is deployed on each node, one on node1 and the other on node2.

So now I tried adding the readinessProbe back into the deployment, this time forcing both pods on 1 node as shown below:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-test
spec:
  selector:
    matchLabels:
      web-app: my-test
  replicas: 2
  strategy:
    type: ~
  template:
    metadata:
      name: my-test
      labels:
        web-app: my-test
        spec:
      nodeSelector:
        kubernetes.io/hostname: [node1|node2]
    spec:
      containers:
        - name: my-test
          image: myacr.azurecr.io/mytest:latest

[node1|node2] This means I tested on both node1 and node2.

If I only deploy it to node1, everything works. Both Pods work and both go to state 1/1 Running

If I only deploy it to node2, neither work. When doing command kubectl describe pod on both pods, it states 0/1 Running with error Warning Unhealthy 2m26s kubelet Readiness probe failed: Get "http://10.122.0.145:5878/api/mytest/readiness": dial tcp 10.122.0.145:5878: i/o timeout (Client.Timeout exceeded while awaiting headers)

I am really not sure why node2 is not able to respond to the readinessProbe like node1. If I deploy without the readinessProbe, node2 responds to http request without an issue.

What exactly am I doing wrong here?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật