I would like to have a script that produces Kubernetes manifests to deploy a bare nginx container with service port 80 and ingress for host as example.nginx.com. I will deploy it into EKS cluster. Can someone give me clue?
I would like to have a script that produces Kubernetes manifests to deploy a bare nginx container with service port 80 and ingress for host as example.nginx.com. I will deploy it into EKS cluster. Can someone give me clue?
2
Answers
You must have deployed nginx-ingress to your cluster. Then run the following script at your command prompt to deploy
a bare nginx container with service port 80 and ingress for host as example.nginx.com
:Recently I started configuring NLB with Nginx controller on EKS. So documenting the complete flow with the script you needed.
I tried other approached like cloud provider based Nginx deployment but it didn’t work as expected ( instead of ELB it was creating Classic LB).
Ref- https://github.com/kubernetes/ingress-nginx/issues/6292
In short below approach is the best so far.
#kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.1/deploy/static/provider/baremetal/deploy.yaml
Create a NLB type Load Balancer on EKS. If you are choosing "internet-facing".
Create a Target Group with "Target Type" as instance and Port/Health Check Port- 31848 (HTTP).
Attach Target Group to Autoscaling group.
Create a listener on NLB (TLS- Secure TCP) and forward it to the Target Group.
Although we would be launching worker nodes on Private subnets but we need to open port "31848" for all the IP. This is how EC2 would be able to communicate with NLB.
Hope I am able to provide you clear idea on this. Please do let me know in case you face any issue.