{"id":19052956,"url":"https://github.com/kayvansol/ingress","last_synced_at":"2025-08-19T15:04:27.379Z","repository":{"id":225546565,"uuid":"766223473","full_name":"kayvansol/Ingress","owner":"kayvansol","description":"NGINX Ingress Controller for Kubernetes (Microservices)","archived":false,"fork":false,"pushed_at":"2024-03-28T06:38:45.000Z","size":1647,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T00:44:19.773Z","etag":null,"topics":["acme","cert-manager","certificate","haproxy","ingress-controller","ingress-nginx","kubernetes","letsencrypt","nginx-ingress","tls","ubuntu"],"latest_commit_sha":null,"homepage":"https://medium.com/@kayvan.sol2/nginx-ingress-controller-in-kubernetes-3438479fe11c","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kayvansol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-02T17:11:13.000Z","updated_at":"2025-01-15T07:40:59.000Z","dependencies_parsed_at":"2024-03-05T14:45:03.133Z","dependency_job_id":"c300d2a7-b17b-4ca5-a5d2-485c582220a6","html_url":"https://github.com/kayvansol/Ingress","commit_stats":null,"previous_names":["kayvansol/ingress"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kayvansol/Ingress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FIngress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FIngress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FIngress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FIngress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayvansol","download_url":"https://codeload.github.com/kayvansol/Ingress/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FIngress/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271173091,"owners_count":24711665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acme","cert-manager","certificate","haproxy","ingress-controller","ingress-nginx","kubernetes","letsencrypt","nginx-ingress","tls","ubuntu"],"created_at":"2024-11-08T23:28:35.330Z","updated_at":"2025-08-19T15:04:27.358Z","avatar_url":"https://github.com/kayvansol.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\nSetting up **Ingress controller NGINX** (as a router) along with HAproxy for Microservice deployed inside **Kubernetes cluster** (Bare-metal servers) \n\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/kubernetes-nginx.jpg?raw=true)\n\nGeneral Design (big picture) :\n\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/Plan.jpg?raw=true)\n\nAll files needed for deployments are available at Manifests folder.\n\nThe control-plane \u0026 worker nodes addresses are :\n```\n192.168.56.115\n192.168.56.116\n192.168.56.117\n```\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/vmnet.png?raw=true)\n\nand HAProxy as a Load Balancer :\n```\n192.168.56.118\n```\n\nKubernetes cluster nodes :\n\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/nodes.png?raw=true)\n\n\nThe Steps :\n\n1) Install NGINX Ingress Controller from :\n```\nhttps://docs.k0sproject.io/main/examples/nginx-ingress\n```\n\n```\nkubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.3/deploy/static/provider/baremetal/deploy.yaml\n\nkubectl get all --namespace=ingress-nginx\n```\nIngress-Nginx workloads (ingress port in our case is **30798**) :\n\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/Nginx%20Ingress.png?raw=true)\n\n***\n2) On the node, where the POD will be located (node1 and node2 in our case) :\n```\nDIRNAME=\"vol1\"\nmkdir -p /mnt/disk/$DIRNAME \nchcon -Rt svirt_sandbox_file_t /mnt/disk/$DIRNAME\nchmod 777 /mnt/disk/$DIRNAME\n```\n\n***\n3) Deploy the Storage Class \u0026 PV \u0026 PVC :\n```\nkubectl apply -f storageClass.yaml\n\nkubectl apply -f persistentVolume.yaml\nkubectl apply -f persistentVolume1.yaml\n\nkubectl apply -f persistentVolumeClaim.yaml\nkubectl apply -f persistentVolumeClaim1.yaml\n```\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/pvc.png?raw=true)\n\n***\n4) Deploy the **web apps** :\n```\nkubectl apply -f http-pod.yaml\nkubectl apply -f http-pod1.yaml\n```\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/deploymentds.png?raw=true)\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/pods.png?raw=true)\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/PodDesciption.png?raw=true)\n\n\nGet pod ip \u0026 curl the related web app :\n```\nPOD_IP=$(kubectl get pod www2-c5644ff98-trk4d  -o yaml | grep podIP | awk '{print $2}'); echo $POD_IP\n\ncurl $POD_IP\n```\n\n***\n5) Deploy the **Services** :\n```\nkubectl apply -f IngressService.yaml\nkubectl apply -f IngressService1.yaml\n```\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/svc.png?raw=true)\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/svcDesc.png?raw=true)\n\n***\n6) Deploy the **Ingress resource** :\n```\nkubectl apply -f Ingress.yaml\n```\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/ingress.png?raw=true)\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/ingressDesc.png?raw=true)\n\nNote: you can also Secure NGINX-ingress via this [Securing NGINX-ingress](https://cert-manager.io/docs/tutorials/acme/nginx-ingress/)\n\n***\n7) HAProxy config as a **Load Balancer** (On 192.168.56.118) :\n```\nsudo nano /etc/haproxy/haproxy.cfg\n```\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/haproxy.png?raw=true)\n\n***\n8) DNS Record (On DNS Server) :\n\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/dns.png?raw=true)\n\n***\nThe final results are 🍹 :\n\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/web.png?raw=true)\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/app.png?raw=true)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayvansol%2Fingress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayvansol%2Fingress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayvansol%2Fingress/lists"}