← Back to Blog

πŸš€ How to Set Up Rancher Using Minikube in GitHub Codespaces: A Step-by-Step Guide πŸ› οΈ

πŸš€ How to Set Up Rancher Using Minikube in GitHub Codespaces: A Step-by-Step Guide πŸ› οΈ If you're looking to get Rancher up and running on Minikube in GitHub Codespaces, you've come to the right place!

πŸš€ How to Set Up Rancher Using Minikube in GitHub Codespaces: A Step-by-Step Guide πŸ› οΈ

If you're looking to get Rancher up and running on Minikube in GitHub Codespaces, you've come to the right place! In this guide, I'll walk you through setting it all up, step by step, so you can harness the power of Rancher with Minikube from the convenience of GitHub Codespaces.

Let’s dive right in! πŸŠβ€β™‚οΈ


πŸ“ What You'll Learn:

By the end of this guide, you will be able to:

  • Install Minikube in your GitHub Codespace environment

  • Set up Rancher on top of your Minikube cluster

  • Access the Rancher UI from GitHub Codespaces


Step 1: 🎯 Launch GitHub Codespaces

To begin, ensure that you have GitHub Codespaces enabled on your repository. If not, go ahead and create one. It’s your cloud development environment where we’ll set everything up.

how-to-set-1.png
(You can click the green "Code" button on your repo and choose "Open with Codespaces")


Step 2: πŸš€ Install Minikube in Codespaces

Minikube allows you to run Kubernetes locally, but here, we'll configure it to run inside the GitHub Codespace.

Start by installing Minikube:

sudo apt-get update -y
sudo apt-get install -y apt-transport-https
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube /usr/local/bin/

Then, verify the installation:

minikube version

You should see the version information displayed.


Step 3: πŸ› οΈ Start Minikube

Next, we'll start Minikube with Docker as the driver:

minikube start --driver=docker

Minikube will pull the necessary images and start the Kubernetes cluster.


Step 4: 🌟 Install Helm (Optional but Recommended)

Helm makes it easier to install applications in Kubernetes. If you don’t have Helm already installed in your Codespace, install it with:

curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

You can verify Helm installation using:

helm version


Step 5: πŸ—οΈ Deploy Rancher Using Helm

With Helm and Minikube set up, you can now install Rancher.

  • Add the Rancher Helm chart repository:

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

  • Install Rancher using the following Helm command:

kubectl create namespace cattle-system
helm install rancher rancher-latest/rancher --namespace cattle-system --set hostname=rancher.localhost

This will start Rancher and set it up with the provided hostname.


Step 6: πŸ”— Access Rancher UI

To access the Rancher UI from GitHub Codespaces, you'll need to use port forwarding. Run:

kubectl -n cattle-system port-forward svc/rancher 8080:80

Once it's running, open your Codespace's ports tab and forward port 8080. This will allow you to access Rancher at localhost:8080 directly within your browser.

how-to-set-2.png
(Rancher UI running inside GitHub Codespaces)


πŸš€ What You’ve Achieved

  • πŸŽ‰ You successfully installed Minikube in GitHub Codespaces.

  • πŸ’₯ You deployed Rancher on Minikube using Helm.

  • πŸ–₯️ You can now access the Rancher UI and manage Kubernetes clusters directly from Codespaces!


πŸ”— Connect with me:


I hope this guide helped! If you run into any issues, feel free to reach out or comment below! Happy coding! πŸ‘¨β€πŸ’»


Imported from rifaterdemsahin.com Β· 2024