In this post I will walk you through installing a Kubernetes or (K8S) cluster on your laptop. We will then configure it to run a micoservice shopping cart website. I am running on a MAC but this should be similar for a Windows based deployment too.
Note: If you are running a Mac M4 there is an open issue for the demo app. At the moment it won’t run on the Mac M4. Please standby for a resolution.
Let’s get started!
First you will need to have a way to run containers on your laptop. While you can use Docker Desktop or Colima I have found Rancher Desktop to be easier and less prone to updates causing issues. Download and install the version of Rancher Desktop for your Operating System. Open the Main window and configure the following so that you have enough resources to run the K8S Server and the micro services app:

Now we need to disable the Rancher desktop Kubernetes engine. I know this sounds counter productive but this blog post is part of a series of steps to follow. While you can practice Kubernetes with the built in Kubernetes it is not the same as installing Kubernetes in Containers. I will explain why in later posts. See what you got yourself into now? Can’t stop gotta move on!

Now open a terminal and type the following:
docker ps

We are now ready to install our K8S server. The K8S server will be running inside a container that’s running a server and all this is running on virtual machine in Rancher. Confused yet? Don’t be, for the next blog posts we need K8S to look and feel like a real server so this is how we do it on a Laptop just to make it easy.
Install K3D to run your K8S server inside a container you can use wget or curl
wget
wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
curl
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v5.0.0 bash
We will also need the Kubernetes Command line tools so we can run kubectl commands. Use this link to: Install Kubectl and be sure to choose the right platform for your Mac.
Next we will need to install Helm command line tool so we can install the Demo Application
Now we are ready to install our K8S server. Run the following command:
k3d cluster create rkb-otel-demo

Once the cluster starts, run the following command:
kubectl get pods

Looks good, now let’s create a namespace for the new app we are going to install. A namespace is basically like a folder. It is just to keep track of your application deployments. Run the following command:
kubectl create namespace opentelemetry-demo

Now change to the namespace with the following command:
kubectl config set-context --current --namespace=opentelemetry-demo

Now before we deploy or app we need to create a values file. This file basically tells Helm what options we want on the app. It’s a lot like a custom config file. Copy and past the following command and press enter:
echo 'default: envOverrides: - name: OTEL_COLLECTOR_NAME value: grafana-k8s-monitoring-alloy-receiver.default.svc.cluster.local opentelemetry-collector: enabled: false jaeger: enabled: false prometheus: enabled: false grafana: enabled: false' >> values.yaml
Then run this command to make sure it created it:
cat values.yaml

Now install the app with the following command:
helm install --values values.yaml rkb-demo open-telemetry/opentelemetry-demo

While it may look like it’s done it’s likely not ready yet. Type the following to check if the pods are all up, you may need to run this command a couple times:
kubectl get pods

Once all the pods have a status of Running you are ready to explore the app, you will need to port forward to the proxy pod from your laptop. Run the following command:
kubectl --namespace opentelemetry-demo port-forward svc/frontendproxy 8080:8080

Now open a browser to localhost:8080 and you should see a shopping cart app, feel free to click around and even order something, it’s not real it’s running on your laptop.

Yay, you did it.
Now you are ready to visualize your cluster and app in Grafana Cloud. In this next post I will show you how to install a monitor and send it up to Grafana Cloud so you can monitor Metrics, Logs, Traces and a whole lot more!
Note: if you are done playing around you can stop this app and the cluster as it does take up resources on your laptop.
First do a control C to stop the port forward in the terminal. Then enter the following command:
k3d cluster stop rkb-otel-demo
Then just close Rancher desktop.
When you start Rancher again just type:
k3d cluster start rkb-otel-demo
Thanks for the edu-taining post!
Pingback: My First Grafana Cloud – RyanKellysBlog.com