Developers Notes
  • Welcome
  • Developer
    • Java
      • JUnit
        • Parameterized Test
        • Introduction to WireMock
      • Maven
        • Resource Reader and Writer
        • JUnit with Maven
        • Maven Run
        • A Quick Guide to Maven Wrapper
      • Spring
        • Autowired vs Resource
        • Spring OpenFeign 사용시 https 신뢰하는 방법
        • Aspect with Annotation
        • Spring JPA에서 Tibero를 사용하기 위한 설정
        • Spring module dependency
        • Mockito
          • Autowired @Value field in Spring with Mockito
        • SpringBoot Hybernate application.yml
        • ReflectionTestUtils
        • Spring Properties File Outside jar
        • Spring @RequestParam Annotation
        • Properties with Spring and Spring Boot
        • Passing JVM Options from Gradle bootRun
        • Securing Spring Boot API With API Key and Secret
        • Why Is Field Injection Not Recommended?
        • An Overview of Identifiers in Hibernate/JPA
      • Etcs
        • BigDecimal 사용시 주의 사항
        • static factory methods common naming conventions
        • List of Lists into a List (Stream)
        • Return null in stream
        • Logging with Lombok
        • JPA
        • Big-O Java Collections
    • MySQL
      • Active Connections on MySQL
      • MariaDB-Galera
      • FOUND_ROWS
      • MySQL Group Replication Requirements
      • Data Types Explicit Default Handling
    • C/C++
      • Autotool 사용법
      • Intruduction to GNU Autotools
      • mysql
        • C Api Flow
        • MySQL Connector/C++ 8.3 Developer Guide
      • Common vulnerabilities guide for C programmers
      • HTTP in C++
      • JSON in C++
      • How to get memory usage at runtime using C++?
      • How to get time in milliseconds using C++ on Linux?
      • Sleep Functions in C++
      • Calculate Cpu Usage on Linux as Top
    • CryptoGraphy
      • 인증 기관(CA;Certificate Authority) 구성하고 인증서 발급하기
      • KeyTool Import PrivateKey, Certificate
      • Java Keytool 사용법
      • PKCS, Public Key Cryptography Standard
      • CER/DER/CRT/CSR 형식 파일이란?
      • FIPS 140-2
      • SSL 인증서 발급
      • 사용법, tip 정리
      • OpenSSL
        • OpenSSL guide
        • Openssl RSA Private Key Encrypt
      • How to Read PEM File to Get Public and Private Keys
    • PKCS#11 API
      • PKCS#11 API-강좌1
      • PKCS#11 API-강좌2
      • PKCS#11 API-강좌3
      • PKCS#11 API-강좌4
      • PKCS#11 API-강좌5(C 언어로 된 Sample Code)
      • PKCS#11 API-강좌6(EC Key 생성 및 Signing)
    • Warehouse of PKI
    • GoLang
      • go-cshared-examples
      • Fun building shared libraries in Go
      • Golang time
      • Encoding Json
  • OpenSSL
    • OpenSSL Document
      • openssl-req
      • x509v3_config
      • Openssl Example
    • Creating a Self-Signed Certificate With OpenSSL
    • Openssl 3.x Provider
      • Writing OpenSSL Provider Skeleton
    • OpenSSL Certificate Command
  • DevOps
    • Docker
      • Environment Variables for MariaDB or MySQL Docker
      • Container Technology, Docker
      • Docker Trouble Shooting
      • Docker BuildKit
      • How to clear Docker cache and free up space on your system
    • Cloud
      • Serverless Architecture
      • AWS
        • AWS 주요 자습서 Link
        • Diagram-as-code for AWS architecture.
        • AWS Architecture icon
      • Install MariaDB Galera by Helm
      • Jenkinsfile VIM syntax highlighting
      • Cloud Development Kit for Kubernetes
    • VM
      • vagrant를 사용한 vm 설치 방법
    • Etcs
      • Logstash
        • Installing Logstash
        • Configuration Logstash Output
      • Rancher Install
      • Install ELK
      • Simpler Tool for Deploying Rancher
    • Ubuntu
      • Install SFTP Client
  • Etcs
    • Etcs
      • Useful Tools
      • Links
      • Entertainment
Powered by GitBook
On this page
  • Getting Started with RancherD
  • Vagrant Test
Edit on GitHub
  1. DevOps
  2. Etcs

Simpler Tool for Deploying Rancher

As part of Rancher 2.5, we are excited to introduce a new, simpler way to install Rancher called RancherD.

RancherD is a single binary you can launch on a host to bring up a Kubernetes cluster bundled with a deployment of Rancher itself.

This means you just have one thing to manage: RancherD. Configuration and upgrading are no longer two-step processes where you first have to deal with the underlying Kubernetes cluster and then deal with the Rancher deployment.

Note: This feature is still in preview as we gather feedback about its usability and address bugs found by the community. It’s not quite ready for production use.

Getting Started with RancherD

Let’s take a look at how you can get started with RancherD.

First, run the installer:

curl -sfL https://get.rancher.io | sh -

This will download RancherD and install it as a systemd unit on your host.

If that systemd note caught your eye: yes, at this time, only OSes that leverage systemd are supported.

