{"id":4063,"date":"2024-12-15T07:26:15","date_gmt":"2024-12-15T07:26:15","guid":{"rendered":"https:\/\/code2deploy.com\/blog\/?p=4063"},"modified":"2025-02-27T15:59:23","modified_gmt":"2025-02-27T15:59:23","slug":"installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration","status":"publish","type":"post","link":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/","title":{"rendered":"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this tutorial, we&#8217;ll walk through the process of setting up <strong>Rancher<\/strong> on a <strong>K3s<\/strong> cluster. We&#8217;ll cover prerequisites like setting up an <strong>Ingress Controller<\/strong>, configuring a <strong>Domain Name<\/strong>, enabling <strong>SSL<\/strong> with Let&#8217;s Encrypt, and editing the agent-tls-mode before registering your existing cluster to Rancher.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <strong>K3s cluster<\/strong> running (either on a local machine or in a cloud environment).<\/li>\n\n\n\n<li><strong>kubectl<\/strong> installed and configured to interact with the K3s cluster.<\/li>\n\n\n\n<li>A <strong>domain<\/strong> name that you can point to your K3s server (e.g., rancher.example.com).<\/li>\n\n\n\n<li><strong>Access to the internet<\/strong> for downloading Rancher and obtaining SSL certificates (via Let&#8217;s Encrypt).<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 1: Install K3s<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t already have K3s installed, you can install it with the following command on your master node:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>curl -sfL https:\/\/get.k3s.io | sh &#8211;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Verify the installation by checking the node status:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl get nodes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You should see your K3s node listed.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2: Set Up Ingress Controller<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Rancher requires an <strong>Ingress controller<\/strong> to handle external traffic. We will use <strong>Traefik<\/strong>, which is the default Ingress controller in K3s.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To ensure Traefik is installed, run:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl get pods -n kube-system | grep traefik<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You should see a traefik pod running. If it&#8217;s not running, you can install it manually using Helm (optional).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3: Configure Domain for Rancher<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you need to configure your <strong>DNS<\/strong> to point to your K3s node&#8217;s IP address. You will need a domain name (e.g., rancher.example.com).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a <strong>DNS A record<\/strong> pointing to the <strong>IP address<\/strong> of your K3s server.<br>Example:<br>arduino<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>rancher.example.com -&gt; &lt;Your-K3s-Server-IP&gt;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 4: Install Rancher<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To install Rancher using Helm, first add the Rancher chart repository:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>helm repo add rancher-latest https:\/\/releases.rancher.com\/server-charts\/latest<br>helm repo update<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now, install Rancher on your cluster. Ensure that Traefik is enabled and that you\u2019re installing Rancher in the cattle-system namespace.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl create namespace cattle-system<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>helm install rancher rancher-latest\/rancher \\<br>&nbsp; &#8211;namespace cattle-system \\<br>&nbsp; &#8211;set hostname=rancher.example.com \\<br>&nbsp; &#8211;set replicas=1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will install Rancher and expose it on your domain (rancher.example.com).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 5: Set Up SSL with Let&#8217;s Encrypt<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To ensure secure communication, we\u2019ll set up SSL using <strong>Let&#8217;s Encrypt<\/strong> for automatic SSL certificate management.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a certificate for Rancher<\/strong> by editing the Helm values to include Let&#8217;s Encrypt settings:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>helm upgrade rancher rancher-latest\/rancher \\<br>&nbsp; &#8211;namespace cattle-system \\<br>&nbsp; &#8211;set hostname=rancher.example.com \\<br>&nbsp; &#8211;set replicas=1 \\<br>&nbsp; &#8211;set ingress.tls=true \\<br>&nbsp; &#8211;set ingress.extraAnnotations.&#8221;cert-manager\\.io\/cluster-issuer&#8221;=&#8221;letsencrypt-prod&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Install Cert-Manager<\/strong> (if you haven&#8217;t already) to handle SSL certificates with Let&#8217;s Encrypt:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl apply -f https:\/\/github.com\/jetstack\/cert-manager\/releases\/download\/v1.11.0\/cert-manager.crds.yaml<br>kubectl apply -f https:\/\/github.com\/jetstack\/cert-manager\/releases\/download\/v1.11.0\/cert-manager.yaml<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Create a ClusterIssuer for Let&#8217;s Encrypt<\/strong>:<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Create a ClusterIssuer for Let&#8217;s Encrypt to automatically issue certificates:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>apiVersion: cert-manager.io\/v1<br>kind: ClusterIssuer<br>metadata:<br>&nbsp; name: lets-encrypt-prod<br>spec:<br>&nbsp; acme:<br>&nbsp; &nbsp; email: your-email@example.com<br>&nbsp; &nbsp; server: https:\/\/acme-v02.api.letsencrypt.org\/directory<br>&nbsp; &nbsp; privateKeySecretRef:<br>&nbsp; &nbsp; &nbsp; name: lets-encrypt-prod<br>&nbsp; &nbsp; solvers:<br>&nbsp; &nbsp; &nbsp; &#8211; http01:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ingress:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class: traefik<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Apply the configuration:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl apply -f lets-encrypt-prod-clusterissuer.yaml<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will enable automatic SSL certification via Let&#8217;s Encrypt.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 6: Edit <\/strong><strong>agent-tls-mode<\/strong><strong> Before Registering the Cluster<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that Rancher is installed and accessible via your domain, you need to configure the agent-tls-mode to allow the K3s cluster to register with Rancher.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before registering your existing cluster to Rancher, you&#8217;ll need to edit the agent-tls-mode setting. By default, Rancher uses strict TLS mode, but you may need to change it to system-store for K3s clusters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Patch the <\/strong><strong>agent-tls-mode<\/strong><strong> setting<\/strong>:<br>Run the following kubectl command to change the setting from strict to system-store:<br><br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl patch setting agent-tls-mode -n cattle-system &#8211;type merge -p &#8216;{&#8220;value&#8221;: &#8220;system-store&#8221;}&#8217;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Verify the Change<\/strong>:<br>Confirm that the change has been applied successfully by checking the setting:<br><br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl get setting agent-tls-mode -n cattle-system -o yaml<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>You should now see the value set to system-store.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 7: Register the Existing Cluster to Rancher<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Access the Rancher UI<\/strong> by navigating to https:\/\/rancher.example.com in your browser.<\/li>\n\n\n\n<li><strong>Log in<\/strong> with the credentials you set up during installation.<\/li>\n\n\n\n<li>Once logged in, click on <strong>&#8220;Add Cluster&#8221;<\/strong> and follow the instructions for registering your K3s cluster. You will need to run a registration command on your K3s cluster.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Rancher will generate a command to run on the K3s cluster for registration. Copy and run this command on your K3s node:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>curl -sfL https:\/\/get.rancher.io | sh &#8211;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After the registration process is complete, your K3s cluster will be managed via Rancher!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Port-Forwarding:<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For testing or development purposes, you can use port-forwarding to access Rancher without exposing it externally:<br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl port-forward svc\/rancher -n cattle-system 8080:80<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Then you can access Rancher locally via http:\/\/localhost:8080. However, this is not recommended for production environments as it limits external access.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to access and log in to <strong>Rancher<\/strong> using a <strong>public domain<\/strong>, you will need to:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Set Up a Public Domain<\/strong>: You should have a domain (e.g., rancher.example.com) that points to your Rancher server.<\/li>\n\n\n\n<li><strong>Expose Rancher Using Ingress<\/strong>: Use an <strong>Ingress controller<\/strong> to route the public domain traffic to Rancher running in your K3s cluster.<\/li>\n\n\n\n<li><strong>Set Up SSL\/TLS for Security<\/strong>: It&#8217;s important to secure your Rancher UI with SSL (HTTPS) to ensure data privacy and security.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a step-by-step guide on how to configure Rancher to be accessed via a public domain.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step-by-Step Tutorial for Exposing Rancher via a Public Domain<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Step 1: Prepare Your Public Domain<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you don&#8217;t already have one, purchase a domain name (e.g., rancher.example.com) from a domain registrar.<\/li>\n\n\n\n<li>Point the domain to the IP address of your <strong>K3s cluster<\/strong>. If you have a load balancer or public IP, make sure the domain points to it.\n<ul class=\"wp-block-list\">\n<li>Update your <strong>DNS<\/strong> settings (via your domain registrar) to create an <strong>A record<\/strong> that points to the IP address of your K3s node or LoadBalancer.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Step 2: Set Up an Ingress Controller<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">K3s comes with <strong>Traefik<\/strong> as the default Ingress controller, but you can install any Ingress controller of your choice.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re using <strong>Traefik<\/strong>, it should be installed by default in K3s.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To expose Rancher using Traefik, ensure the Ingress resource for Rancher is correctly set.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Create an Ingress Resource for Rancher<\/strong>:<br>Create a file called rancher-ingress.yaml with the following content:<br><br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>apiVersion: networking.k8s.io\/v1<br>kind: Ingress<br>metadata:<br>&nbsp; name: rancher<br>&nbsp; namespace: cattle-system<br>&nbsp; annotations:<br>&nbsp; &nbsp; cert-manager.io\/cluster-issuer: &#8220;letsencrypt-prod&#8221; # Optional, if using Let&#8217;s Encrypt<br>spec:<br>&nbsp; rules:<br>&nbsp; &#8211; host: rancher.example.com&nbsp; # Replace with your domain<br>&nbsp; &nbsp; http:<br>&nbsp; &nbsp; &nbsp; paths:<br>&nbsp; &nbsp; &nbsp; &#8211; path: \/<br>&nbsp; &nbsp; &nbsp; &nbsp; pathType: Prefix<br>&nbsp; &nbsp; &nbsp; &nbsp; backend:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; service:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: rancher<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; port:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: https<br>&nbsp; tls:<br>&nbsp; &#8211; hosts:<br>&nbsp; &nbsp; &#8211; rancher.example.com<br>&nbsp; &nbsp; secretName: rancher-tls<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Apply this file with:<br><br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl apply -f rancher-ingress.yaml<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>This configures an Ingress to route traffic to Rancher and sets up TLS (SSL) for secure access.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Step 3: Set Up SSL\/TLS (HTTPS)<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To secure Rancher with <strong>HTTPS<\/strong>, you need to configure an SSL certificate for your domain. You can use <strong>Let&#8217;s Encrypt<\/strong> for free SSL certificates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Install cert-manager<\/strong>:<br><br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl create namespace cert-manager<br>kubectl apply -f https:\/\/github.com\/jetstack\/cert-manager\/releases\/download\/v1.9.0\/cert-manager.yaml<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a ClusterIssuer for Let&#8217;s Encrypt<\/strong>: Create a file called letsencrypt-clusterissuer.yaml:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>apiVersion: cert-manager.io\/v1<br>kind: ClusterIssuer<br>metadata:<br>&nbsp; name: letsencrypt-prod<br>spec:<br>&nbsp; acme:<br>&nbsp; &nbsp; server: https:\/\/acme-v02.api.letsencrypt.org\/directory<br>&nbsp; &nbsp; email: your-email@example.com&nbsp; # Replace with your email<br>&nbsp; &nbsp; privateKeySecretRef:<br>&nbsp; &nbsp; &nbsp; name: letsencrypt-prod<br>&nbsp; &nbsp; solvers:<br>&nbsp; &nbsp; &#8211; http01:<br>&nbsp; &nbsp; &nbsp; &nbsp; ingress:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class: traefik<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Apply it with:<br><br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>kubectl apply -f letsencrypt-clusterissuer.yaml<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Create the TLS Secret for Rancher<\/strong>: Cert-manager will automatically create a secret for Rancher&#8217;s domain using the Let&#8217;s Encrypt certificate.<br>The rancher-ingress.yaml file above already points to the secret rancher-tls, which cert-manager will create once the certificate is issued.<br>If you set up cert-manager and the ClusterIssuer correctly, Rancher will automatically obtain and apply an SSL certificate from Let&#8217;s Encrypt for your public domain.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Step 4: Access Rancher via Your Public Domain<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Once the Ingress resource is set up and the SSL certificate is issued (it may take a few minutes), you should be able to access Rancher via your public domain:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open a browser and navigate to https:\/\/rancher.example.com (replace with your actual domain).<\/li>\n\n\n\n<li>Log in to the Rancher UI using the default admin password or credentials you set.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Important Notes:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>DNS Propagation<\/strong>: It may take some time for your DNS records to propagate after updating them with your registrar.<\/li>\n\n\n\n<li><strong>SSL Certificates<\/strong>: If you&#8217;re not using Let&#8217;s Encrypt or cert-manager, you can manually create and upload an SSL certificate for your domain.<\/li>\n\n\n\n<li><strong>Firewall &amp; Security<\/strong>: Ensure your firewall rules allow external traffic to the required ports (80 for HTTP, 443 for HTTPS) and that your K3s nodes are correctly exposed.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By following these steps, you\u2019ve successfully installed <strong>Rancher on a K3s cluster<\/strong>, set up <strong>Ingress<\/strong>, configured your <strong>domain<\/strong>, enabled <strong>SSL<\/strong> with Let&#8217;s Encrypt, and edited the agent-tls-mode for secure registration. Your K3s cluster is now ready to be managed by Rancher!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we&#8217;ll walk through the process of setting up Rancher on a K3s cluster. We&#8217;ll cover prerequisites like setting up an Ingress Controller, configuring a Domain Name, enabling SSL with Let&#8217;s Encrypt, and editing the agent-tls-mode before registering your existing cluster to Rancher. Prerequisites Step 1: Install K3s If you don&#8217;t already have [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4090,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[216,520],"tags":[519,518,517,516],"class_list":["post-4063","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kubernetes-basic","category-rancher","tag-cluster-management-with-rancher","tag-helm","tag-k3s","tag-rancher"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Installing Rancher on K3s with Ingress, Domain, and SSL Configuration - code2deploy.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration - code2deploy.com\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we&#8217;ll walk through the process of setting up Rancher on a K3s cluster. We&#8217;ll cover prerequisites like setting up an Ingress Controller, configuring a Domain Name, enabling SSL with Let&#8217;s Encrypt, and editing the agent-tls-mode before registering your existing cluster to Rancher. Prerequisites Step 1: Install K3s If you don&#8217;t already have [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/\" \/>\n<meta property=\"og:site_name\" content=\"code2deploy.com\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-15T07:26:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-27T15:59:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code2deploy.com\/blog\/wp-content\/uploads\/2024\/12\/Rancher-blog-image-e1740671854652.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2502\" \/>\n\t<meta property=\"og:image:height\" content=\"1550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"enam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"enam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/\"},\"author\":{\"name\":\"enam\",\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#\\\/schema\\\/person\\\/e46930c19b999a87f12566fa8357481b\"},\"headline\":\"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration\",\"datePublished\":\"2024-12-15T07:26:15+00:00\",\"dateModified\":\"2025-02-27T15:59:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/\"},\"wordCount\":1606,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#\\\/schema\\\/person\\\/e46930c19b999a87f12566fa8357481b\"},\"image\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Rancher-blog-image-e1740671854652.png\",\"keywords\":[\"Cluster Management With Rancher\",\"Helm\",\"k3s\",\"Rancher\"],\"articleSection\":[\"Kubernetes Basic\",\"Rancher\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/\",\"url\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/\",\"name\":\"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration - code2deploy.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Rancher-blog-image-e1740671854652.png\",\"datePublished\":\"2024-12-15T07:26:15+00:00\",\"dateModified\":\"2025-02-27T15:59:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/#primaryimage\",\"url\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Rancher-blog-image-e1740671854652.png\",\"contentUrl\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Rancher-blog-image-e1740671854652.png\",\"width\":2502,\"height\":1550},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/\",\"name\":\"code2deploy.com\\\/blog\",\"description\":\"TechOps\",\"publisher\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#\\\/schema\\\/person\\\/e46930c19b999a87f12566fa8357481b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#\\\/schema\\\/person\\\/e46930c19b999a87f12566fa8357481b\",\"name\":\"enam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g\",\"caption\":\"enam\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/code2deploy.com\\\/blog\"],\"url\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/author\\\/enam\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration - code2deploy.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/","og_locale":"en_US","og_type":"article","og_title":"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration - code2deploy.com","og_description":"In this tutorial, we&#8217;ll walk through the process of setting up Rancher on a K3s cluster. We&#8217;ll cover prerequisites like setting up an Ingress Controller, configuring a Domain Name, enabling SSL with Let&#8217;s Encrypt, and editing the agent-tls-mode before registering your existing cluster to Rancher. Prerequisites Step 1: Install K3s If you don&#8217;t already have [&hellip;]","og_url":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/","og_site_name":"code2deploy.com","article_published_time":"2024-12-15T07:26:15+00:00","article_modified_time":"2025-02-27T15:59:23+00:00","og_image":[{"width":2502,"height":1550,"url":"https:\/\/code2deploy.com\/blog\/wp-content\/uploads\/2024\/12\/Rancher-blog-image-e1740671854652.png","type":"image\/png"}],"author":"enam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"enam","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/#article","isPartOf":{"@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/"},"author":{"name":"enam","@id":"https:\/\/code2deploy.com\/blog\/#\/schema\/person\/e46930c19b999a87f12566fa8357481b"},"headline":"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration","datePublished":"2024-12-15T07:26:15+00:00","dateModified":"2025-02-27T15:59:23+00:00","mainEntityOfPage":{"@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/"},"wordCount":1606,"commentCount":5,"publisher":{"@id":"https:\/\/code2deploy.com\/blog\/#\/schema\/person\/e46930c19b999a87f12566fa8357481b"},"image":{"@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/#primaryimage"},"thumbnailUrl":"https:\/\/code2deploy.com\/blog\/wp-content\/uploads\/2024\/12\/Rancher-blog-image-e1740671854652.png","keywords":["Cluster Management With Rancher","Helm","k3s","Rancher"],"articleSection":["Kubernetes Basic","Rancher"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/","url":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/","name":"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration - code2deploy.com","isPartOf":{"@id":"https:\/\/code2deploy.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/#primaryimage"},"image":{"@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/#primaryimage"},"thumbnailUrl":"https:\/\/code2deploy.com\/blog\/wp-content\/uploads\/2024\/12\/Rancher-blog-image-e1740671854652.png","datePublished":"2024-12-15T07:26:15+00:00","dateModified":"2025-02-27T15:59:23+00:00","breadcrumb":{"@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/#primaryimage","url":"https:\/\/code2deploy.com\/blog\/wp-content\/uploads\/2024\/12\/Rancher-blog-image-e1740671854652.png","contentUrl":"https:\/\/code2deploy.com\/blog\/wp-content\/uploads\/2024\/12\/Rancher-blog-image-e1740671854652.png","width":2502,"height":1550},{"@type":"BreadcrumbList","@id":"https:\/\/code2deploy.com\/blog\/installing-rancher-on-k3s-with-ingress-domain-and-ssl-configuration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code2deploy.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Installing Rancher on K3s with Ingress, Domain, and SSL Configuration"}]},{"@type":"WebSite","@id":"https:\/\/code2deploy.com\/blog\/#website","url":"https:\/\/code2deploy.com\/blog\/","name":"code2deploy.com\/blog","description":"TechOps","publisher":{"@id":"https:\/\/code2deploy.com\/blog\/#\/schema\/person\/e46930c19b999a87f12566fa8357481b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code2deploy.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/code2deploy.com\/blog\/#\/schema\/person\/e46930c19b999a87f12566fa8357481b","name":"enam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g","caption":"enam"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g"},"sameAs":["https:\/\/code2deploy.com\/blog"],"url":"https:\/\/code2deploy.com\/blog\/author\/enam\/"}]}},"_links":{"self":[{"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/posts\/4063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/comments?post=4063"}],"version-history":[{"count":1,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/posts\/4063\/revisions"}],"predecessor-version":[{"id":4065,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/posts\/4063\/revisions\/4065"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/media\/4090"}],"wp:attachment":[{"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/media?parent=4063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/categories?post=4063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/tags?post=4063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}