mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-11-09 10:19:16 +00:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
"use strict";(self.webpackChunkrancher_docs=self.webpackChunkrancher_docs||[]).push([[12463],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>m});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 o(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 l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(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={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[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):l(l({},t),e)),r},u=function(e){var t=c(e.components);return n.createElement(i.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},p=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=c(r),m=a,h=p["".concat(i,".").concat(m)]||p[m]||d[m]||o;return r?n.createElement(h,l(l({ref:t},u),{},{components:r})):n.createElement(h,l({ref:t},u))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,l=new Array(o);l[0]=p;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,l[1]=s;for(var c=2;c<o;c++)l[c]=r[c];return n.createElement.apply(null,l)}return n.createElement.apply(null,r)}p.displayName="MDXCreateElement"},84604:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var n=r(87462),a=(r(67294),r(3905));const o={title:"Migrating from a Kubernetes Install with an RKE Add-on"},l=void 0,s={unversionedId:"getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/upgrades/migrating-from-rke-add-on",id:"version-2.0-2.4/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/upgrades/migrating-from-rke-add-on",title:"Migrating from a Kubernetes Install with an RKE Add-on",description:"Important: RKE add-on install is only supported up to Rancher v2.0.8",source:"@site/versioned_docs/version-2.0-2.4/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/upgrades/migrating-from-rke-add-on.md",sourceDirName:"getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/upgrades",slug:"/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/upgrades/migrating-from-rke-add-on",permalink:"/v2.0-v2.4/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/upgrades/migrating-from-rke-add-on",draft:!1,editUrl:"https://github.com/rancher/rancher-docs/edit/main/versioned_docs/version-2.0-2.4/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/upgrades/migrating-from-rke-add-on.md",tags:[],version:"2.0-2.4",lastUpdatedAt:1663953084,formattedLastUpdatedAt:"Sep 23, 2022",frontMatter:{title:"Migrating from a Kubernetes Install with an RKE Add-on"},sidebar:"tutorialSidebar",previous:{title:"Upgrades",permalink:"/v2.0-v2.4/pages-for-subheaders/upgrades"},next:{title:"Upgrading to v2.0.7+ \u2014 Namespace Migration",permalink:"/v2.0-v2.4/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/upgrades/namespace-migration"}},i={},c=[{value:"Point kubectl at your Rancher Cluster",id:"point-kubectl-at-your-rancher-cluster",level:3},{value:"Save your certificates",id:"save-your-certificates",level:3},{value:"Remove previous Kubernetes objects",id:"remove-previous-kubernetes-objects",level:3},{value:"Remove addons section from <code>rancher-cluster.yml</code>",id:"remove-addons-section-from-rancher-clusteryml",level:3},{value:"Follow Helm and Rancher install steps",id:"follow-helm-and-rancher-install-steps",level:3}],u={toc:c};function d(e){let{components:t,...r}=e;return(0,a.kt)("wrapper",(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},(0,a.kt)("strong",{parentName:"p"},"Important: RKE add-on install is only supported up to Rancher v2.0.8")),(0,a.kt)("p",{parentName:"blockquote"},"If you are currently using the RKE add-on install method, please follow these directions to migrate to the Helm install.")),(0,a.kt)("p",null,"The following instructions will help guide you through migrating from the RKE Add-on install to managing Rancher with the Helm package manager."),(0,a.kt)("p",null,"You will need the to have ",(0,a.kt)("a",{parentName:"p",href:"https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl"},"kubectl")," installed and the kubeconfig YAML file (",(0,a.kt)("inlineCode",{parentName:"p"},"kube_config_rancher-cluster.yml"),") generated by RKE."),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},(0,a.kt)("strong",{parentName:"p"},"Note:")," This guide assumes a standard Rancher install. If you have modified any of the object names or namespaces, please adjust accordingly.")),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},(0,a.kt)("strong",{parentName:"p"},"Note:")," If you are upgrading from from Rancher v2.0.13 or earlier, or v2.1.8 or earlier, and your cluster's certificates have expired, you will need to perform ",(0,a.kt)("a",{parentName:"p",href:"/v2.0-v2.4/how-to-guides/advanced-user-guides/manage-clusters/rotate-certificates#rotating-expired-certificates-after-upgrading-older-rancher-versions"},"additional steps")," to rotate the certificates.")),(0,a.kt)("h3",{id:"point-kubectl-at-your-rancher-cluster"},"Point kubectl at your Rancher Cluster"),(0,a.kt)("p",null,"Make sure ",(0,a.kt)("inlineCode",{parentName:"p"},"kubectl")," is using the correct kubeconfig YAML file. Set the ",(0,a.kt)("inlineCode",{parentName:"p"},"KUBECONFIG")," environmental variable to point to ",(0,a.kt)("inlineCode",{parentName:"p"},"kube_config_rancher-cluster.yml"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"export KUBECONFIG=$(pwd)/kube_config_rancher-cluster.yml\n")),(0,a.kt)("p",null,"After setting the ",(0,a.kt)("inlineCode",{parentName:"p"},"KUBECONFIG")," environment variable, verify that it contains the correct ",(0,a.kt)("inlineCode",{parentName:"p"},"server")," parameter. It should point directly to one of your cluster nodes on port ",(0,a.kt)("inlineCode",{parentName:"p"},"6443"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl config view -o=jsonpath='{.clusters[*].cluster.server}'\nhttps://NODE:6443\n")),(0,a.kt)("p",null,"If the output from the command shows your Rancher hostname with the suffix ",(0,a.kt)("inlineCode",{parentName:"p"},"/k8s/clusters"),", the wrong kubeconfig YAML file is configured. It should be the file that was created when you used RKE to create the cluster to run Rancher."),(0,a.kt)("h3",{id:"save-your-certificates"},"Save your certificates"),(0,a.kt)("p",null,"If you have terminated ssl on the Rancher cluster ingress, recover your certificate and key for use in the Helm install."),(0,a.kt)("p",null,"Use ",(0,a.kt)("inlineCode",{parentName:"p"},"kubectl")," to get the secret, decode the value and direct the output to a file."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl -n cattle-system get secret cattle-keys-ingress -o jsonpath --template='{ .data.tls\\.crt }' | base64 -d > tls.crt\nkubectl -n cattle-system get secret cattle-keys-ingress -o jsonpath --template='{ .data.tls\\.key }' | base64 -d > tls.key\n")),(0,a.kt)("p",null,"If you specified a private CA root cert"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl -n cattle-system get secret cattle-keys-server -o jsonpath --template='{ .data.cacerts\\.pem }' | base64 -d > cacerts.pem\n")),(0,a.kt)("h3",{id:"remove-previous-kubernetes-objects"},"Remove previous Kubernetes objects"),(0,a.kt)("p",null,"Remove the Kubernetes objects created by the RKE install."),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},(0,a.kt)("strong",{parentName:"p"},"Note:")," Removing these Kubernetes components will not affect the Rancher configuration or database, but with any maintenance it is a good idea to create a backup of the data before hand. See ",(0,a.kt)("a",{parentName:"p",href:"/v2.0-v2.4/how-to-guides/new-user-guides/backup-restore-and-disaster-recovery/back-up-rancher-launched-kubernetes-clusters"},"Creating Backups-Kubernetes Install")," for details.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"kubectl -n cattle-system delete ingress cattle-ingress-http\nkubectl -n cattle-system delete service cattle-service\nkubectl -n cattle-system delete deployment cattle\nkubectl -n cattle-system delete clusterrolebinding cattle-crb\nkubectl -n cattle-system delete serviceaccount cattle-admin\n")),(0,a.kt)("h3",{id:"remove-addons-section-from-rancher-clusteryml"},"Remove addons section from ",(0,a.kt)("inlineCode",{parentName:"h3"},"rancher-cluster.yml")),(0,a.kt)("p",null,"The addons section from ",(0,a.kt)("inlineCode",{parentName:"p"},"rancher-cluster.yml")," contains all the resources needed to deploy Rancher using RKE. By switching to Helm, this part of the cluster configuration file is no longer needed. Open ",(0,a.kt)("inlineCode",{parentName:"p"},"rancher-cluster.yml")," in your favorite text editor and remove the addons section:"),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},(0,a.kt)("strong",{parentName:"p"},"Important:")," Make sure you only remove the addons section from the cluster configuration file.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"nodes:\n - address: <IP> # hostname or IP to access nodes\n user: <USER> # root user (usually 'root')\n role: [controlplane,etcd,worker] # K8s roles for node\n ssh_key_path: <PEM_FILE> # path to PEM file\n - address: <IP>\n user: <USER>\n role: [controlplane,etcd,worker]\n ssh_key_path: <PEM_FILE>\n - address: <IP>\n user: <USER>\n role: [controlplane,etcd,worker]\n ssh_key_path: <PEM_FILE>\n\nservices:\n etcd:\n snapshot: true\n creation: 6h\n retention: 24h\n\n# Remove addons section from here til end of file\naddons: |-\n ---\n ...\n# End of file\n")),(0,a.kt)("h3",{id:"follow-helm-and-rancher-install-steps"},"Follow Helm and Rancher install steps"),(0,a.kt)("p",null,"From here follow the standard install steps."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/v2.0-v2.4/pages-for-subheaders/helm2-helm-init"},"3 - Initialize Helm")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/v2.0-v2.4/pages-for-subheaders/helm-rancher"},"4 - Install Rancher"))))}d.isMDXComponent=!0}}]); |