Reasonable Doubt

Two graves in 3 weeks. Technically 4 graves, but they count as two monuments. Ironically, both these grave visits were after auspicious events. The first, the tomb of Sambhaji Maharaj in Tulapur…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Run Ingress controller in KUBERNETES Cluster on AWS

Hello Everyone. I am very excited to write about how to implement ingress controller in kubernetes because I implemented it successfully after my days of efforts and struggle. No worries, I’ll explain everything in detail

The ingress controller can be configured to route the different traffic to all your apps based on HTTP rules. You can use ingress controller on HTTP and HTTPS enabled apps.

One great tool to enable this approach is External DNS. This tool automatically creates DNS records in your external DNS server(route53). For every hostname that you will use in ingress, it will create a new record in route53 to send the traffic to load balancer.

There are a lot of DNS providers like Google cloud DNS, AzureDNS, DigitalOcean etc but here in this blog, I’ll be using Route53.

HOW IT WORKS:

Reference picture (Learn kubernetes: Edward Viaene)

Step by step implementation of HOW IT WORKS section:

This will update IAM user policies so that creating, listing record set in route53 can work. Add below written code to iam-policy.sh file and run this:

run ./iam-policy.sh

2. Run your deployments and services

kubectl apply -f helloworld.yml

Likewise, you can create as many deployments and services as your application modules require.

3. Create nginx-ingress-controller

As I explained in HOW IT WORKS section that we will have to create two pods so this will create first pod Nginx Controller.

kubectl apply -f nginx-ingress-controller.yml

4. Create a load balancer for ingress on the cluster

As explained above, here we are going to create an ingress service of type load balancer. Run this command :

kubectl apply -f ingress-lb.yml

5. Create external DNS

Here we are now going to create the other pod for External DNS which is going to create a record set in Route53.

kubectl apply -f external-dns.yml

6. Create ingress rules

Now we are going to write ingress rules. You will write as many rules as your total number of hosts. And here my host helloworldv1.kubernetes.example.com goes to helloworld-v1 service and helloworldv2.kubernetes.example.com goes to helloworld-v2 service. Apply this command:

kubectl apply -f ingress-rules.yml

You can now see running pods using “kubectl get pods”. You should be able to see echoheaders, nginx ingress controller, external dns, hosts (helloworldv1, helloworldv2).

We are almost done! Now go to the browser and enter the hostname helloworldv1.kubernetes.example.com and you should be able to see your application running on .

This is because the External DNS created the DNS record and it pointed to load balancer and load balancer pointed to ingress and ingress has all the correct rules.

So this is External DNS set up which you can use to have your DNS names automatically added.

Keep reading and appreciating for writing good articles. Cheers!

Add a comment

Related posts:

How Smarttrade Coin Is Changing The Crypto Trading Landscape With An Integration Of The Biggest Exchanges Out There?

While the profits are still pouring high in the crypto market, the traders are facing dilemmas, and challenges in trading these digital assets due to various reasons and one of the major reason are…

How To Begin Building A Relationship With A New Customer

This piece is a part of a series of posts dedicated to helping you create new customers for your business. The other pieces, How To Find YOUR Customer and Find and Fill Gaps will help you identify…

HIV Duo Combo Test

The HIV Duo Combo Test, also known as the fourth-generation HIV test, is a highly effective screening method that combines the detection of HIV antibodies and antigens in the blood. This test is…