aac
aac

Reputation: 591

How to create Kubernetes Ingress for AWS

I am trying to deploy microservices architecture on kubernetes cluster, do any one knows how to create ingress for AWS.

Upvotes: 2

Views: 1199

Answers (3)

Chris
Chris

Reputation: 59

Creating an AWS Load Balancer controller ingress require some steps:

  • Creating IAM role and policy with permissions to access AWS account.
  • Create Kubernetes namespace and service account to associated to the IAM role.
  • Associate the IAM role to service account.
  • Deploy AWS Load Balancer controller using helm or yaml manifest. However, seem the esiest way is using helm. For more detail, you check follow the document: Deploy AWS Load Balancer controller on Elastic Kubernetes Service (Update 2023)

Upvotes: 0

Samrat Priyadarshi
Samrat Priyadarshi

Reputation: 518

To create an Ingress Resource we first need to deploy Ingress Controller. Ingress Controller can be very easily deployed using helm. Follow the below steps to install Helm and ingress Controller:

$ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
$ chmod 700 get_helm.sh
$ ./get_helm.sh
$ Kubectl createserviceaccount --namespace kube-system tiller
$ Kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin  --serviceaccount=kube-system:tiller
$ helm init --service-acount=tiller
$ helm install stable/nginx-ingress --name my-nginx --set rbac.create=true

Once Ingress Controller is installed check it by running kubectl get pods and you should see 2 pods running. One is the Ingress Controller and the second is Default Backend.

And now if you will go to your AWS Management Console, you should see an Elastic Load Balancer running which routes traffic to ingress controller which in turn routes traffic to appropriate services based on appropriate rules.

To test Ingress Follow Steps 1 to 4 of this link here: Setting up HTTP Load Balancing with Ingress

Hope this helps!

Upvotes: 1

Paulo Schreiner
Paulo Schreiner

Reputation: 1046

I recommend you use the ALB Ingress Controller https://github.com/kubernetes-sigs/aws-alb-ingress-controller, as it is recommended by AWS and creates Application Load Balancers for each Ingress.

Alternatively, know that you can use any kind of Ingress, such as Nginx, in AWS. You will create the Nginx Service of type LoadBalancer, so that all requests to that address are redirected to Nginx. Nginx itself will take care to redirect the requests to the correct service inside Kubernetes.

Upvotes: 3

Related Questions