2 pods not accessible through single Azure Application Gateway
I have 1 AppGW and 1 Public ip. i deployed two pods in AKS Cluster.
1 is accessible(IP:80) and another(IP:8080/) is not. Both POD is Created.
Is there any annonations need to be added or any kind of limitations of AppGw to access the pods.
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: aspnet-deployment
spec:
selector:
matchLabels:
app: aspnet
replicas: 1 # tells deployment to run 1 pods matching the template
template:
metadata:
labels:
app: aspnet
spec:
containers:
- name: aspnetcon
image: "mcr.microsoft.com/dotnet/core/samples:aspnetapp"
ports:
- containerPort: 80
apiVersion: v1
kind: Service
metadata:
name: aspnet-service
spec:
selector:
app: aspnet
ports:
- port: 80
protocol: TCP
targetPort: 80
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: aspnet2-deployment
spec:
selector:
matchLabels:
app: aspnet2
replicas: 1 # tells deployment to run 1 pods matching the template
template:
metadata:
labels:
app: aspsnet2
spec:
containers:
- name: aspnet2
image: "mcr.microsoft.com/dotnet/core/samples:aspnetapp"
ports:
- containerPort: 8080
apiVersion: v1
kind: Service
metadata:
name: aspnet2-service
spec:
selector:
app: aspsnet2
ports:
- port: 8080
protocol: TCP
targetPort: 8080
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: asp-ingress
annotations:
kubernetes.io/ingress.class: azure/application-gateway
spec:
rules:
- http:
paths: - path: /
backend:
serviceName: aspnet-service
servicePort: 80 - path: /tomcat
backend:
serviceName: aspsnet2-service
servicePort: 8080
I have checked with kind Pod & Deployment. all pods are created.
Please check and if info is needed. let me know