{"id":482663,"date":"2022-08-09T11:04:47","date_gmt":"2022-08-09T08:04:47","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/"},"modified":"2022-08-09T11:04:47","modified_gmt":"2022-08-09T08:04:47","slug":"how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/","title":{"rendered":"#How to Set Up an NGINX Ingress Controller on DigitalOcean Kubernetes"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2aa861a7f1d\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2aa861a7f1d\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#%E2%80%9CHow_to_Set_Up_an_NGINX_Ingress_Controller_on_DigitalOcean_Kubernetes%E2%80%9D\" >&#8220;How to Set Up an NGINX Ingress Controller on DigitalOcean Kubernetes&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#Getting_Started\" >Getting Started<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#What_Are_1-Click_Apps\" >What Are 1-Click Apps?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#Installing_NGINX_Ingress_With_the_1-Click_App\" >Installing NGINX Ingress With the 1-Click App<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#Using_Your_Ingress_Controller\" >Using Your Ingress Controller<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#Adding_HTTPS\" >Adding HTTPS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#Managing_Your_NGINX_Ingress_Installation\" >Managing Your NGINX Ingress Installation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#Removing_NGINX_Ingress_From_Your_Cluster\" >Removing NGINX Ingress From Your Cluster<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#Installing_NGINX_Ingress_With_Doctl\" >Installing NGINX Ingress With Doctl<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/#Summary\" >Summary<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CHow_to_Set_Up_an_NGINX_Ingress_Controller_on_DigitalOcean_Kubernetes%E2%80%9D\"><\/span>&#8220;How to Set Up an NGINX Ingress Controller on DigitalOcean Kubernetes&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<div>\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-808473\" data-pagespeed-no-defer=\"\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/Kubernetes-DigitalOcean.jpeg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Graphic showing the DigitalOcean and Kubernetes logos\" width=\"1600\" height=\"900\"\/><\/p>\n<p>DigitalOcean\u2019s Managed Kubernetes service simplifies provisioning and maintaining Kubernetes clusters. The platform provides a ready-to-use foundation for containerized workloads with one-click support for common addon <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>lications.<\/p>\n<p>In this article, we\u2019ll show how to use one of these addons to set up an NGINX Ingress controller in your cluster. Ingresses provide a mechanism for routing external traffic to your services based on rules such as hostname, path, and headers. <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.github.io\/ingress-nginx\">NGINX Ingress<\/a> is one of the most popular Ingress controllers; it uses the NGINX web server as a reverse proxy that directs incoming traffic to the correct Kubernetes service.<\/p>\n<h2 id=\"getting-started\"><span class=\"ez-toc-section\" id=\"Getting_Started\"><\/span>Getting Started<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You should create a Kubernetes cluster in your DigitalOcean account before you follow this tutorial. We\u2019ll also assume you\u2019re familiar with the basics of using Kubernetes, Kubectl, and DigitalOcean\u2019s cloud control panel.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-808474\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-30-at-14-17-35-Kubernetes-clusters-DigitalOcean.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"image of Kubernetes clusters in the DigitalOcean control panel\" width=\"1280\" height=\"648\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Begin by logging into to your DigitalOcean control panel, clicking the \u201cKubernetes\u201d link in the left sidebar, and selecting your cluster on the page that appears. Next click the \u201cMarketplace\u201d tab to view the list of available 1-Click Apps.<\/p>\n<h2 id=\"what-are-1-click-apps\"><span class=\"ez-toc-section\" id=\"What_Are_1-Click_Apps\"><\/span>What Are 1-Click Apps?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>DigitalOcean\u2019s Kubernetes 1-Click Apps provide pre-configured installations for popular in-cluster applications. The apps are tested by DigitalOcean so they\u2019re guaranteed to work with each available Kubernetes version.<\/p>\n<p>Available apps use the official Helm chart from their vendor. The charts are augmented by default settings supplied by DigitalOcean in an open-source <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/digitalocean\/marketplace-kubernetes\/tree\/master\/stacks\">GitHub repository<\/a>. The DigitalOcean control panel lets you install the available charts with one click, providing an easy way to get up and running with essential utilities. You don\u2019t have to manually install Helm and set up chart repositories.<\/p>\n<h2 id=\"installing-nginx-ingress-with-the-1-click-app\"><span class=\"ez-toc-section\" id=\"Installing_NGINX_Ingress_With_the_1-Click_App\"><\/span>Installing NGINX Ingress With the 1-Click App<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can now use this technique to add NGINX Ingress to your cluster. Find the app in the marketplace by scrolling down the list or using the searchbar. Click the blue \u201cInstall\u201d button on the app\u2019s card and acknowledge the confirmation prompt.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-808475\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-30-at-14-18-14-heronweb-add-ons-DigitalOcean.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"1280\" height=\"648\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The installation procedure can take several minutes to complete. Progress will be displayed in the web UI. A new <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.digitalocean.com\/products\/load-balancer\">load balancer<\/a> will be automatically added to your account during the app\u2019s set up process. This load balancer will be billed at the standard rate and should be used as the external entrypoint for your cluster.<\/p>\n<p>Your Ingress controller will be ready to use after the installation completes. As the 1-Click App is based on a Helm chart, you can check the app\u2019s been added by listing the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/helm.sh\">Helm releases<\/a> in your cluster:<\/p>\n<pre>$ helm list --all-namespaces&#13;\nNAME                    NAMESPACE               REVISION  UPDATED                                 STATUS    CHART                       APP VERSION &#13;\ningress-nginx           ingress-nginx           1         2022-05-30 14:46:37.591626084 +0000 UTC deployed  ingress-nginx-4.1.0-beta.1  1.2.0-beta.1<\/pre>\n<p>The <code>ingress-nginx<\/code> release was added by DigitalOcean. It shows as <code>deployed<\/code> so you can start creating Ingress resources to route traffic to your services.<\/p>\n<h2 id=\"using-your-ingress-controller\"><span class=\"ez-toc-section\" id=\"Using_Your_Ingress_Controller\"><\/span>Using Your Ingress Controller<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can test your Ingress controller by creating simple Kubernetes deployment, service, and Ingress resources:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co3\">apiVersion<\/span><span class=\"sy2\">: <\/span>apps\/v1<span class=\"co3\">\nkind<\/span><span class=\"sy2\">: <\/span>Deployment<span class=\"co4\">\nmetadata<\/span>:<span class=\"co3\">\n  name<\/span><span class=\"sy2\">: <\/span>demo-deployment<span class=\"co4\">\nspec<\/span>:<span class=\"co3\">\n  replicas<\/span><span class=\"sy2\">: <\/span>1<span class=\"co4\">\n  selector<\/span>:<span class=\"co4\">\n    matchLabels<\/span>:<span class=\"co3\">\n      app<\/span><span class=\"sy2\">: <\/span>demo-app<span class=\"co4\">\n  template<\/span>:<span class=\"co4\">\n    metadata<\/span>:<span class=\"co4\">\n      labels<\/span>:<span class=\"co3\">\n        app<\/span><span class=\"sy2\">: <\/span>demo-app<span class=\"co4\">\n    spec<\/span>:<span class=\"co4\">\n      containers<\/span>:<span class=\"co3\">\n      - name<\/span><span class=\"sy2\">: <\/span>demo-container<span class=\"co3\">\n        image<\/span><span class=\"sy2\">: <\/span>httpd:latest<span class=\"co4\">\n        ports<\/span>:<span class=\"co3\">\n          - containerPort<\/span><span class=\"sy2\">: <\/span>80\n\u00a0\n<span class=\"sy1\">---<\/span>\n<span class=\"co3\">\napiVersion<\/span><span class=\"sy2\">: <\/span>v1<span class=\"co3\">\nkind<\/span><span class=\"sy2\">: <\/span>Service<span class=\"co4\">\nmetadata<\/span>:<span class=\"co3\">\n  name<\/span><span class=\"sy2\">: <\/span>demo-service<span class=\"co4\">\nspec<\/span>:<span class=\"co4\">\n  selector<\/span>:<span class=\"co3\">\n    app<\/span><span class=\"sy2\">: <\/span>demo-app<span class=\"co4\">\n  ports<\/span>:<span class=\"co3\">\n    - port<\/span><span class=\"sy2\">: <\/span>80\n\u00a0\n<span class=\"sy1\">---<\/span>\n<span class=\"co3\">\napiVersion<\/span><span class=\"sy2\">: <\/span>networking.k8s.io\/v1<span class=\"co3\">\nkind<\/span><span class=\"sy2\">: <\/span>Ingress<span class=\"co4\">\nmetadata<\/span>:<span class=\"co3\">\n  name<\/span><span class=\"sy2\">: <\/span>demo-ingress<span class=\"co4\">\nspec<\/span>:<span class=\"co3\">\n  ingressClassName<\/span><span class=\"sy2\">: <\/span>nginx<span class=\"co4\">\n  rules<\/span>:<span class=\"co3\">\n    - host<\/span><span class=\"sy2\">: <\/span>example.com<span class=\"co4\">\n      http<\/span>:<span class=\"co4\">\n        paths<\/span>:<span class=\"co3\">\n          - path<\/span><span class=\"sy2\">: <\/span>\/<span class=\"co3\">\n            pathType<\/span><span class=\"sy2\">: <\/span>Prefix<span class=\"co4\">\n            backend<\/span>:<span class=\"co4\">\n              service<\/span>:<span class=\"co3\">\n                name<\/span><span class=\"sy2\">: <\/span>demo-service<span class=\"co4\">\n                port<\/span>:<span class=\"co3\">\n                  number<\/span><span class=\"sy2\">: <\/span>80<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Apply this manifest to your cluster using Kubectl:<\/p>\n<pre>$ kubectl apply -f app.yaml<\/pre>\n<p>The <code>spec.ingressClassName: nginx<\/code> field in the Ingress resource means it will be registered with the newly installed NGINX Ingress controller. Each controller implementation has its own class name so you can use multiple controllers in one cluster.<\/p>\n<p>Next set up a DNS record for <code>example.com<\/code> that points to the external IP address of your DigitalOcean load balancer. You can find this by navigating to Networking &gt; Load Balancers in the online control panel or by running the following Kubectl command:<\/p>\n<pre>$ kubectl get service ingress-nginx-controller --namespace=ingress-nginx&#13;\nNAME                       TYPE           CLUSTER-IP       EXTERNAL-IP    PORT(S)                      AGE&#13;\ningress-nginx-controller   LoadBalancer   XXX.XXX.XXX.XXX  1.2.3.4        80:30547\/TCP,443:32027\/TCP   1d<\/pre>\n<p>Visiting <code>example.com<\/code> should show the default Apache webpage once the DNS change takes effect. Your Ingress controller receives the request from the load balancer. It uses your Ingress resources to select an appropriate service, causing requests to <code>example.com<\/code> to end up with your Apache containers.<\/p>\n<p>Now you can follow the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/ingress\">Kubernetes documentation<\/a> to create Ingress resources that express the service routing rules needed for your real applications.<\/p>\n<h2 id=\"adding-https\"><span class=\"ez-toc-section\" id=\"Adding_HTTPS\"><\/span>Adding HTTPS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Endpoints on production clusters should be protected with TLS. You can set up automated HTTPS certificates by adding Cert-Manager to your cluster, alongside the NGINX Ingress Controller.<\/p>\n<p>Cert-Manager is available as an additional 1-Click App from the DigitalOcean Marketplace. You can repeat the procedure used earlier: head to your cluster\u2019s overview page in the control panel, click the \u201cMarketplace\u201d tab, and find and install the application.<\/p>\n<p>After the installation completes, create a certificate issuer that will be used to request Let\u2019s Encrypt certificates:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co3\">apiVersion<\/span><span class=\"sy2\">: <\/span>cert-manager.io\/v1<span class=\"co3\">\nkind<\/span><span class=\"sy2\">: <\/span>ClusterIssuer<span class=\"co4\">\nmetadata<\/span>:<span class=\"co3\">\n  name<\/span><span class=\"sy2\">: <\/span>letsencrypt-staging<span class=\"co4\">\nspec<\/span>:<span class=\"co4\">\n  acme<\/span>:<span class=\"co3\">\n    server<\/span><span class=\"sy2\">: <\/span>https:\/\/acme-staging-v02.api.letsencrypt.org\/directory<span class=\"co3\">\n    email<\/span><span class=\"sy2\">: <\/span>example@example.com<span class=\"co4\">\n    privateKeySecretRef<\/span>:<span class=\"co3\">\n      name<\/span><span class=\"sy2\">: <\/span>letsencrypt-staging<span class=\"co4\">\n    solvers<\/span>:<span class=\"co4\">\n      - http01<\/span>:<span class=\"co4\">\n          ingress<\/span>:<span class=\"co3\">\n            class<\/span><span class=\"sy2\">: <\/span>nginx<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Change the <code>spec.acme.email<\/code> field to your own email address so Let\u2019s Encrypt can reach you with notifications about your certificates. Then apply the manifest to your cluster:<\/p>\n<pre>$ kubectl apply -f issuer.yml<\/pre>\n<p>Now you can update your Ingress resource with HTTPS support:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co3\">apiVersion<\/span><span class=\"sy2\">: <\/span>networking.k8s.io\/v1<span class=\"co3\">\nkind<\/span><span class=\"sy2\">: <\/span>Ingress<span class=\"co4\">\nmetadata<\/span>:<span class=\"co3\">\n  name<\/span><span class=\"sy2\">: <\/span>demo-ingress<span class=\"co4\">\n  annotations<\/span>:<span class=\"co3\">\n    kubernetes.io\/ingress.class<\/span><span class=\"sy2\">: <\/span>ingress<span class=\"co3\">\n    cert-manager.io\/cluster-issuer<\/span><span class=\"sy2\">: <\/span>letsencrypt-staging<span class=\"co4\">\nspec<\/span>:<span class=\"co3\">\n  ingressClassName<\/span><span class=\"sy2\">: <\/span>nginx<span class=\"co4\">\n  rules<\/span>:<span class=\"co3\">\n    - host<\/span><span class=\"sy2\">: <\/span>example.com<span class=\"co4\">\n      http<\/span>:<span class=\"co4\">\n        paths<\/span>:<span class=\"co3\">\n          - path<\/span><span class=\"sy2\">: <\/span>\/<span class=\"co3\">\n            pathType<\/span><span class=\"sy2\">: <\/span>Prefix<span class=\"co4\">\n            backend<\/span>:<span class=\"co4\">\n              service<\/span>:<span class=\"co3\">\n                name<\/span><span class=\"sy2\">: <\/span>demo-service<span class=\"co4\">\n                port<\/span>:<span class=\"co3\">\n                  number<\/span><span class=\"sy2\">: <\/span>80<span class=\"co4\">\n  tls<\/span>:<span class=\"co4\">\n    - hosts<\/span><span class=\"sy2\">:\n<\/span>       - example.com<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The new <code>spec.tls<\/code> field specifies that a certificate should be acquired for the <code>example.com<\/code> domain. The <code>letsencrypt-staging<\/code> certificate issuer will be used, as defined by the <code>cert-manager.io\/cluster-issuer<\/code> annotation.<\/p>\n<p>The example shown above uses Let\u2019s Encrypt\u2019s staging endpoint which is recommended while you\u2019re testing your deployment. You can switch to using real certificates by creating a second issuer that targets the production endpoints. Copy the Issuer manifest above, replace <code>letsencrypt-staging<\/code> with <code>letsencrypt-production<\/code>, and change the <code>spec.acme.server<\/code> URL to <code>https:\/\/acme-v02.api.letsencrypt.org\/directory<\/code>. Afterwards you can update your Ingress resource\u2019s <code>cert-manager.io\/cluster-issuer<\/code> annotation to reference your new <code>letsencrypt-production<\/code> issuer.<\/p>\n<h2 id=\"managing-your-nginx-ingress-installation\"><span class=\"ez-toc-section\" id=\"Managing_Your_NGINX_Ingress_Installation\"><\/span>Managing Your NGINX Ingress Installation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Unfortunately DigitalOcean\u2019s 1-Click Apps only simplify the installation experience. You\u2019re on your own when it comes to managing and updating your applications. As apps are simply pre-configured Helm charts, this isn\u2019t as onerous as it sounds.<\/p>\n<p>You can use your local Helm CLI installation to upgrade to new <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/kubernetes\/ingress-nginx\/releases\">NGINX Ingress releases<\/a>:<\/p>\n<pre>$ helm upgrade ingress-nginx ingress-nginx\/ingress-nginx \\&#13;\n  --namespace ingress-nginx&#13;\n  --values values.yml<\/pre>\n<p>You should download the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/digitalocean\/marketplace-kubernetes\/tree\/master\/stacks\/ingress-nginx\"><code>values.yml<\/code> file<\/a> from DigitalOcean\u2019s Marketplace repository first. This will ensure the new release is configured with your existing settings. You can also use this procedure to customize your Ingress controller with your own settings after initial installation. Modify the <code>values.yml<\/code> file and then run the <code>helm upgrade<\/code> command.<\/p>\n<h2 id=\"removing-nginx-ingress-from-your-cluster\"><span class=\"ez-toc-section\" id=\"Removing_NGINX_Ingress_From_Your_Cluster\"><\/span>Removing NGINX Ingress From Your Cluster<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can completely remove NGINX Ingress from your cluster by uninstalling the app\u2019s Helm release and deleting the namespace that was created:<\/p>\n<pre>$ helm uninstall ingress-nginx --namespace ingress-nginx&#13;\n$ kubectl delete namespace ingress-nginx<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-808476\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-30-at-16-08-23-Load-Balancers-DigitalOcean.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"image of deleting a DigitalOcean load balancer\" width=\"1280\" height=\"648\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The load balancer should be cleaned up automatically. You can manually delete it from the Networking &gt; Load Balancers page in the DigitalOcean control panel if you need to. Click the \u201cMore\u201d button next to the load balancer, then choose \u201cDestroy\u201d from the dropdown menu. You won\u2019t be able to recover the IP address that was allocated.<\/p>\n<h2 id=\"installing-nginx-ingress-with-doctl\"><span class=\"ez-toc-section\" id=\"Installing_NGINX_Ingress_With_Doctl\"><\/span>Installing NGINX Ingress With Doctl<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can install 1-Click Apps using DigitalOcean\u2019s Doctl command-line client. Begin by retrieving the list of your Kubernetes clusters:<\/p>\n<pre>$ doctl kubernetes cluster list&#13;\nID                                      Name        Region    Version        Auto Upgrade    Status     Node Pools&#13;\n946407f3-abcd-123a-456b-6a0ec60f93bf    demo-k8s    lon1      1.22.8-do.1    false           running    demo-k8s-1<\/pre>\n<p>Next run the following command to add NGINX Ingress to your cluster. Replace <code>&lt;cluster-id&gt;<\/code> with the ID that was displayed above.<\/p>\n<pre>$ doctl kubernetes 1-click install &lt;cluster-id&gt; \\&#13;\n  --1-clicks ingress-nginx<\/pre>\n<p>Use this alternative if you want to install Cert-Manager too:<\/p>\n<pre>$ doctl kubernetes 1-click install &lt;cluster-id&gt; \\&#13;\n  --1-clicks ingress-nginx,cert-manager<\/pre>\n<p>Besides using Doctl, you can also interact <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.digitalocean.com\/reference\/api\/api-reference\/#operation\/install_kubernetes\">with the DigitalOcean API<\/a> directly to programmatically add new applications to your cluster.<\/p>\n<h2 id=\"summary\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can quickly add the NGINX Ingress controller to a DigitalOcean Kubernetes cluster by using the 1-Click App available in the Marketplace. This deploys a pre-configured release of the NGINX Ingress Helm chart with ready-to-use configuration.<\/p>\n<p>Although this accelerates initial provisioning, you must still manually run Helm commands to manage and upgrade your installation. The 1-Click App aims to strike a balance between ease of use and customization, ensuring you\u2019re not locked-in to a specific set of parameters.<\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/devops\/how-to-set-up-an-nginx-ingress-controller-on-digitalocean-kubernetes\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;How to Set Up an NGINX Ingress Controller on DigitalOcean Kubernetes&#8221; DigitalOcean\u2019s Managed Kubernetes service simplifies provisioning and maintaining Kubernetes clusters. The platform provides a ready-to-use foundation for containerized workloads with one-click support for common addon applications. In this article, we\u2019ll show how to use one of these addons to set up an NGINX Ingress&#8230;<\/p>\n","protected":false},"author":1,"featured_media":482664,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/Kubernetes-DigitalOcean.jpeg?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-482663","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/482663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=482663"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/482663\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/482664"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=482663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=482663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=482663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}