Once installed, the rancherd binary will be on your path. You can check out its help text like this:

rancherd --help
NAME:
   rancherd - Rancher Kubernetes Engine 2

USAGE:
   rancherd [global options] command [command options] [arguments...]

VERSION:
   v2.5.0-rc8 (HEAD)

COMMANDS:
   server       Run management server
   agent        Run node agent
   reset-admin  Bootstrap and reset admin password
   help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --debug        Turn on debug logs [$RKE2_DEBUG]
   --help, -h     show help
   --version, -v  print the version

Next, let’s launch RancherD. You can launch the binary directly via rancherd server, but we’re going to stick with the systemd service for this demo.

systemctl enable rancherd-server.service
systemctl start rancherd-server.service

You can follow the logs of the cluster coming up thusly:

journalctl -eu rancherd-server -f

It will take a couple minutes to come up.

Once the cluster is up and the logs have stabilized, you can start interacting with the cluster. Here’s how:

First, setup RancherD’s kubeconfig file and kubectl:

export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin

Now, you can start issuing kubectl commands. Rancher is deployed as a daemonset on the cluster, let’s take a look:

kubectl get daemonset rancher -n cattle-system

kubectl get pod -n cattle-system

We’re almost ready to jump into the Rancher UI, but first you need to set the initial Rancher password. Once the rancher pod is up and running, run the following:

rancherd reset-admin

This will give you the URL, username and password needed to log into Rancher. Follow that URL, plug in the credentials, and you’re up and running with Rancher!

Vagrant Test

If you want to build with virtualbox and vagrant, check below files:

Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

class Node
    def initialize(name, cpus, memory, ip, port, script)
        @node_name = name
        @node_cpus = cpus
        @node_memory = memory
        @node_ip = ip
		@node_port = port
        @node_script = script
    end

    attr_reader :node_name
    attr_reader :node_cpus
    attr_reader :node_memory
    attr_reader :node_ip
    attr_reader :node_port
    attr_reader :node_script
end

Vagrant.configure("2") do |config|

 rancher = Node.new("rancher", 4, 4 * 1024, "192.168.56.10", [
				 {guest: 80, host: 80},
				 {guest: 443, host: 443},
				 {guest: 8443, host: 8443}], "rancher_install.sh")

 master1 = Node.new("master1", 2, 2 * 1024, "192.168.56.11", [
				 {guest: 80, host: 20080},
				 {guest: 443, host: 20443}], "docker_install.sh")

 master2 = Node.new("master2", 2, 2 * 1024, "192.168.56.12", [
				 {guest: 80, host: 20081},
				 {guest: 443, host: 20443}], "docker_install.sh")

 master3 = Node.new("master3", 2, 2 * 1024, "192.168.56.13", [
				 {guest: 80, host: 20082},
				 {guest: 443, host: 20444}], "docker_install.sh")
				
 worker1 = Node.new("worker1", 2, 2 * 1024, "192.168.56.14", [], "docker_install.sh")
 worker2 = Node.new("worker2", 2, 2 * 1024, "192.168.56.15", [], "docker_install.sh")
 worker3 = Node.new("worker3", 2, 2 * 1024, "192.168.56.16", [], "docker_install.sh")


 nodes = [rancher, master1, master2, master3, worker1, worker2, worker3]

 nodes.each do |node|

	config.vm.define node.node_name do |instance|

 		instance.vm.box = "ubuntu/focal64"
		instance.vm.hostname = node.node_name
		instance.vm.network "private_network", ip: node.node_ip
		instance.vm.provision "shell", path: node.node_script

		ports = node.node_ports
		ports.each do |port|
			instance.vm.network "forwarded_port", port[:guest], host: port[:host]
		end

		instance.vm.provider "virtualbox" do |vb|
			vb.name = node.node_name
			vb.cpus = node.node_cpus
			vb.memory = node.node_memory
		end
	end
 end

end

Rancher Port Requirements

rancher_install.sh
#!/bin/bash

# https://www.suse.com/c/rancher_blog/introducing-rancherd-a-simpler-tool-for-deploying-rancher/
# export port 8443

echo "[Task 1] Swapoff"
swapoff -a

# install rancher
echo "[Task 2] Install rancher"
curl -sfL https://get.rancher.io | sh -
systemctl enable rancherd-server.service
systemctl start rancherd-server.service

# rancher config
echo "[Task 3] config"
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin


echo 'export KUBECONFIG=/etc/rancher/rke2/rke2.yaml' >> ~/.bashrc
echo 'export PATH=$PATH:/var/lib/rancher/rke2/bin' >> ~/.bashrc

docker_install.sh
#!/bin/bash
echo "[Node] Swap Off"
swapoff -a

# Install Docker
echo "[Node] Install Docker"
curl https://releases.rancher.com/install-docker/20.10.sh | sh

apt-get install -y vim net-tools

systemctl daemon-reload && systemctl restart docker


echo "[Node] ifconfig"
ifconfig | grep inet

PreviousInstall ELKNextUbuntu

Last updated 2 years ago

Introducing RancherD: A Simpler Tool for Deploying Rancher | SUSE CommunitiesSUSE Communities
Port Requirements | Rancher Manager
Logo
Logo