AKS, ingress is not getting IP to access the application,how to fix that?

Uday Kiran Reddy (ureddy) 86 Reputation points
2021-09-28T07:37:06.483+00:00

I have tried setting up ingress route to my azure kubernetes deployed sample app.

Steps I followed.

Get the resource group name of the AKS cluster

az aks show --resource-group aks-rg1 --name aksdemo1 --query nodeResourceGroup -o tsv

TEMPLATE - Create a public IP address with the static allocation

az network public-ip create --resource-group <REPLACE-OUTPUT-RG-FROM-PREVIOUS-COMMAND> --name myAKSPublicIPForIngress --sku Standard --allocation-method static --query publicIp.ipAddress -o tsv

Add the official stable repository

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update

Customizing the Chart Before Installing.

helm show values ingress-nginx/ingress-nginx

Use Helm to deploy an NGINX ingress controller

helm install ingress-nginx ingress-nginx/ingress-nginx \
--namespace ingress-basic \
--set controller.replicaCount=2 \
--set controller.nodeSelector."beta.kubernetes.io/os"=linux \
--set defaultBackend.nodeSelector."beta.kubernetes.io/os"=linux \
--set controller.service.externalTrafficPolicy=Local \
--set controller.service.loadBalancerIP="REPLACE_STATIC_IP"

Then I deployed the sample app from this link.

But the app is not accessible.

Access Public IP

http://<Public-IP-created-for-Ingress>/app1

The ingress controller logs shared below.

PS D:\azure-aks-kubernetes-masterclass\09-Ingress-Basic\kube-manifests> kubectl logs ingress-nginx-controller-9578fc8f6-hjlnv -n ingress-basic -f

NGINX Ingress controller
Release: v1.0.2
Build: 2b8ed4511af75a7c41e52726b0644d600fc7961b
Repository: https://github.com/kubernetes/ingress-nginx
nginx version: nginx/1.19.9


W0927 17:40:01.317908 6 client_config.go:615] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
I0927 17:40:01.318702 6 main.go:221] "Creating API client" host="https://10.0.0.1:443"
I0927 17:40:01.354032 6 main.go:265] "Running in Kubernetes cluster" major="1" minor="20" git="v1.20.9" state="clean" commit="8dc42052754bfacb111a0426830122dd9cc9cfa0" platform="linux/amd64"
I0927 17:40:01.502032 6 main.go:104] "SSL fake certificate created" file="/etc/ingress-controller/ssl/default-fake-certificate.pem"
I0927 17:40:01.549219 6 ssl.go:531] "loading tls certificate" path="/usr/local/certificates/cert" key="/usr/local/certificates/key"
I0927 17:40:01.571470 6 nginx.go:253] "Starting NGINX Ingress controller"
I0927 17:40:01.584359 6 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-basic", Name:"ingress-nginx-controller", UID:"affe6d38-f399-4929-967e-67061b738e3b", APIVersion:"v1", ResourceVersion:"8317", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-basic/ingress-nginx-controller
I0927 17:40:02.773047 6 nginx.go:295] "Starting NGINX process"
I0927 17:40:02.773531 6 nginx.go:315] "Starting validation webhook" address=":8443" certPath="/usr/local/certificates/cert" keyPath="/usr/local/certificates/key"
I0927 17:40:02.773738 6 leaderelection.go:243] attempting to acquire leader lease ingress-basic/ingress-controller-leader...
I0927 17:40:02.773905 6 controller.go:152] "Configuration changes detected, backend reload required"
I0927 17:40:02.789064 6 leaderelection.go:253] successfully acquired lease ingress-basic/ingress-controller-leader
I0927 17:40:02.789340 6 status.go:84] "New leader elected" identity="ingress-nginx-controller-9578fc8f6-hjlnv"
I0927 17:40:02.897910 6 controller.go:169] "Backend successfully reloaded"
I0927 17:40:02.898159 6 controller.go:180] "Initial sync, sleeping for 1 second"
I0927 17:40:02.898589 6 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress-basic", Name:"ingress-nginx-controller-9578fc8f6-hjlnv", UID:"d88b6460-368d-4156-b1a8-9bdb30bdfc52", APIVersion:"v1", ResourceVersion:"8356", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
209.141.62.185 - - [27/Sep/2021:18:53:19 +0000] "GET /config/getuser?index=0 HTTP/1.1" 400 248 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0" 353 0.000 [] [] - - - - ad9c31387cf13faaaed73c67ff78dd27
20.97.55.151 - - [27/Sep/2021:19:51:39 +0000] "l\x00\x0B\x00\x00\x00\x00\x00\x00\x00\x00\x00" 400 150 "-" "-" 0 0.040 [] [] - - - - 68f5a9c8b6f76bab718613be192e1e02
2021/09/27 19:55:41 [crit] 31#31: *66716 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 192.241.206.169, server: 0.0.0.0:443
209.17.96.58 - - [27/Sep/2021:19:59:12 +0000] "\x16\x03\x01\x00\xE3\x01\x00\x00\xDF\x03\x03\x00\xFCF/\xBD\x22\xC5\x8F3\xBB\xF2c}1\xA0\xDD\xB5\xA0\x08\xDBv\xA2ja\xA1" 400 150 "-" "-" 0 0.116 [] [] - - - - 0cd415178055e87a8fb58b334cbf2156
209.141.62.185 - - [28/Sep/2021:00:20:21 +0000] "GET /config/getuser?index=0 HTTP/1.1" 400 248 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0" 353 0.000 [] [] - - - - 101af78e52d99ed67b0889ca7cee119c
107.189.31.252 - - [28/Sep/2021:01:56:55 +0000] "GET /config/getuser?index=0 HTTP/1.1" 400 248 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0" 353 0.000 [] [] - - - - cb1a101e785c3352934c4b58e322470c
61.219.11.151 - - [28/Sep/2021:05:28:34 +0000] "dN\x93\xB9\xE6\xBCl\xB6\x92\x84:\xD7\x03\xF1N\xB9\xC5;\x90\xC2\xC6\xBA\xE1I-\x22\xDDs\xBA\x1FgC:\xB1\xA7\x80+\x00\x00\x00\x00%\xFDK:\xAAW.|J\xB2\xB5\xF5'\xA5l\xD3V(\xB7\x01%(CsK8B\xCE\x9A\xD0z\xC7\x13\xAD" 400 150 "-" "-" 0 0.196 [] [] - - - - 67605ede9b5eb3b67bf1fe2fe753be47
34.65.61.194 - - [28/Sep/2021:06:25:47 +0000] "GET / HTTP/1.1" 400 150 "-" "-" 24 0.980 [] [] - - - - 97c8fadff2f4bc4b87fee1a068475a59
I0928 06:54:03.592755 6 store.go:361] "Ignoring ingress because of error while validating ingress class" ingress="test/nginxapp1-ingress-service" error="ingress does not contain a valid IngressClass"
I0928 07:27:42.059786 6 store.go:336] "Ignoring ingress because of error while validating ingress class" ingress="test/nginxapp1-ingress-service" error="ingress does not contain a valid IngressClass"
I0928 07:28:02.371679 6 store.go:361] "Ignoring ingress because of error while validating ingress class" ingress="default/nginxapp1-ingress-service" error="ingress does not contain a valid IngressClass"

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.
1,978 questions
{count} votes