Unable to Connect to Ingress Controller in Azure Kubernetes Service (AKS)

jiajun luo 0 Reputation points
2024-09-24T14:08:01.9233333+00:00

I'm facing connectivity issues with my backend service deployed in Azure Kubernetes Service (AKS). Although the service and pods are running, I cannot connect to the backend through the ingress.

Deployment Details:

  1. Deployment Configuration:
    • File: aks_deployment/orbo-aks-deployment.yaml
    • Kind: Deployment
    • Namespace: ingress-basic
    • Replicas: 1
    • Container Image: orboregistry.azurecr.io/orbobackend/orbobackend-app:latest
    • Service: ClusterIP on port 80
apiVersion: apps/v1
kind: Deployment
metadata:
  name: orbobackend
  namespace: ingress-basic
spec:
  replicas: 1
  selector:
    matchLabels:
      app: orbobackend
  template:
    metadata:
      labels:
        app: orbobackend
    spec:
      containers:
      - name: orbobackend
        image: orboregistry.azurecr.io/orbobackend/orbobackend-app:latest
        ports:
        - containerPort: 80
        env:
         Some Keys
        resources:
          limits:
            cpu: 2
            memory: 13Gi
          requests:
            cpu: 500m
            memory: 4Gi 
---
apiVersion: v1
kind: Service
metadata:
  name: orbobackend
  namespace: ingress-basic
spec:
  type: ClusterIP
  selector:
    app: orbobackend
  ports:
    - port: 80
      targetPort: 80
      name: http-ws
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: backend-config
  namespace: ingress-basic
data:
  NODE_ENV: production
  1. Ingress Configuration:
    • File: ingress-basic/orbobackend-ingress.yaml
    • TLS Configured: Yes (with Let's Encrypt)
    • Host: api.orbo.finance
            apiVersion: networking.k8s.io/v1
            kind: Ingress
            metadata:
              name: orbobackend-ingress
              namespace: ingress-basic
              annotations:
                cert-manager.io/cluster-issuer: letsencrypt
                nginx.ingress.kubernetes.io/ssl-redirect: "true"
                nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
            
            spec:
              ingressClassName: nginx
              tls:
              - hosts:
                - api.orbo.finance
                secretName: orbobackend-tls-secret
              rules:
              - host: api.orbo.finance
                http:
                  paths:
                  - path: /
                    pathType: Prefix
                    backend:
                      service:
                        name: orbobackend
                        port:
                          number: 80
      

Commands and Outputs:

  • Services:
      
      kubectl get services -n ingress-basic
      
      NAME                                 TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)                      AGE
      cert-manager                         ClusterIP      10.0.46.77     
    
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,090 questions
{count} votes

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.