not showing endpoint for service in AKS and label and selectors are mis match

hi i’m new to AKS (azure kubernetes service) below is my YAML which creates service(php-svc) and pod(wordpressb). there are two issues i’m facing.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: wordpressb
spec:
  replicas: 1
  selector:
    matchlabels:
      app: wordpressb
  template:
    metadata:
      labels:
        app: wordpressb
    spec:
      containers:
      - name: wordpressb
        image: acrakswordpress.azurecr.io/wordpress:v1
        ports:
          - containerPort: 80
        env:
        - name: DATABASE_HOST
          value: "<<serverName>>.mysql.database.azure.com"
        - name: DATABASE_USERNAME
          value: "<<dbName>>"
        - name: DATABASE_PASSWORD
          value: "<<dbPassword>>"
        - name: DATABASE_NAME
          value: "<<dbName>>"
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
                - key: "app"
                  operator: In
                  value: wordpressb
            topologyKey: "kubernetes.io/hostname"

apiVersion: v1
kind: Service
metadata:
  name: php-svc
spec:
  type: LoadBalancer
  ports:
    - port: 80
  selector:
    app: wordpressb
  1. nothing shows up when i try to access the external IP address of service – my best guess is it’s not working as there is no end point in the service – below shows when i execute kubectl describe service php-svc
Name:                     php-svc
Namespace:                default
Labels:                   <none>
Annotations:              <none>
Selector:                 app=wordpressb
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.0.74.48
IPs:                      10.0.74.48
LoadBalancer Ingress:     52.140.2.45
Port:                     <unset>  80/TCP
TargetPort:               80/TCP
NodePort:                 <unset>  30580/TCP
Endpoints:                <none>
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type    Reason                Age   From                Message
  ----    ------                ----  ----                -------
  Normal  EnsuringLoadBalancer  44s   service-controller  Ensuring load balancer
  Normal  EnsuredLoadBalancer   34s   service-controller  Ensured load balancer
  1. base on my understanding this issue is due to label-selector mismatch. it is matching in the YAML code (mentioned above) – but mismatched when executing it – below shows when i execute kubectl describe pod wordpress-blog
Name:             wordpress-blog
Namespace:        default
Priority:         0
Service Account:  default
Node:             aks-nodepool1-41875026-vmss000000/10.224.0.5
Start Time:       Sun, 19 May 2024 21:48:19 +0530
Labels:           run=wordpress-blog
Annotations:      <none>
Status:           Running
IP:               10.244.1.17
IPs:
  IP:  10.244.1.17
Containers:
  wordpress-blog:
    Container ID:   containerd://758ad6ebc7cb0603e0bfed305070a3c990b6cc318069c73fb1649ec1555183a7
    Image:          wordpress
    Image ID:       docker.io/library/wordpress@sha256:f468bab53528df6f87dfe11a80de26eff57e0f515e243d9dec73a02c80c273a7
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Sun, 19 May 2024 21:48:22 +0530
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-jfb56 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  kube-api-access-jfb56:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:                      <none>

ideally i should see wordpress page when i try to hit external IP address of the service (php-svc)

New contributor

devTeam Monconnect is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

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