Files
rancher-docs/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes.html
T

29 lines
88 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.3.1">
<title data-rh="true">3. Install Kubernetes (Skip for Docker Installs) | Rancher</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="3. Install Kubernetes (Skip for Docker Installs) | Rancher"><meta data-rh="true" name="description" content="Skip this section if you are installing Rancher on a single node with Docker."><meta data-rh="true" property="og:description" content="Skip this section if you are installing Rancher on a single node with Docker."><link data-rh="true" rel="icon" href="/img/favicon.png"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes" hreflang="en"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/zh/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes" hreflang="zh"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://30NEY6C9UY-dsn.algolia.net" crossorigin="anonymous"><link data-rh="true" rel="canonical" href="https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes"><link rel="preconnect" href="https://www.googletagmanager.com">
<script>window.dataLayer=window.dataLayer||[]</script>
<script>!function(e,t,a,n,g){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var m=t.getElementsByTagName(a)[0],r=t.createElement(a);r.async=!0,r.src="https://www.googletagmanager.com/gtm.js?id=GTM-57KS2MW",m.parentNode.insertBefore(r,m)}(window,document,"script","dataLayer")</script>
<link rel="search" type="application/opensearchdescription+xml" title="Rancher" href="/opensearch.xml">
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" charset="UTF-8" data-domain-script="0f98beb0-fc4c-417d-a42e-564e2cae42d2" async></script>
<script src="/scripts/optanonwrapper.js" async></script><link rel="stylesheet" href="/assets/css/styles.efd70281.css">
<link rel="preload" href="/assets/js/runtime~main.5e8050ed.js" as="script">
<link rel="preload" href="/assets/js/main.7c8ccb50.js" as="script">
</head>
<body class="navigation-with-keyboard">
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-57KS2MW" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/rancher-logo-horiz-color.svg" alt="logo" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/rancher-logo-horiz-color.svg" alt="logo" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate"></b></a><div class="navbar__item dropdown dropdown--hoverable"><a aria-current="page" class="navbar__link active" aria-haspopup="true" aria-expanded="false" role="button" href="/">Latest</a><ul class="dropdown__menu"><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes">Latest</a></li><li><a class="dropdown__link" href="/v2.7/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes">v2.7</a></li><li><a class="dropdown__link" href="/v2.6/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes">v2.6</a></li><li><a class="dropdown__link" href="/v2.5/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes">v2.5</a></li><li><a class="dropdown__link" href="/v2.0-v2.4/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes">v2.0-v2.4</a></li><li><a class="dropdown__link" href="/versions">All versions</a></li></ul></div></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link"><svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" class="iconLanguage_nlXk"><path fill="currentColor" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg>English</a><ul class="dropdown__menu"><li><a href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes" target="_self" rel="noopener noreferrer" class="dropdown__link dropdown__link--active" lang="en">English</a></li><li><a href="/zh/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes" target="_self" rel="noopener noreferrer" class="dropdown__link" lang="zh">简体中文</a></li></ul></div><a href="https://github.com/rancher/rancher-docs" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link navbar__github">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a href="https://www.rancher.com" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Rancher Home<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="searchBox_ZlJk"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/">What is Rancher?</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/getting-started/overview">Getting Started</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/overview">Overview</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/pages-for-subheaders/quick-start-guides">Quick Start Guides</a><button aria-label="Toggle the collapsible sidebar category &#x27;Quick Start Guides&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/pages-for-subheaders/installation-and-upgrade">Installation and Upgrade</a><button aria-label="Toggle the collapsible sidebar category &#x27;Installation and Upgrade&#x27;" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/pages-for-subheaders/installation-requirements">Installation Requirements</a><button aria-label="Toggle the collapsible sidebar category &#x27;Installation Requirements&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/pages-for-subheaders/installation-references">Installation References</a><button aria-label="Toggle the collapsible sidebar category &#x27;Installation References&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/pages-for-subheaders/install-upgrade-on-a-kubernetes-cluster">Install/Upgrade on a Kubernetes Cluster</a><button aria-label="Toggle the collapsible sidebar category &#x27;Install/Upgrade on a Kubernetes Cluster&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/pages-for-subheaders/other-installation-methods">Other Installation Methods</a><button aria-label="Toggle the collapsible sidebar category &#x27;Other Installation Methods&#x27;" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-4 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/pages-for-subheaders/air-gapped-helm-cli-install">Air-Gapped Helm CLI Install</a><button aria-label="Toggle the collapsible sidebar category &#x27;Air-Gapped Helm CLI Install&#x27;" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-5 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/infrastructure-private-registry">1. Set up Infrastructure and Private Registry</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-5 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/publish-images">2. Collect and Publish Images to your Private Registry</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-5 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes">3. Install Kubernetes (Skip for Docker Installs)</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-5 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-rancher-ha">4. Install Rancher</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-5 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/docker-install-commands">Docker Install Commands</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-4 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/pages-for-subheaders/rancher-on-a-single-node-with-docker">Rancher on a Single Node with Docker</a><button aria-label="Toggle the collapsible sidebar category &#x27;Rancher on a Single Node with Docker&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-4 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/pages-for-subheaders/rancher-behind-an-http-proxy">Rancher Behind an HTTP Proxy</a><button aria-label="Toggle the collapsible sidebar category &#x27;Rancher Behind an HTTP Proxy&#x27;" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/pages-for-subheaders/resources">Resources</a><button aria-label="Toggle the collapsible sidebar category &#x27;Resources&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/installation-and-upgrade/upgrade-and-roll-back-kubernetes">Upgrading and Rolling Back Kubernetes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/installation-and-upgrade/upgrade-kubernetes-without-upgrading-rancher">Upgrading Kubernetes without Upgrading Rancher</a></li></ul></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/pages-for-subheaders/new-user-guides">How-to Guides</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/pages-for-subheaders/best-practices">Reference Guides</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/pages-for-subheaders/cloud-marketplace">Integrations in Rancher</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/faq/general-faq">FAQ</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/troubleshooting/general-troubleshooting">Troubleshooting</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/contribute-to-rancher">Contributing to Rancher</a></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Getting Started</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/pages-for-subheaders/installation-and-upgrade"><span itemprop="name">Installation and Upgrade</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/pages-for-subheaders/other-installation-methods"><span itemprop="name">Other Installation Methods</span></a><meta itemprop="position" content="3"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/pages-for-subheaders/air-gapped-helm-cli-install"><span itemprop="name">Air-Gapped Helm CLI Install</span></a><meta itemprop="position" content="4"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">3. Install Kubernetes (Skip for Docker Installs)</span><meta itemprop="position" content="5"></li></ul></nav><span class="theme-doc-version-badge badge badge--secondary">Version: Latest</span><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>3. Install Kubernetes (Skip for Docker Installs)</h1></header><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>Skip this section if you are installing Rancher on a single node with Docker.</p></div></div><p>This section describes how to install a Kubernetes cluster according to our <a href="/reference-guides/rancher-manager-architecture/architecture-recommendations#environment-for-kubernetes-installations">best practices for the Rancher server environment.</a> This cluster should be dedicated to run only the Rancher server.</p><p>Rancher can be installed on any Kubernetes cluster, including hosted Kubernetes providers.</p><p>The steps to set up an air-gapped Kubernetes cluster on RKE, RKE2, or K3s are shown below.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">K3s</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">RKE2</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">RKE</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>In this guide, we are assuming you have created your nodes in your air gapped environment and have a secure Docker private registry on your bastion server.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="installation-outline">Installation Outline<a href="#installation-outline" class="hash-link" aria-label="Direct link to Installation Outline" title="Direct link to Installation Outline">​</a></h3><ol><li><a href="#1-prepare-images-directory">Prepare Images Directory</a></li><li><a href="#2-create-registry-yaml">Create Registry YAML</a></li><li><a href="#3-install-k3s">Install K3s</a></li><li><a href="#4-save-and-start-using-the-kubeconfig-file">Save and Start Using the kubeconfig File</a></li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="1-prepare-images-directory">1. Prepare Images Directory<a href="#1-prepare-images-directory" class="hash-link" aria-label="Direct link to 1. Prepare Images Directory" title="Direct link to 1. Prepare Images Directory">​</a></h3><p>Obtain the images tar file for your architecture from the <a href="https://github.com/k3s-io/k3s/releases" target="_blank" rel="noopener noreferrer">releases</a> page for the version of K3s you will be running.</p><p>Place the tar file in the <code>images</code> directory before starting K3s on each node, for example:</p><div class="language-sh codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-sh codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">sudo mkdir -p /var/lib/rancher/k3s/agent/images/</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">sudo cp ./k3s-airgap-images-$ARCH.tar /var/lib/rancher/k3s/agent/images/</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="2-create-registry-yaml">2. Create Registry YAML<a href="#2-create-registry-yaml" class="hash-link" aria-label="Direct link to 2. Create Registry YAML" title="Direct link to 2. Create Registry YAML">​</a></h3><p>Create the registries.yaml file at <code>/etc/rancher/k3s/registries.yaml</code>. This will tell K3s the necessary details to connect to your private registry.</p><p>The registries.yaml file should look like this before plugging in the necessary information:</p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">---</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">mirrors</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">customreg</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">endpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;https://ip-to-server:5000&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">configs</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">customreg</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">auth</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">username</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> xxxxxx </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># this is the registry username</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">password</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> xxxxxx </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># this is the registry password</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">tls</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">cert_file</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> &lt;path to the cert file used in the registry</span><span class="token punctuation" style="color:rgb(199, 146, 234)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">key_file</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> &lt;path to the key file used in the registry</span><span class="token punctuation" style="color:rgb(199, 146, 234)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">ca_file</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> &lt;path to the ca file used in the registry</span><span class="token punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Note, at this time only secure registries are supported with K3s (SSL with custom CA).</p><p>For more information on private registries configuration file for K3s, refer to the <a href="https://rancher.com/docs/k3s/latest/en/installation/private-registry/" target="_blank" rel="noopener noreferrer">K3s documentation.</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="3-install-k3s">3. Install K3s<a href="#3-install-k3s" class="hash-link" aria-label="Direct link to 3. Install K3s" title="Direct link to 3. Install K3s">​</a></h3><p>Rancher needs to be installed on a supported Kubernetes version. To find out which versions of Kubernetes are supported for your Rancher version, refer to the <a href="https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/" target="_blank" rel="noopener noreferrer">Rancher Support Matrix</a>.</p><p>To specify the K3s (Kubernetes) version, use the INSTALL_K3S_VERSION (e.g., <code>INSTALL_K3S_VERSION=&quot;v1.24.10+k3s1&quot;</code>) environment variable when running the K3s installation script.</p><p>Obtain the K3s binary from the <a href="https://github.com/k3s-io/k3s/releases" target="_blank" rel="noopener noreferrer">releases</a> page, matching the same version used to get the airgap images tar.
Also obtain the K3s install script at <a href="https://get.k3s.io" target="_blank" rel="noopener noreferrer">https://get.k3s.io</a></p><p>Place the binary in <code>/usr/local/bin</code> on each node.
Place the install script anywhere on each node, and name it <code>install.sh</code>.</p><p>Install K3s on each server:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">INSTALL_K3S_SKIP_DOWNLOAD=true INSTALL_K3S_VERSION=&lt;VERSION&gt; ./install.sh</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Install K3s on each agent:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">INSTALL_K3S_SKIP_DOWNLOAD=true INSTALL_K3S_VERSION=&lt;VERSION&gt; K3S_URL=https://&lt;SERVER&gt;:6443 K3S_TOKEN=&lt;TOKEN&gt; ./install.sh</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Where <code>&lt;SERVER&gt;</code> is the IP or valid DNS of the server and <code>&lt;TOKEN&gt;</code> is the node-token from the server found at <code>/var/lib/rancher/k3s/server/node-token</code>.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>K3s additionally provides a <code>--resolv-conf</code> flag for kubelets, which may help with configuring DNS in air-gapped networks.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="4-save-and-start-using-the-kubeconfig-file">4. Save and Start Using the kubeconfig File<a href="#4-save-and-start-using-the-kubeconfig-file" class="hash-link" aria-label="Direct link to 4. Save and Start Using the kubeconfig File" title="Direct link to 4. Save and Start Using the kubeconfig File">​</a></h3><p>When you installed K3s on each Rancher server node, a <code>kubeconfig</code> file was created on the node at <code>/etc/rancher/k3s/k3s.yaml</code>. This file contains credentials for full access to the cluster, and you should save this file in a secure location.</p><p>To use this <code>kubeconfig</code> file,</p><ol><li>Install <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl" target="_blank" rel="noopener noreferrer">kubectl,</a> a Kubernetes command-line tool.</li><li>Copy the file at <code>/etc/rancher/k3s/k3s.yaml</code> and save it to the directory <code>~/.kube/config</code> on your local machine.</li><li>In the kubeconfig file, the <code>server</code> directive is defined as localhost. Configure the server as the DNS of your load balancer, referring to port 6443. (The Kubernetes API server will be reached at port 6443, while the Rancher server will be reached at ports 80 and 443.) Here is an example <code>k3s.yaml</code>:</li></ol><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token key atrule">apiVersion</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> v1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">clusters</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain"> </span><span class="token key atrule">cluster</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">certificate-authority-data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token plain">CERTIFICATE</span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain">DATA</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">server</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token plain">LOAD</span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain">BALANCER</span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain">DNS</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token number" style="color:rgb(247, 140, 108)">6443</span><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># Edit this line</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">contexts</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain"> </span><span class="token key atrule">context</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">cluster</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">current-context</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">kind</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> Config</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">preferences</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">users</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">password</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token plain">PASSWORD</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">username</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> admin</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><strong>Result:</strong> You can now use <code>kubectl</code> to manage your K3s cluster. If you have more than one kubeconfig file, you can specify which one you want to use by passing in the path to the file when using <code>kubectl</code>:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">kubectl --kubeconfig ~/.kube/config/k3s.yaml get pods --all-namespaces</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>For more information about the <code>kubeconfig</code> file, refer to the <a href="https://rancher.com/docs/k3s/latest/en/cluster-access/" target="_blank" rel="noopener noreferrer">K3s documentation</a> or the <a href="https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/" target="_blank" rel="noopener noreferrer">official Kubernetes documentation</a> about organizing cluster access using <code>kubeconfig</code> files.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="note-on-upgrading">Note on Upgrading<a href="#note-on-upgrading" class="hash-link" aria-label="Direct link to Note on Upgrading" title="Direct link to Note on Upgrading">​</a></h3><p>Upgrading an air-gap environment can be accomplished in the following manner:</p><ol><li>Download the new air-gap images (tar file) from the <a href="https://github.com/k3s-io/k3s/releases" target="_blank" rel="noopener noreferrer">releases</a> page for the version of K3s you will be upgrading to. Place the tar in the <code>/var/lib/rancher/k3s/agent/images/</code> directory on each node. Delete the old tar file.</li><li>Copy and replace the old K3s binary in <code>/usr/local/bin</code> on each node. Copy over the install script at <a href="https://get.k3s.io" target="_blank" rel="noopener noreferrer">https://get.k3s.io</a> (as it is possible it has changed since the last release). Run the script again just as you had done in the past with the same environment variables.</li><li>Restart the K3s service (if not restarted automatically by installer).</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>In this guide, we are assuming you have created your nodes in your air-gapped environment and have a secure Docker private registry on your bastion server.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="installation-outline-1">Installation Outline<a href="#installation-outline-1" class="hash-link" aria-label="Direct link to Installation Outline" title="Direct link to Installation Outline">​</a></h3><ol><li><a href="#1-create-rke2-configuration">Create RKE2 configuration</a></li><li><a href="#2-create-registry-yaml">Create Registry YAML</a></li><li><a href="#3-install-rke2">Install RKE2</a></li><li><a href="#4-save-and-start-using-the-kubeconfig-file">Save and Start Using the kubeconfig File</a></li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="1-create-rke2-configuration">1. Create RKE2 configuration<a href="#1-create-rke2-configuration" class="hash-link" aria-label="Direct link to 1. Create RKE2 configuration" title="Direct link to 1. Create RKE2 configuration">​</a></h3><p>Create the config.yaml file at <code>/etc/rancher/rke2/config.yaml</code>. This will contain all the configuration options necessary to create a highly available RKE2 cluster.</p><p>On the first server the minimum config is:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">token: my-shared-secret</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">tls-san:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> - loadbalancer-dns-domain.com</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>On each other server the config file should contain the same token and tell RKE2 to connect to the existing first server:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">server: https://ip-of-first-server:9345</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">token: my-shared-secret</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">tls-san:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> - loadbalancer-dns-domain.com</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>For more information, refer to the <a href="https://docs.rke2.io/install/ha" target="_blank" rel="noopener noreferrer">RKE2 documentation</a>.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>RKE2 additionally provides a <code>resolv-conf</code> option for kubelets, which may help with configuring DNS in air-gap networks.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="2-create-registry-yaml-1">2. Create Registry YAML<a href="#2-create-registry-yaml-1" class="hash-link" aria-label="Direct link to 2. Create Registry YAML" title="Direct link to 2. Create Registry YAML">​</a></h3><p>Create the registries.yaml file at <code>/etc/rancher/rke2/registries.yaml</code>. This will tell RKE2 the necessary details to connect to your private registry.</p><p>The registries.yaml file should look like this before plugging in the necessary information:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">---</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">mirrors:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> customreg:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> endpoint:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> - &quot;https://ip-to-server:5000&quot;</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">configs:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> customreg:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> auth:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> username: xxxxxx # this is the registry username</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> password: xxxxxx # this is the registry password</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> tls:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> cert_file: &lt;path to the cert file used in the registry&gt;</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> key_file: &lt;path to the key file used in the registry&gt;</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> ca_file: &lt;path to the ca file used in the registry&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>For more information on private registries configuration file for RKE2, refer to the <a href="https://docs.rke2.io/install/containerd_registry_configuration" target="_blank" rel="noopener noreferrer">RKE2 documentation.</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="3-install-rke2">3. Install RKE2<a href="#3-install-rke2" class="hash-link" aria-label="Direct link to 3. Install RKE2" title="Direct link to 3. Install RKE2">​</a></h3><p>Rancher needs to be installed on a supported Kubernetes version. To find out which versions of Kubernetes are supported for your Rancher version, refer to the <a href="https://rancher.com/support-maintenance-terms/" target="_blank" rel="noopener noreferrer">support maintenance terms.</a></p><p>Download the install script, rke2, rke2-images, and sha256sum archives from the release and upload them into a directory on each server:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">mkdir /tmp/rke2-artifacts &amp;&amp; cd /tmp/rke2-artifacts/</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">wget https://github.com/rancher/rke2/releases/download/v1.21.5%2Brke2r2/rke2-images.linux-amd64.tar.zst</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">wget https://github.com/rancher/rke2/releases/download/v1.21.5%2Brke2r2/rke2.linux-amd64.tar.gz</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">wget https://github.com/rancher/rke2/releases/download/v1.21.5%2Brke2r2/sha256sum-amd64.txt</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">curl -sfL https://get.rke2.io --output install.sh</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Next, run install.sh using the directory on each server, as in the example below:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">INSTALL_RKE2_ARTIFACT_PATH=/tmp/rke2-artifacts sh install.sh</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Then enable and start the service on all servers:</p><p><code>systemctl enable rke2-server.service
systemctl start rke2-server.service</code></p><p>For more information, refer to the <a href="https://docs.rke2.io/install/airgap" target="_blank" rel="noopener noreferrer">RKE2 documentation</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="4-save-and-start-using-the-kubeconfig-file-1">4. Save and Start Using the kubeconfig File<a href="#4-save-and-start-using-the-kubeconfig-file-1" class="hash-link" aria-label="Direct link to 4. Save and Start Using the kubeconfig File" title="Direct link to 4. Save and Start Using the kubeconfig File">​</a></h3><p>When you installed RKE2 on each Rancher server node, a <code>kubeconfig</code> file was created on the node at <code>/etc/rancher/rke2/rke2.yaml</code>. This file contains credentials for full access to the cluster, and you should save this file in a secure location.</p><p>To use this <code>kubeconfig</code> file,</p><ol><li>Install <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl" target="_blank" rel="noopener noreferrer">kubectl</a>, a Kubernetes command-line tool.</li><li>Copy the file at <code>/etc/rancher/rke2/rke2.yaml</code> and save it to the directory <code>~/.kube/config</code> on your local machine.</li><li>In the kubeconfig file, the <code>server</code> directive is defined as localhost. Configure the server as the DNS of your load balancer, referring to port 6443. (The Kubernetes API server will be reached at port 6443, while the Rancher server will be reached at ports 80 and 443.) Here is an example <code>rke2.yaml</code>:</li></ol><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">apiVersion: v1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">clusters:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">- cluster:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> certificate-authority-data: [CERTIFICATE-DATA]</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> server: [LOAD-BALANCER-DNS]:6443 # Edit this line</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> name: default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">contexts:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">- context:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> cluster: default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> user: default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> name: default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">current-context: default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">kind: Config</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">preferences: {}</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">users:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">- name: default</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> user:</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> password: [PASSWORD]</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> username: admin</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><strong>Result:</strong> You can now use <code>kubectl</code> to manage your RKE2 cluster. If you have more than one kubeconfig file, you can specify which one you want to use by passing in the path to the file when using <code>kubectl</code>:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">kubectl --kubeconfig ~/.kube/config/rke2.yaml get pods --all-namespaces</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>For more information about the <code>kubeconfig</code> file, refer to the <a href="https://docs.rke2.io/cluster_access" target="_blank" rel="noopener noreferrer">RKE2 documentation</a> or the <a href="https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/" target="_blank" rel="noopener noreferrer">official Kubernetes documentation</a> about organizing cluster access using <code>kubeconfig</code> files.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="note-on-upgrading-1">Note on Upgrading<a href="#note-on-upgrading-1" class="hash-link" aria-label="Direct link to Note on Upgrading" title="Direct link to Note on Upgrading">​</a></h3><p>Upgrading an air-gap environment can be accomplished in the following manner:</p><ol><li>Download the new air-gap artifacts and install script from the <a href="https://github.com/rancher/rke2/releases" target="_blank" rel="noopener noreferrer">releases</a> page for the version of RKE2 you will be upgrading to.</li><li>Run the script again just as you had done in the past with the same environment variables.</li><li>Restart the RKE2 service.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden="">We will create a Kubernetes cluster using Rancher Kubernetes Engine (RKE). Before being able to start your Kubernetes cluster, you’ll need to install RKE and create a RKE config file.<h3 class="anchor anchorWithStickyNavbar_LWe7" id="1-install-rke">1. Install RKE<a href="#1-install-rke" class="hash-link" aria-label="Direct link to 1. Install RKE" title="Direct link to 1. Install RKE">​</a></h3><p>Install RKE by following the instructions in the <a href="https://rancher.com/docs/rke/latest/en/installation/" target="_blank" rel="noopener noreferrer">RKE documentation.</a></p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>Certified version(s) of RKE based on the Rancher version can be found in the <a href="https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/" target="_blank" rel="noopener noreferrer">Rancher Support Matrix</a>.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="2-create-an-rke-config-file">2. Create an RKE Config File<a href="#2-create-an-rke-config-file" class="hash-link" aria-label="Direct link to 2. Create an RKE Config File" title="Direct link to 2. Create an RKE Config File">​</a></h3><p>From a system that can access ports 22/TCP and 6443/TCP on the Linux host node(s) that you set up in a previous step, use the sample below to create a new file named <code>rancher-cluster.yml</code>.</p><p>This file is an RKE configuration file, which is a configuration for the cluster you&#x27;re deploying Rancher to.</p><p>Replace values in the code sample below with help of the <em>RKE Options</em> table. Use the IP address or DNS names of the three nodes you created.</p><div class="theme-admonition theme-admonition-tip alert alert--success admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_S0QG"><p>For more details on the options available, see the RKE <a href="https://rancher.com/docs/rke/latest/en/config-options/" target="_blank" rel="noopener noreferrer">Config Options</a>.</p></div></div><figcaption>RKE Options</figcaption><table><thead><tr><th>Option</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>address</code></td><td>✓</td><td>The DNS or IP address for the node within the air gapped network.</td></tr><tr><td><code>user</code></td><td>✓</td><td>A user that can run Docker commands.</td></tr><tr><td><code>role</code></td><td>✓</td><td>List of Kubernetes roles assigned to the node.</td></tr><tr><td><code>internal_address</code></td><td>optional<sup>1</sup></td><td>The DNS or IP address used for internal cluster traffic.</td></tr><tr><td><code>ssh_key_path</code></td><td></td><td>Path to the SSH private key used to authenticate to the node (defaults to <code>~/.ssh/id_rsa</code>).</td></tr></tbody></table><blockquote><sup>1</sup> Some services like AWS EC2 require setting the `internal_address` if you want to use self-referencing security groups or firewalls.</blockquote><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token key atrule">nodes</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain"> </span><span class="token key atrule">address</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> 10.10.3.187 </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># node air gap network IP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">internal_address</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> 172.31.7.22 </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># node intra-cluster IP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> rancher</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">role</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;controlplane&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;etcd&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;worker&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">ssh_key_path</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> /home/user/.ssh/id_rsa</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain"> </span><span class="token key atrule">address</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> 10.10.3.254 </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># node air gap network IP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">internal_address</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> 172.31.13.132 </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># node intra-cluster IP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> rancher</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">role</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;controlplane&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;etcd&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;worker&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">ssh_key_path</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> /home/user/.ssh/id_rsa</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain"> </span><span class="token key atrule">address</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> 10.10.3.89 </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># node air gap network IP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">internal_address</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> 172.31.3.216 </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># node intra-cluster IP</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> rancher</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">role</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;controlplane&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;etcd&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;worker&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">ssh_key_path</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> /home/user/.ssh/id_rsa</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token key atrule">private_registries</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">-</span><span class="token plain"> </span><span class="token key atrule">url</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> &lt;REGISTRY.YOURDOMAIN.COM</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain">PORT</span><span class="token punctuation" style="color:rgb(199, 146, 234)">&gt;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># private registry url</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> rancher</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">password</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;*********&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token key atrule">is_default</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"> </span><span class="token boolean important" style="color:rgb(255, 88, 116)">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="3-run-rke">3. Run RKE<a href="#3-run-rke" class="hash-link" aria-label="Direct link to 3. Run RKE" title="Direct link to 3. Run RKE">​</a></h3><p>After configuring <code>rancher-cluster.yml</code>, bring up your Kubernetes cluster:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">rke up --config ./rancher-cluster.yml</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="4-save-your-files">4. Save Your Files<a href="#4-save-your-files" class="hash-link" aria-label="Direct link to 4. Save Your Files" title="Direct link to 4. Save Your Files">​</a></h3><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>Important:</div><div class="admonitionContent_S0QG"><p>The files mentioned below are needed to maintain, troubleshoot, and upgrade your cluster.</p></div></div><p>Save a copy of the following files in a secure location:</p><ul><li><code>rancher-cluster.yml</code>: The RKE cluster configuration file.</li><li><code>kube_config_cluster.yml</code>: The <a href="https://rancher.com/docs/rke/latest/en/kubeconfig/" target="_blank" rel="noopener noreferrer">Kubeconfig file</a> for the cluster, this file contains credentials for full access to the cluster.</li><li><code>rancher-cluster.rkestate</code>: The <a href="https://rancher.com/docs/rke/latest/en/installation/#kubernetes-cluster-state" target="_blank" rel="noopener noreferrer">Kubernetes Cluster State file</a>, this file contains the current state of the cluster including the RKE configuration and the certificates.<br><br><em>The Kubernetes Cluster State file is only created when using RKE v0.2.0 or higher.</em></li></ul></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>The &quot;rancher-cluster&quot; parts of the two latter file names are dependent on how you name the RKE cluster configuration file.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="issues-or-errors">Issues or errors?<a href="#issues-or-errors" class="hash-link" aria-label="Direct link to Issues or errors?" title="Direct link to Issues or errors?">​</a></h3><p>See the <a href="/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/troubleshooting">Troubleshooting</a> page.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="next-install-rancher"><a href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-rancher-ha">Next: Install Rancher</a><a href="#next-install-rancher" class="hash-link" aria-label="Direct link to next-install-rancher" title="Direct link to next-install-rancher">​</a></h3></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/rancher/rancher-docs/edit/main/docs/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-kubernetes.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2023-06-01T16:23:01.000Z">Jun 1, 2023</time></b></span></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/publish-images"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">2. Collect and Publish Images to your Private Registry</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/install-rancher-ha"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">4. Install Rancher</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#installation-outline" class="table-of-contents__link toc-highlight">Installation Outline</a></li><li><a href="#1-prepare-images-directory" class="table-of-contents__link toc-highlight">1. Prepare Images Directory</a></li><li><a href="#2-create-registry-yaml" class="table-of-contents__link toc-highlight">2. Create Registry YAML</a></li><li><a href="#3-install-k3s" class="table-of-contents__link toc-highlight">3. Install K3s</a></li><li><a href="#4-save-and-start-using-the-kubeconfig-file" class="table-of-contents__link toc-highlight">4. Save and Start Using the kubeconfig File</a></li><li><a href="#note-on-upgrading" class="table-of-contents__link toc-highlight">Note on Upgrading</a></li><li><a href="#installation-outline-1" class="table-of-contents__link toc-highlight">Installation Outline</a></li><li><a href="#1-create-rke2-configuration" class="table-of-contents__link toc-highlight">1. Create RKE2 configuration</a></li><li><a href="#2-create-registry-yaml-1" class="table-of-contents__link toc-highlight">2. Create Registry YAML</a></li><li><a href="#3-install-rke2" class="table-of-contents__link toc-highlight">3. Install RKE2</a></li><li><a href="#4-save-and-start-using-the-kubeconfig-file-1" class="table-of-contents__link toc-highlight">4. Save and Start Using the kubeconfig File</a></li><li><a href="#note-on-upgrading-1" class="table-of-contents__link toc-highlight">Note on Upgrading</a></li><li><a href="#1-install-rke" class="table-of-contents__link toc-highlight">1. Install RKE</a></li><li><a href="#2-create-an-rke-config-file" class="table-of-contents__link toc-highlight">2. Create an RKE Config File</a></li><li><a href="#3-run-rke" class="table-of-contents__link toc-highlight">3. Run RKE</a></li><li><a href="#4-save-your-files" class="table-of-contents__link toc-highlight">4. Save Your Files</a></li><li><a href="#issues-or-errors" class="table-of-contents__link toc-highlight">Issues or errors?</a></li><li><a href="#next-install-rancher" class="table-of-contents__link toc-highlight">Next: Install Rancher</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2023 SUSE Rancher. All Rights Reserved.</div></div></div></footer></div>
<script src="/assets/js/runtime~main.5e8050ed.js"></script>
<script src="/assets/js/main.7c8ccb50.js"></script>
</body>
</html>