Files
rancher-docs/assets/js/b8b5cd27.6ec2bb14.js
T

1 line
8.3 KiB
JavaScript

"use strict";(self.webpackChunkrancher_docs=self.webpackChunkrancher_docs||[]).push([[27349],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>g});var r=n(67294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},p=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,l=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=u(n),g=a,f=p["".concat(l,".").concat(g)]||p[g]||d[g]||o;return n?r.createElement(f,s(s({ref:t},c),{},{components:n})):r.createElement(f,s({ref:t},c))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,s=new Array(o);s[0]=p;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:a,s[1]=i;for(var u=2;u<o;u++)s[u]=n[u];return r.createElement.apply(null,s)}return r.createElement.apply(null,n)}p.displayName="MDXCreateElement"},89654:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>u});var r=n(87462),a=(n(67294),n(3905));const o={title:"Ingress Configuration",description:"Ingress configuration"},s=void 0,i={unversionedId:"how-to-guides/new-user-guides/kubernetes-resources-setup/load-balancer-and-ingress-controller/ingress-configuration",id:"how-to-guides/new-user-guides/kubernetes-resources-setup/load-balancer-and-ingress-controller/ingress-configuration",title:"Ingress Configuration",description:"Ingress configuration",source:"@site/docs/how-to-guides/new-user-guides/kubernetes-resources-setup/load-balancer-and-ingress-controller/ingress-configuration.md",sourceDirName:"how-to-guides/new-user-guides/kubernetes-resources-setup/load-balancer-and-ingress-controller",slug:"/how-to-guides/new-user-guides/kubernetes-resources-setup/load-balancer-and-ingress-controller/ingress-configuration",permalink:"/how-to-guides/new-user-guides/kubernetes-resources-setup/load-balancer-and-ingress-controller/ingress-configuration",draft:!1,editUrl:"https://github.com/rancher/rancher-docs/edit/main/docs/how-to-guides/new-user-guides/kubernetes-resources-setup/load-balancer-and-ingress-controller/ingress-configuration.md",tags:[],version:"current",lastUpdatedAt:1667002146,formattedLastUpdatedAt:"Oct 29, 2022",frontMatter:{title:"Ingress Configuration",description:"Ingress configuration"},sidebar:"tutorialSidebar",previous:{title:"Adding Ingresses",permalink:"/how-to-guides/new-user-guides/kubernetes-resources-setup/load-balancer-and-ingress-controller/add-ingresses"},next:{title:"Services",permalink:"/how-to-guides/new-user-guides/kubernetes-resources-setup/create-services"}},l={},u=[{value:"NGINX Ingress controller changes in Kubernetes v1.21",id:"nginx-ingress-controller-changes-in-kubernetes-v121",level:3},{value:"Ingress Rule Configuration",id:"ingress-rule-configuration",level:2},{value:"Specify a hostname to use",id:"specify-a-hostname-to-use",level:3},{value:"Certificates",id:"certificates",level:3},{value:"Labels and Annotations",id:"labels-and-annotations",level:3}],c={toc:u};function d(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h3",{id:"nginx-ingress-controller-changes-in-kubernetes-v121"},"NGINX Ingress controller changes in Kubernetes v1.21"),(0,a.kt)("p",null,"For Kubernetes v1.21 and up, the NGINX Ingress controller no longer runs in hostNetwork but uses hostPorts for port 80 and port 443. This was done so the admission webhook can be configured to be accessed using ClusterIP so it can only be reached inside the cluster."),(0,a.kt)("h2",{id:"ingress-rule-configuration"},"Ingress Rule Configuration"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#specify-a-hostname-to-use"},"Specify a hostname to use")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#use-as-the-default-backend"},"Use as the default backend")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#certificates"},"Certificates")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#labels-and-annotations"},"Labels and Annotations"))),(0,a.kt)("h3",{id:"specify-a-hostname-to-use"},"Specify a hostname to use"),(0,a.kt)("p",null,"If you use this option, ingress routes requests for a hostname to the service or workload that you specify."),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Enter the ",(0,a.kt)("strong",{parentName:"li"},"Request Host")," that your ingress will handle request forwarding for. For example, ",(0,a.kt)("inlineCode",{parentName:"li"},"www.mysite.com"),"."),(0,a.kt)("li",{parentName:"ol"},"Add a ",(0,a.kt)("strong",{parentName:"li"},"Target Service"),"."),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("strong",{parentName:"li"},"Optional:")," If you want specify a workload or service when a request is sent to a particular hostname path, add a ",(0,a.kt)("strong",{parentName:"li"},"Path")," for the target. For example, if you want requests for ",(0,a.kt)("inlineCode",{parentName:"li"},"www.mysite.com/contact-us")," to be sent to a different service than ",(0,a.kt)("inlineCode",{parentName:"li"},"www.mysite.com"),", enter ",(0,a.kt)("inlineCode",{parentName:"li"},"/contact-us")," in the ",(0,a.kt)("strong",{parentName:"li"},"Path")," field. Typically, the first rule that you create does not include a path."),(0,a.kt)("li",{parentName:"ol"},"Enter the ",(0,a.kt)("strong",{parentName:"li"},"Port")," number that each target operates on.")),(0,a.kt)("h3",{id:"certificates"},"Certificates"),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"You must have an SSL certificate that the ingress can use to encrypt/decrypt communications. For more information see ",(0,a.kt)("a",{parentName:"p",href:"/how-to-guides/new-user-guides/kubernetes-resources-setup/encrypt-http-communication"},"Adding SSL Certificates"),".")),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"When creating an ingress, click the ",(0,a.kt)("strong",{parentName:"li"},"Certificates")," tab."),(0,a.kt)("li",{parentName:"ol"},"Click ",(0,a.kt)("strong",{parentName:"li"},"Add Certificate"),"."),(0,a.kt)("li",{parentName:"ol"},"Select a ",(0,a.kt)("strong",{parentName:"li"},"Certificate - Secret Name")," from the drop-down list."),(0,a.kt)("li",{parentName:"ol"},"Enter the host using encrypted communication."),(0,a.kt)("li",{parentName:"ol"},"To add additional hosts that use the certificate, click ",(0,a.kt)("strong",{parentName:"li"},"Add Hosts"),".")),(0,a.kt)("h3",{id:"labels-and-annotations"},"Labels and Annotations"),(0,a.kt)("p",null,"Add ",(0,a.kt)("a",{parentName:"p",href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/"},"Labels")," and/or ",(0,a.kt)("a",{parentName:"p",href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/"},"Annotations")," to provide metadata for your ingress."),(0,a.kt)("p",null,"For a list of annotations available for use, see the ",(0,a.kt)("a",{parentName:"p",href:"https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/"},"Nginx Ingress Controller Documentation"),"."))}d.isMDXComponent=!0}}]);