External IP unable to access and met error of cannot connect to server for my AKS.

Tan Boon Huan 20 Reputation points
2025-02-03T07:21:59.0033333+00:00

I am new to Azure and Azure Kubernetes Service.

I faced an issue that my service already received external IP, however the external IP I unable to access from browser. I did further check but I have no clue that what going on for my AKS.

Here is my YAML file (I'm hide something for security purpose):

- apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: sample-app-pod
    namespace: eccdemo-ns
  spec:
    replicas: 1
    selector:
      matchLabels:
        app: sample-app
    template:
      metadata:
        labels:
          app: sample-app
      spec:
        nodeSelector:
          kubernetes.io/os: windows
        containers:
          - name: server-container
            image: <hidden>
            env:
              - name: MONGO_DB_URI
                value: "<hidden>"
              - name: SQLITE_PATH
                value: "/data/sqlite.db"
            volumeMounts:
              - mountPath: /data
                name: eccdemo-storage
          - name: webui-container
            image: <hidden>
            ports:
              - containerPort: 80
                protocol: TCP
                name: webui-port
            volumeMounts:
              - mountPath: /data
                name: eccdemo-storage
        volumes:
        - name: eccdemo-storage
          persistentVolumeClaim:
            claimName: eccdemo-pvc
- apiVersion: v1
  kind: Service
  metadata:
    name: webui-service
    namespace: eccdemo-ns
  spec:
    selector:
      app: sample-app
    ports:
      - protocol: TCP
        name: eccdemo
        port: 80
        targetPort: webui-port
    type: LoadBalancer
- apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: eccdemo-pv
    namespace: eccdemo-ns
  spec:
    capacity:
      storage: 5Gi
    accessModes:
      - ReadWriteMany
    persistentVolumeReclaimPolicy: Retain
    storageClassName: eccdemo-storage
    hostPath:
      path: /mnt/data/eccdemo
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: eccdemo-pvc
    namespace: eccdemo-ns
  spec:
    accessModes:
      - ReadWriteMany
    resources:
      requests:
        storage: 5Gi
    storageClassName: eccdemo-storage

I also check the firewall and Network Security Group, Only NSG have one rule was deny and I not sure whether it cause the issue. Here is the Network Security Group setting:
User's image

Please guide me how to resolve it.

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,317 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Srinud 3,865 Reputation points Microsoft External Staff
    2025-02-04T18:15:33.8066667+00:00

    Hi Tan Boon Huan,
    Thank you for providing additional details and the service output.

    I have tested in my lab by checking with nginx image by deployment and service manifest and it is working. Could you please recheck setup once again and try to deploy and let me know.
    User's image

    User's image

    User's image
    If the information is helpful, please consider by clicking the "Accept answer and Upvote" on the post.If you have any further queries, please let us know in the comment. We are glad to help you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.