{"id":14316,"date":"2020-10-09T09:23:04","date_gmt":"2020-10-09T07:23:04","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/"},"modified":"2020-10-09T09:23:04","modified_gmt":"2020-10-09T07:23:04","slug":"setup-an-nginx-ingress-controller-on-kubernetes","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/","title":{"rendered":"Setup an NGINX Ingress Controller on Kubernetes"},"content":{"rendered":"<p>One of the most important and basic concept in Kubernetes is the Service exposition. How about exposing a Kubernetes Service deployed inside a cluster to outside traffic?<br \/>\nLet&#8217;s have a look on the different approaches to expose a Kubernetes Service outside the cluster and particularly the role of the Ingress Controller.<\/p>\n<h2>NodePort, Load Balancers, and Ingress Controllers<\/h2>\n<p>In the Kubernetes world, there are three general approaches to exposing your application.<\/p>\n<h3>NodePort<\/h3>\n<p style=\"text-align: left\">A NodePort is an open port on every node of your cluster. Kubernetes transparently routes incoming traffic on the NodePort to your service, even if your application is running on a different node.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43981\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort.png\" alt=\"\" width=\"297\" height=\"320\" \/><\/a><\/p>\n<p style=\"text-align: center\"><em>Source:<a href=\"https:\/\/medium.com\/@ahmetb\">https:\/\/medium.com\/@ahmetb<\/a><\/em><\/p>\n<p>But we need to consider the following points when using NodePort:<\/p>\n<ul>\n<li>Only possible to have 1 service per port<\/li>\n<li>Limited Ports Range 30000 to 32767<\/li>\n<li>In case of node IP address change, you need to deal with that<\/li>\n<\/ul>\n<h3>LoadBalancer<\/h3>\n<p style=\"text-align: left\">Using a LoadBalancer service type automatically deploys an external load balancer. This external load balancer is associated with a specific IP address and routes external traffic to a Kubernetes service in your cluster.<\/p>\n<p style=\"text-align: center\"><em><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/LoadBalancer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44001\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/LoadBalancer.png\" alt=\"\" width=\"421\" height=\"461\" \/><\/a>Source:<a href=\"https:\/\/medium.com\/@ahmetb\">https:\/\/medium.com\/@ahmetb<\/a><\/em><\/p>\n<p>The advantage of using LoadBalancer service type is the direct exposition of your services, without routing, filtering, etc. This means you can send almost any kind of traffic to it, like HTTP, TCP, UDP, etc. The downside is that each service you expose with a LoadBalancer will get its own IP address, and you have to pay for a LoadBalancer per exposed service.<\/p>\n<h3>Ingress Controller<\/h3>\n<p>Kubernetes supports a high level abstraction called Ingress, which allows simple host or URL based HTTP(S) routing. An ingress controller is responsible for reading the Ingress Resource information and processing that data accordingly. Unlike above service, Ingress is not a type of service. It&#8217;s a smart-router acting as the entry point to the cluster for external communication.<\/p>\n<p style=\"text-align: center\"><em><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/IngressController.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-40715\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/IngressController.jpg\" alt=\"\" width=\"505\" height=\"325\" \/><\/a>Source:<a href=\"https:\/\/medium.com\/@ahmetb\">https:\/\/medium.com\/@ahmetb<\/a><\/em><\/p>\n<p>Ingress is the most powerful way to expose your services and became a standard over time. Ingress is an external component and multiple Ingress Controller exists in the market. In the rest of this blog we will see how Ingress controllers work, how to deploy them, but before we have to take into account a few points.<\/p>\n<h2>Cloud Environment vs Bare-Metal<\/h2>\n<p style=\"text-align: left\">In traditional cloud environments, network load balancers are available on-demand to become the single point of contact to the NGINX Ingress controller to external clients and, indirectly, to any application running inside the cluster.<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cloud_overview.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-40717\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cloud_overview.jpg\" alt=\"\" width=\"756\" height=\"567\" \/><\/a><\/p>\n<p style=\"text-align: center\"><em>Source:<a href=\"https:\/\/kubernetes.github.io\/ingress-nginx\/images\/baremetal\/cloud_overview.jpg\">https:\/\/kubernetes.github.io\/ingress-nginx\/images\/baremetal\/cloud_overview.jpg<\/a><\/em><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: left\">Basically this is a lack for bare-metal clusters. Therefore few recommended approaches exists to bypass this lack <em>(see here: <a href=\"https:\/\/kubernetes.github.io\/ingress-nginx\/images\/baremetal\">https:\/\/kubernetes.github.io\/ingress-nginx\/images\/baremetal<\/a>)<\/em><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/baremetal_overview.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-40718\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/baremetal_overview.jpg\" alt=\"\" width=\"756\" height=\"484\" \/><\/a><\/p>\n<p style=\"text-align: center\"><em>Source:<a href=\"https:\/\/kubernetes.github.io\/ingress-nginx\/images\/baremetal\/baremetal_overview.jpg\">https:\/\/kubernetes.github.io\/ingress-nginx\/images\/baremetal\/baremetal_overview.jpg<\/a><\/em><\/p>\n<h2>Nginx Ingress Controller combined with MetalLB<\/h2>\n<p>In this section we will describe how to use Nginx as an Ingress Controller for our cluster combined with MetalLB which will act as a network load-balancer for all incoming communications.<\/p>\n<p>The principe is simple, we will build our deployment upon ClusterIP service and use MetalLB as a software load balancer as show below:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/metallb.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44019\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/metallb.jpg\" alt=\"\" width=\"756\" height=\"447\" \/><\/a><\/p>\n<p style=\"text-align: center\"><em>Source:<a href=\"https:\/\/kubernetes.github.io\/ingress-nginx\/images\/baremetal\/user_edge.jpg\">https:\/\/kubernetes.github.io\/ingress-nginx\/images\/baremetal\/user_edge.jpg<\/a><\/em><\/p>\n<h3>MetalLB Installation<\/h3>\n<p>The official documentation can be found here: <a href=\"https:\/\/metallb.universe.tf\/\">https:\/\/metallb.universe.tf\/<\/a><\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl apply -f https:\/\/raw.githubusercontent.com\/metallb\/metallb\/v0.9.3\/manifests\/namespace.yaml\nnamespace\/metallb-system created \n\n\u279c kubectl apply -f https:\/\/raw.githubusercontent.com\/metallb\/metallb\/v0.9.3\/manifests\/metallb.yaml\npodsecuritypolicy.policy\/controller created\npodsecuritypolicy.policy\/speaker created\nserviceaccount\/controller created\nserviceaccount\/speaker created\nclusterrole.rbac.authorization.k8s.io\/metallb-system:controller created\nclusterrole.rbac.authorization.k8s.io\/metallb-system:speaker created\nrole.rbac.authorization.k8s.io\/config-watcher created\nrole.rbac.authorization.k8s.io\/pod-lister created\nclusterrolebinding.rbac.authorization.k8s.io\/metallb-system:controller created\nclusterrolebinding.rbac.authorization.k8s.io\/metallb-system:speaker created\nrolebinding.rbac.authorization.k8s.io\/config-watcher created\nrolebinding.rbac.authorization.k8s.io\/pod-lister created\ndaemonset.apps\/speaker created\ndeployment.apps\/controller created\n\n\u279c kubectl get all -n metal<\/pre>\n<p>&nbsp;<\/p>\n<h3>NGINX Ingress Installation<\/h3>\n<p>All installation details can be found here: <a href=\"https:\/\/docs.nginx.com\/nginx-ingress-controller\/installation\/installation-with-manifests\/\">https:\/\/docs.nginx.com\/nginx-ingress-controller\/installation\/installation-with-manifests\/<\/a><\/p>\n<p>Let&#8217;s start by cloning the GitHub repository:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c git clone https:\/\/github.com\/nginxinc\/kubernetes-ingress\/\n\u279c cd kubernetes-ingress\/deployments\n\u279c git checkout v1.7.2<\/pre>\n<p>Create the namespace and the service account<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl create -f common\/ns-and-sa.yaml\nnamespace\/nginx-ingress created\nserviceaccount\/nginx-ingress created<\/pre>\n<p>Create the cluster role and the cluster role binding:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl create -f rbac\/rbac.yaml\nclusterrole.rbac.authorization.k8s.io\/nginx-ingress created\nclusterrolebinding.rbac.authorization.k8s.io\/nginx-ingress created<\/pre>\n<p>Create the secret with a TLS certificate for the default server (only for testing purpose):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl create -f common\/default-server-secret.yaml<\/pre>\n<p>Create the default config map:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl create -f common\/nginx-config.yaml\nconfigmap\/nginx-config created<\/pre>\n<p>Create the CRDs for VirtualServer and VirtualServerRoute and TransportServer:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl create -f common\/vs-definition.yaml\n\u279c kubectl create -f common\/vsr-definition.yaml\n\u279c kubectl create -f common\/ts-definition.yaml\ncustomresourcedefinition.apiextensions.k8s.io\/virtualservers.k8s.nginx.org created \ncustomresourcedefinition.apiextensions.k8s.io\/virtualserverroutes.k8s.nginx.org created \ncustomresourcedefinition.apiextensions.k8s.io\/transportservers.k8s.nginx.org created<\/pre>\n<p>For TCP and UDP loadbalancing, create the CRD for GlobalConfiguration:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl create -f common\/gc-definition.yaml\ncustomresourcedefinition.apiextensions.k8s.io\/globalconfigurations.k8s.nginx.org created\n\n\u279c kubectl create -f common\/global-configuration.yaml\nglobalconfiguration.k8s.nginx.org\/nginx-configuration created<\/pre>\n<p>Deploy the Ingress Controller as a Deployment to only deploy it on worker nodes<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl create -f deployment\/nginx-ingress.yaml<\/pre>\n<p>Check the deployment status:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl get deployment -o wide -n nginx-ingress\nNAME            READY   UP-TO-DATE   AVAILABLE   AGE     CONTAINERS      IMAGES                      SELECTOR\nnginx-ingress   1\/1     1            1           3m51s   nginx-ingress   nginx\/nginx-ingress:1.7.2   app=nginx-ingress<\/pre>\n<p>Increase the number of replicas:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl scale --replicas=3 deployment\/nginx-ingress -n nginx-ingress\ndeployment.apps\/nginx-ingress scaled<\/pre>\n<p>Check the pods deployment status now:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl get pods -o wide -n nginx-ingress\nNAME                             READY   STATUS    RESTARTS   AGE   IP          NODE                                      NOMINATED NODE   READINESS GATES\nnginx-ingress-577f8dff74-69j7w   1\/1     Running   0          21m   10.60.1.3   gke-dbi-test-default-pool-2f971eed-0b39              \nnginx-ingress-577f8dff74-gdgf9   1\/1     Running   0          12s   10.60.2.5   gke-dbi-test-default-pool-2f971eed-7clq              \nnginx-ingress-577f8dff74-nfpbd   1\/1     Running   0          34m   10.60.2.4   gke-dbi-test-default-pool-2f971eed-7clq<\/pre>\n<p>We can observe that 2 ingress controller pods have been deployed on each worker nodes. The deployment is now completed.<\/p>\n<h4>External Access to Ingress Controller<\/h4>\n<p>To get access from outside the cluster we will create a service in LoadBalancer mode:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl create -f service\/loadbalancer.yaml\nservice\/nginx-ingress created<\/pre>\n<p>Then we can track the status of the service until we get the external IP address:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl get svc -w -n nginx-ingress\nNAME            TYPE           CLUSTER-IP    EXTERNAL-IP      PORT(S)                      AGE\nnginx-ingress   LoadBalancer   10.3.247.17   pending          80:32420\/TCP,443:30400\/TCP   33s\nnginx-ingress   LoadBalancer   10.3.247.17   35.225.196.151   80:32420\/TCP,443:30400\/TCP   39s<\/pre>\n<p>&nbsp;<\/p>\n<h2>Nginx Web Server deployment<\/h2>\n<p>Once the ingress controller is deployed and configured, we can deploy our application and test the external access.<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279cvi nginx-deploy.yaml \napiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  labels:\n    run: nginx\n  name: nginx-deploy\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      run: nginx-deploy\n  template:\n    metadata:\n      labels:\n        run: nginx-deploy\n    spec:\n      containers:\n      - image: nginx\n        name: nginx\n\n\u279c kubectl create -f nginx-deploy.yaml -n default<\/pre>\n<p>Then create a service ClusterIP for our deployment: <\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c kubectl expose deploy\/nginx-deploy --port 80 -n default\nservice\/nginx-deploy exposed\n\n\u279c kubectl get svc -n default\nNAME                        TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)   AGE\nservice\/nginx-deploy        ClusterIP   10.3.240.25           80\/TCP    4s<\/pre>\n<p>The ultime step is to create an ingress rule to route requests coming from nginx.example.com to the service nginx-deploy:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\u279c vi ingress-nginx-deploy.yaml\napiVersion: networking.k8s.io\/v1beta1\nkind: Ingress\nmetadata:\n  name: ingress-nginx-deploy\nspec:\n  rules:\n  - host: nginx.example.com\n    http:\n      paths:\n      - backend:\n          serviceName: nginx-deploy\n          servicePort: 80\n\n\u279c kubectl create -f ingress-nginx-deploy.yaml\ningress.networking.k8s.io\/ingress-nginx-deploy created\n\n\u279c kubectl describe ing ingress-nginx-deploy\nName:             ingress-nginx-deploy\nNamespace:        default\nAddress:\nDefault backend:  default-http-backend:80 (10.0.0.10:8080)\nRules:\n  Host               Path  Backends\n  ----               ----  --------\n  nginx.example.com\n                        nginx-deploy:80 (10.0.1.5:80)\nAnnotations:         \nEvents:<\/pre>\n<p>&nbsp;<\/p>\n<p>Open a web browser a test if our application is reachable from outside the cluster:<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Screenshot-2020-10-09-at-09.18.58.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/Screenshot-2020-10-09-at-09.18.58.png\" alt=\"\" width=\"671\" height=\"529\" class=\"aligncenter size-full wp-image-44050\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the most important and basic concept in Kubernetes is the Service exposition. How about exposing a Kubernetes Service deployed inside a cluster to outside traffic? Let&#8217;s have a look on the different approaches to expose a Kubernetes Service outside the cluster and particularly the role of the Ingress Controller. NodePort, Load Balancers, and [&hellip;]<\/p>\n","protected":false},"author":109,"featured_media":14324,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197,955,1320,1504,1522],"tags":[],"type_dbi":[],"class_list":["post-14316","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-integration-middleware","category-cloud","category-devops","category-docker","category-kubernetes"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Setup an NGINX Ingress Controller on Kubernetes - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setup an NGINX Ingress Controller on Kubernetes\" \/>\n<meta property=\"og:description\" content=\"One of the most important and basic concept in Kubernetes is the Service exposition. How about exposing a Kubernetes Service deployed inside a cluster to outside traffic? Let&#8217;s have a look on the different approaches to expose a Kubernetes Service outside the cluster and particularly the role of the Ingress Controller. NodePort, Load Balancers, and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-09T07:23:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"541\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DevOps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DevOps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/\"},\"author\":{\"name\":\"DevOps\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735\"},\"headline\":\"Setup an NGINX Ingress Controller on Kubernetes\",\"datePublished\":\"2020-10-09T07:23:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/\"},\"wordCount\":781,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg\",\"articleSection\":[\"Application integration &amp; Middleware\",\"Cloud\",\"DevOps\",\"Docker\",\"Kubernetes\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/\",\"name\":\"Setup an NGINX Ingress Controller on Kubernetes - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg\",\"datePublished\":\"2020-10-09T07:23:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg\",\"width\":500,\"height\":541},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setup an NGINX Ingress Controller on Kubernetes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735\",\"name\":\"DevOps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g\",\"caption\":\"DevOps\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/devops\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Setup an NGINX Ingress Controller on Kubernetes - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/","og_locale":"en_US","og_type":"article","og_title":"Setup an NGINX Ingress Controller on Kubernetes","og_description":"One of the most important and basic concept in Kubernetes is the Service exposition. How about exposing a Kubernetes Service deployed inside a cluster to outside traffic? Let&#8217;s have a look on the different approaches to expose a Kubernetes Service outside the cluster and particularly the role of the Ingress Controller. NodePort, Load Balancers, and [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/","og_site_name":"dbi Blog","article_published_time":"2020-10-09T07:23:04+00:00","og_image":[{"width":500,"height":541,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg","type":"image\/jpeg"}],"author":"DevOps","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DevOps","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/"},"author":{"name":"DevOps","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735"},"headline":"Setup an NGINX Ingress Controller on Kubernetes","datePublished":"2020-10-09T07:23:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/"},"wordCount":781,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg","articleSection":["Application integration &amp; Middleware","Cloud","DevOps","Docker","Kubernetes"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/","url":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/","name":"Setup an NGINX Ingress Controller on Kubernetes - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg","datePublished":"2020-10-09T07:23:04+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/NodePort-e1602161535709.jpg","width":500,"height":541},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/setup-an-nginx-ingress-controller-on-kubernetes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Setup an NGINX Ingress Controller on Kubernetes"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/4cd1b5f8a3de93f05a16ab8d7d2b7735","name":"DevOps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cdd2dd7441774355062c0f0f68612296b059cd1e2ff6c7af0b15dba0ed64a85f?s=96&d=mm&r=g","caption":"DevOps"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/devops\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/14316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=14316"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/14316\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/14324"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=14316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=14316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=14316"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=14316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}