mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-11-09 10:19:16 +00:00
1 line
8.8 KiB
JavaScript
1 line
8.8 KiB
JavaScript
"use strict";(self.webpackChunkrancher_docs=self.webpackChunkrancher_docs||[]).push([[20689],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>h});var n=r(67294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var i=n.createContext({}),c=function(e){var t=n.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},p=function(e){var t=c(e.components);return n.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,l=e.originalType,i=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=c(r),h=a,m=d["".concat(i,".").concat(h)]||d[h]||u[h]||l;return r?n.createElement(m,o(o({ref:t},p),{},{components:r})):n.createElement(m,o({ref:t},p))}));function h(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=r.length,o=new Array(l);o[0]=d;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s.mdxType="string"==typeof e?e:a,o[1]=s;for(var c=2;c<l;c++)o[c]=r[c];return n.createElement.apply(null,o)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},96727:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>o,default:()=>u,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var n=r(87462),a=(r(67294),r(3905));const l={title:"3. Install Rancher"},o=void 0,s={unversionedId:"getting-started/installation-and-upgrade/other-installation-methods/rancher-behind-an-http-proxy/install-rancher",id:"version-2.0-2.4/getting-started/installation-and-upgrade/other-installation-methods/rancher-behind-an-http-proxy/install-rancher",title:"3. Install Rancher",description:"Now that you have a running RKE cluster, you can install Rancher in it. For security reasons all traffic to Rancher must be encrypted with TLS. For this tutorial you are going to automatically issue a self-signed certificate through cert-manager. In a real-world use-case you will likely use Let's Encrypt or provide your own certificate.",source:"@site/versioned_docs/version-2.0-2.4/getting-started/installation-and-upgrade/other-installation-methods/rancher-behind-an-http-proxy/install-rancher.md",sourceDirName:"getting-started/installation-and-upgrade/other-installation-methods/rancher-behind-an-http-proxy",slug:"/getting-started/installation-and-upgrade/other-installation-methods/rancher-behind-an-http-proxy/install-rancher",permalink:"/v2.0-v2.4/getting-started/installation-and-upgrade/other-installation-methods/rancher-behind-an-http-proxy/install-rancher",draft:!1,editUrl:"https://github.com/rancher/rancher-docs/edit/main/versioned_docs/version-2.0-2.4/getting-started/installation-and-upgrade/other-installation-methods/rancher-behind-an-http-proxy/install-rancher.md",tags:[],version:"2.0-2.4",lastUpdatedAt:1663953084,formattedLastUpdatedAt:"Sep 23, 2022",frontMatter:{title:"3. Install Rancher"},sidebar:"tutorialSidebar",previous:{title:"2. Install Kubernetes",permalink:"/v2.0-v2.4/getting-started/installation-and-upgrade/other-installation-methods/rancher-behind-an-http-proxy/install-kubernetes"},next:{title:"Resources",permalink:"/v2.0-v2.4/pages-for-subheaders/resources"}},i={},c=[{value:"Install cert-manager",id:"install-cert-manager",level:3},{value:"Install Rancher",id:"install-rancher",level:3},{value:"Additional Resources",id:"additional-resources",level:3}],p={toc:c};function u(e){let{components:t,...r}=e;return(0,a.kt)("wrapper",(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Now that you have a running RKE cluster, you can install Rancher in it. For security reasons all traffic to Rancher must be encrypted with TLS. For this tutorial you are going to automatically issue a self-signed certificate through ",(0,a.kt)("a",{parentName:"p",href:"https://cert-manager.io/"},"cert-manager"),". In a real-world use-case you will likely use Let's Encrypt or provide your own certificate."),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},(0,a.kt)("strong",{parentName:"p"},"Note:")," These installation instructions assume you are using Helm 3.")),(0,a.kt)("h3",{id:"install-cert-manager"},"Install cert-manager"),(0,a.kt)("p",null,"Add the cert-manager helm repository:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"helm repo add jetstack https://charts.jetstack.io\n")),(0,a.kt)("p",null,"Create a namespace for cert-manager:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl create namespace cert-manager\n")),(0,a.kt)("p",null,"Install the CustomResourceDefinitions of cert-manager:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.15.2/cert-manager.crds.yaml\n")),(0,a.kt)("p",null,"And install it with Helm. Note that cert-manager also needs your proxy configured in case it needs to communicate with Let's Encrypt or other external certificate issuers:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"helm upgrade --install cert-manager jetstack/cert-manager \\\n --namespace cert-manager --version v0.15.2 \\\n --set http_proxy=http://${proxy_host} \\\n --set https_proxy=http://${proxy_host} \\\n --set no_proxy=127.0.0.0/8\\\\,10.0.0.0/8\\\\,cattle-system.svc\\\\,172.16.0.0/12\\\\,192.168.0.0/16\\\\,.svc\\\\,.cluster.local\n")),(0,a.kt)("p",null,"Now you should wait until cert-manager is finished starting up:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl rollout status deployment -n cert-manager cert-manager\nkubectl rollout status deployment -n cert-manager cert-manager-webhook\n")),(0,a.kt)("h3",{id:"install-rancher"},"Install Rancher"),(0,a.kt)("p",null,"Next you can install Rancher itself. First add the helm repository:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"helm repo add rancher-latest https://releases.rancher.com/server-charts/latest\n")),(0,a.kt)("p",null,"Create a namespace:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl create namespace cattle-system\n")),(0,a.kt)("p",null,"And install Rancher with Helm. Rancher also needs a proxy configuration so that it can communicate with external application catalogs or retrieve Kubernetes version update metadata:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"helm upgrade --install rancher rancher-latest/rancher \\\n --namespace cattle-system \\\n --set hostname=rancher.example.com \\\n --set proxy=http://${proxy_host}\n")),(0,a.kt)("p",null,"After waiting for the deployment to finish:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl rollout status deployment -n cattle-system rancher\n")),(0,a.kt)("p",null,"You can now navigate to ",(0,a.kt)("inlineCode",{parentName:"p"},"https://rancher.example.com")," and start using Rancher."),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},(0,a.kt)("strong",{parentName:"p"},"Note:")," If you don't intend to send telemetry data, opt out ",(0,a.kt)("a",{parentName:"p",href:"/v2.0-v2.4/faq/telemetry"},"telemetry")," during the initial login. Leaving this active in an air-gapped environment can cause issues if the sockets cannot be opened successfully.")),(0,a.kt)("h3",{id:"additional-resources"},"Additional Resources"),(0,a.kt)("p",null,"These resources could be helpful when installing Rancher:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/v2.0-v2.4/reference-guides/installation-references/helm-chart-options"},"Rancher Helm chart options")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/v2.0-v2.4/getting-started/installation-and-upgrade/resources/add-tls-secrets"},"Adding TLS secrets")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/v2.0-v2.4/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/troubleshooting"},"Troubleshooting Rancher Kubernetes Installations"))))}u.isMDXComponent=!0}}]); |