π 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.

(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.

(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:
-
πΌ LinkedIn: https://www.linkedin.com/in/rifaterdemsahin/
-
π¦ Twitter: https://x.com/rifaterdemsahin
-
π₯ YouTube: https://www.youtube.com/@RifatErdemSahin
-
π» GitHub: https://github.com/rifaterdemsahin
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