Source

Smallest Kubernetes Cluster Installation with Rancher as Cluster Manager

Brot & Games
Oct 4, 2018 · 4 min read

Kubernetes or simply K8s is becoming the de-facto standard for deploying workloads on different private, public or hybrid cloud providers like AWS, VMWare, OpenStack etc.

Rancher is a Kubernetes Cluster Manager which can be installed itself into a Kubernetes Cluster which itself can be provisioned with rancher/rke, an extremely simple, lightning fast Kubernetes installer that works everywhere.

This blog post is going to dive you through a

  • minimal (one node) Kubernetes installation using rancher/rke
    (which is easy extensible to N nodes)
  • with Rancher — the Kubernetes Cluster Manager — included.

So if you just wanna spin up a minimal Kubernetes Cluster here we go.

Update on May 5th, 2019: we posted a follow-up article where the second point in the Overview (Spawn a Kubernetess Cluster using rke) is done by defining our infrastructure as code using Terraform and the terraform-rke-provider rather than doing it manually.

Prerequisites

  • Basic knowledge of Kubernetes, Helm and RKE
  • A workstation (probably your Computer/Laptop) with rancher/rke, kubectl and helm installed — referred as devstation
  • A (virtual) machine with SSH access keys — referred as node1
    Minimum: 2GB RAM / 1 vCPU
    Recommendation: 4GB RAM / 2 vCPU

This installation method is tested with virtual machines of HetznerCloud, DigitalOcean and AWS (Referral links with free quota included).

Overview

  1. Prepare node (virtual/bare metal machine)
  2. Spawn a Kubernetes Cluster using rke
  3. Install Cert-manager and Rancher (including TLS) via Helm
  4. Set password for user admin
  5. Login & enjoy the smallest Kubernetes Cluster with Rancher included

A little bit of History

Kubernetes is not easy to set up. There are plenty of tools and methods with their respective pros and cons.

Rancher (including rancher/rke) is a tool to deploy and manage Kubernetes Clusters.

How It All Started

In 2014, containers were quickly becoming the de-facto large-scale production platform for application deployment. In founding Rancher Labs, the initial goal was to provide organizations with the tools needed to take full advantage of container technology and provide the best possible experience for running Docker in production. Fast-forward to present day, the ecosystem changed and so did we. We are more confident than ever that containers and Kubernetes will enable a new era of application portability. Rancher is a major step forward in open source container management, accelerating the adoption of Kubernetes for organizations globally.

Source (up and down): https://rancher.com/ (04.10.18)

Rancher is enterprise management for Kubernetes.
Every distro. Every cluster. Every cloud.

Rancher is tightly coupled to Kubernetes since their 2.x release.

Step-by-step guide

SSH into your (virtual) machine node1 and install Docker version needed for Kubernetes (as of Oct. 2018: 18.06.2).
This walkthrough refers to Linux Ubuntu 16.04 — other distributions may need different (docker) installation methods.

Configure rke from devstation by following the instructions — basically you have to set your IP address (or domain) and location of the SSH key to connect to your node1.

Test your Cluster installation with command above (Gist rke.sh)

Next step is to install/init helm (including the the server-side component tiller) and install cert-manager and rancher using helm. Rancher server is designed to be “secure by default” and requires SSL/TLS configuration thus we are going to use the letsEncypt option.

You should create a DNS record pointing your domain eg. rancher.your-host.com to your IP address and provide an E-Mail address if you want to use Let’s Encrypt for certificates.

`helm list` will output installed Helm charts

Access Rancher with https://rancher.your-host.com and initially set password for user admin.

Login & enjoy the smallest Kubernetes Cluster with Rancher included :)

Provide the password set in the previous step for user admin and login
Rancher installs itself in the Kubernetes Cluster (with helm install rancher) and imports the local cluster created with rke
Dashboard of local cluster

Ressources

Final Words and Updates

You are free and welcome to post your K8s installation/cluster management alternatives or hints in the comments.

This article has been submitted to Hacker News and reddit on the 2nd of May 2019.

There’s a follow-up article introducing Terraform in our workflow to help us build reproducable and idempotent deployments by defining our infrastructure as code:
Deploy a Kubernetes Cluster using Terraform and RKE Provider.

Thanks for reading.

💋 Keep it simple and stupid.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store