Coder Social home page Coder Social logo

nagagopi19 / local-setup-of-rancher-with-rke Goto Github PK

View Code? Open in Web Editor NEW

This project forked from suse-rancher-community/local-setup-of-rancher-with-rke

0.0 0.0 0.0 142 KB

This repository contains the source code for a local Kubernetes cluster setup using Vagrant and Rancher Kubernetes Engine (RKE). It also outlines the steps to install Rancher.

Shell 100.00%

local-setup-of-rancher-with-rke's Introduction

Local Setup of Rancher with RKE

This repository contains the source code for a local Kubernetes cluster setup using Vagrant and Rancher Kubernetes Engine (RKE). It also outlines the steps to install Rancher.

Rancher Logo

Requirements/Prerequisites

Create Virtual Machines (VMs)

To spin up the virtual machines, run the following command at the root level of the project directory:

vagrant up

Once the VMs are up and running, you can check their status with vagrant status or by connecting to anyone of them using vagrant ssh [hostname]. Once you've confirmed that all machines are running with no issues, copy over the generated SSH keys from your workstation/host to each guest machine with the following commands:

ssh-copy-id root@[relevant ip address]

When prompted, enter the root user password configured in the bootstrap node script.

Provision/Create Kubernetes cluster with RKE

To provision the cluster on the VMs, run the rke config command. You will be presented with a series of questions to which the answers will be used to declare the cluster config in a generated cluster.yml file upon completion. Alternatively, you can create the cluster.yml file and populate it with your desired configuration. Once you have the cluster.yml file, run the following command:

rke up

When the cluster has been provisioned, the following files will be generated in the root directory:

  • cluster.rkestate - the cluster state file
  • kube_config_cluster.yml - kube config file

To add the cluster to your context, copy the kube config file:

cp kube_config_cluster.yml ~/.kube/config

If you do not have a ./kube directory on your machine you will have to create one.

The last step will be to check that you can connect to your cluster:

kubectl cluster-info

or

kubectl config current-context

If you have a tool like K9s, you can start it up to see the objects that are currently running in your cluster.

Install Rancher on RKE Cluster

The steps below outline how to install Rancher on your RKE cluster.

Install Cert Manager

Rancher relies on cert-manager to issue certificates from Rancher's own generated CA or to request Let's Encrypt certificates.

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.4.0/cert-manager.yaml

Create cattle-system namespace

Create the namespace where the Rancher application resources will be deployed.

kubectl create namespace cattle-system

Add the Helm Chart Repository

helm repo add rancher-stable https://releases.rancher.com/server-charts/stable

Install Rancher using Helm (with Rancher generated CA)

helm install rancher rancher-stable/rancher \
  --namespace cattle-system \
  --set hostname=<hostname>

You may need to update the hosts on your local machine to resolve to the addresses of the Virtual Machines. To do this, go to /etc/hosts and add an entry for your hostname like this:

172.16.129.21   <hostname>
172.16.129.22   <hostname>
172.16.129.23   <hostname>

Lastly, go to your web browser and enter your selected hostname and you should see the following landing page.

Rancher Landing Page

local-setup-of-rancher-with-rke's People

Contributors

lukemwila avatar curx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.