question

ShrikantBhagwat-6030 avatar image
0 Votes"
ShrikantBhagwat-6030 asked srbose-msft commented

install nginx ingress controller AKS

Hi
What is use of NGIX Ingress Controller ?
How do I install NGIX Controller
I have yaml file given by vendor

INGRESS CONFIGURATION *


MANDATORY in cloud deployments

ingress:
# enabled: true - To enable ingress configuration
enabled: true
annotations:
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.ingress.kubernetes.io/session-cookie-expires: "86400"
nginx.ingress.kubernetes.io/session-cookie-max-age: "86400"
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"

ac:

hosts:

# host: <dns name>

- host: lab-ac.med.umich.edu

# Enables Backend SSL between Ingress Controller and AC

https: true

paths:


# /path: AC service port to redirect traffic


/: 2443

idp:
hosts:
# host: <dns name>
- host: lab-weblogin.med.umich.edu
# Enables Backend SSL between Ingress Controller and IDP
https: true
# /path: IDP service port to redirect traffic
paths:
/nidp: 8443
ag:
hosts:
# host: <dns name>
- host: www.cloudag.com
# Enables Backend SSL between Ingress Controller and AG
https: true
# /path: AG service port to redirect traffic
paths:
/: 443
- host: dbmh.cloudag.com
# Enables Backend SSL between Ingress Controller and AG
https: false
# /path: AG service port to redirect traffic
paths:
/proxy1: 80

TLS configuration for all hosts in AC, IDP and AG


tls:
#- secretName: cloudag
# hosts:
# - www.cloudag.com
#- secretName: cloudidp
# hosts:
- lab-weblogin.med.umich.edu


Let us know Do i need to make change in yaml file.

azure-kubernetes-service
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

shivapatpi-MSFT avatar image
0 Votes"
shivapatpi-MSFT answered

Hello @ShrikantBhagwat-6030 ,
I think you have to start with basics of "Ingress" before you jump onto inginx controller.

Check out the below article which starts with "Ingress" -> "IngressController" -> "NginxIngressController"
https://github.com/nginxinc/kubernetes-ingress

Then see how NGINX Ingress Controller works behind the scenes:
https://kubernetes.github.io/ingress-nginx/how-it-works/

Once you are done with above basics , use the below document to deploy a sample POD and how to access it via NGINX Ingress controller

https://docs.microsoft.com/en-us/azure/aks/ingress-basic

Deploying NGINX Ingress Controller with example:

https://matthewpalmer.net/kubernetes-app-developer/articles/kubernetes-ingress-guide-nginx-example.html

(With above 2 running examples , I think all your above queries will be answered)
(You just need to configure/Customize the above mentioned YAML files based upon your client provided values)

Let us know if you need additional help on this .



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ShrikantBhagwat-6030 avatar image
0 Votes"
ShrikantBhagwat-6030 answered srbose-msft commented

Thanks for Documentation


Following are my nodes

PS C:\WINDOWS\system32> kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
aks-agentpool-20294322-vmss000000 Ready agent 2d11h v1.20.7 10.240.0.4 <none> Ubuntu 18.04.5 LTS 5.4.0-1051-azure containerd://1.4.4+azure
aks-agentpool-20294322-vmss000001 Ready agent 2d11h v1.20.7 10.240.0.5 <none> Ubuntu 18.04.5 LTS 5.4.0-1051-azure containerd://1.4.4+azure

Are these IP Address Private IP Address each node ?
Do they have Cluster IP ?
Are these separate standalone nodes or cluster with 2 nodes ?

I did setup Ingress Controller based on documentation

PS C:\WINDOWS\system32> kubectl --namespace default get services -o wide -w nam-ingress-ingress-nginx-controller
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
nam-ingress-ingress-nginx-controller LoadBalancer 10.0.254.117 52.147.218.30 80:30363/TCP,443:31634/TCP 24h app.kubernetes.io/component=controller,app.kubernetes.io/instance=nam-ingress,app.kubernetes.io/name=ingress-nginx

PS C:\WINDOWS\system32> kubectl get pods,svc
NAME READY STATUS RESTARTS AGE
pod/nam-ingress-ingress-nginx-controller-65d74469d9-j9r9w 1/1 Running 0 25h
pod/nginx 1/1 Running 0 25h
pod/node-debugger-aks-agentpool-20294322-vmss000000-g8xt9 0/1 Completed 0 5h2m

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 2d16h
service/nam-ingress-ingress-nginx-controller LoadBalancer 10.0.254.117 52.147.218.30 80:30363/TCP,443:31634/TCP 25h
service/nam-ingress-ingress-nginx-controller-admission ClusterIP 10.0.129.117 <none> 443/TCP 25h
PS C:\WINDOWS\system32>


I have application provided by vendor which is supposed to installed by Helm Package Manager. They require NGIX:Ingress to be configured.

Based on output above, do you think Ingress is configured ?
Thanks

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ShrikantBhagwat-6030 , Thank you for sharing the logs.

Are these IP Address Private IP Address each node ?
Do they have Cluster IP ?
Are these separate standalone nodes or cluster with 2 nodes ?

Yes 10.240.0.4 and 10.240.0.5 are the private IP addresses of the two nodes aks-agentpool-20294322-vmss000000 and aks-agentpool-20294322-vmss000001 respectively. These IP addresses are assigned to the node's Network Interface card from the Azure Virtual Network subnet associated with the particular node pool (or AKS cluster if not using unique subnets for node pools). [Reference]

Cluster IP is a ServiceType in Kubernetes and do not apply to nodes. The private IP address of the node can be reached from any device on the same Azure virtual network or connected networks.

The node pool agentpool in your AKS cluster ( which you have connected to using az aks get-credentials) has two nodes, as named above.

0 Votes 0 ·

@ShrikantBhagwat-6030 ,

Based on output above, do you think Ingress is configured ?

The NGINX ingress controller is installed. Depending upon the needs of your application you will still have to configure and deploy the Ingress Resource

0 Votes 0 ·