Kubernetes configuration is not applying correct port service mapping to app gateway

catmanjan 111 Reputation points
2022-09-12T04:01:23.65+00:00

I have an App Gateway managed by Azure Kubernetes - changes I make to my kubernetes.yaml are meant to be applied to this instance of App Gateway

2 of the services I have defined are working correctly, they have services on port 80 and port 81

For some reason the service running on port 82 is not being mapped correctly, I end up with this in my back end settings

I don't understand why this is happening given all 3 services are configured the same other than the port numbers?

apiVersion: apps/v1
kind: Deployment
metadata:
name: hydra
spec:
template:
metadata:
name: hydra
labels:
app: hydra
spec:
nodeSelector:
"kubernetes.azure.com/os-sku": Windows2022
containers:

  • name: hydra
    image: icognitionhydra.azurecr.io/hydra
    selector:
    matchLabels:
    app: hydra

apiVersion: apps/v1
kind: Deployment
metadata:
name: hydraintegrationofficeweb
spec:
template:
metadata:
name: hydraintegrationofficeweb
labels:
app: hydraintegrationofficeweb
spec:
nodeSelector:
"kubernetes.azure.com/os-sku": Windows2022
containers:

  • name: hydraintegrationofficeweb
    image: icognitionhydra.azurecr.io/hydraintegrationofficeweb
    selector:
    matchLabels:
    app: hydraintegrationofficeweb

apiVersion: apps/v1
kind: Deployment
metadata:
name: hydraintegrationteams
spec:
template:
metadata:
name: hydraintegrationteams
labels:
app: hydraintegrationteams
spec:
nodeSelector:
"kubernetes.azure.com/os-sku": Windows2022
containers:

  • name: hydraintegrationteams
    image: icognitionhydra.azurecr.io/hydraintegrationteams
    selector:
    matchLabels:
    app: hydraintegrationteams

apiVersion: v1
kind: Service
metadata:
name: hydra
spec:
ports:

  • protocol: TCP
    port: 80
    targetPort: 80
    selector:
    app: hydra

apiVersion: v1
kind: Service
metadata:
name: hydraintegrationofficeweb
spec:
ports:

  • protocol: TCP
    port: 81
    targetPort: 80
    selector:
    app: hydraintegrationofficeweb

apiVersion: v1
kind: Service
metadata:
name: hydraintegrationteams
spec:
ports:

  • protocol: TCP
    port: 82
    targetPort: 80
    selector:
    app: hydraintegrationteams

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hydra
annotations:
kubernetes.io/ingress.class: azure/application-gateway
appgw.ingress.kubernetes.io/ssl-redirect: "true"
appgw.ingress.kubernetes.io/appgw-ssl-certificate: "icognition.cloud"
spec:
rules:

  • host: hydrakubernetes.icognition.cloud
    http:
    paths:
  • path: /
    pathType: Exact
    backend:
    service:
    name: hydra
    port:
    number: 80
  • host: hydrakubernetesintegrationofficeweb.icognition.cloud
    http:
    paths:
  • path: /
    pathType: Exact
    backend:
    service:
    name: hydraintegrationofficeweb
    port:
    number: 81
  • host: hydrakubernetesintegrationteams.icognition.cloud
    http:
    paths:
  • path: /
    pathType: Exact
    backend:
    service:
    name: hydrakubernetesintegrationteams
    port:
    number: 82

239952-image.png

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
0 comments No comments
{count} votes

Answer accepted by question author
  1. srbhatta-MSFT 8,586 Reputation points Microsoft Employee
    2022-09-12T08:41:26.127+00:00

    Hello @catmanjan ,
    Welcome to Microsoft QnA!
    There is a small mistake in your Ingress manifest.
    For the third service mapping in the Ingress yaml, you have provided the service name as hydrakubernetesintegrationteams instead of hydraintegrationteams.
    Could you please check and correct that?
    I will look forward to your response (please tag me in your reply.
    Thanks.

    -------------

    If the above information helps, please accept as answer and upvote.


0 additional answers

Sort by: Most helpful

Your answer

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