Skip to content

Commit 67d91df

Browse files
illumewillspacecase
andcommitted
docs: local-cluster: Add local cluster usage tutorial
Co-authored-by: William Case <williamcase@microsoft.com>
1 parent 31348ec commit 67d91df

18 files changed

+276
-0
lines changed
522 KB
Loading
388 KB
Loading
266 KB
Loading
624 KB
Loading
539 KB
Loading
219 KB
Loading
283 KB
Loading

docs/learn/local-cluster/index.md

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
---
2+
title: Local Cluster
3+
sidebar_position: 6
4+
---
5+
6+
7+
This is the Headlamp Local Cluster Setup Guide. If you are interested to know how run a cluster locally with Headlamp, then you are at the right place.
8+
9+
## Introduction
10+
11+
Kubernetes is powerful, but getting started can be intimidating. Until now, Headlamp required users to bring their own Kubernetes cluster. This meant setting up infrastructure, managing configurations, and often incurring cloud costs. For developers and Kubernetes operators who just want to test an app or learn Kubernetes basics, this setup was a barrier.
12+
13+
With the new Local Cluster feature, Headlamp removes that friction. You can now create and manage a fully functional Kubernetes cluster directly from the Headlamp UI. No terminal, no cloud provider, no YAML required. This makes Kubernetes more accessible than ever, especially for:
14+
15+
- Developers testing apps before deploying to production
16+
- Students and learners exploring Kubernetes for the first time
17+
18+
Whether you're deploying a sample app or just curious about how Kubernetes works, Headlamp now gives you a one-click experience to get started locally.
19+
20+
## What You're Creating
21+
22+
When you use Headlamp's Local Cluster feature, you're setting up a fully functional Kubernetes cluster on your local machine using Minikube. This cluster behaves just like a remote Kubernetes environment but runs entirely on your desktop, giving you a fast, cost-free, and isolated space to experiment and build.
23+
24+
This cluster is:
25+
26+
- **Self-contained**: No need for cloud infrastructure or external services
27+
- **Integrated with Headlamp**: Managed entirely through the Headlamp UI
28+
- **Ideal for testing and learning**: Quickly deploy apps, inspect resources, and explore Kubernetes features without setup overhead.
29+
30+
Once created, the cluster appears in your Headlamp interface like any other connected cluster. You can start and stop it, deploy applications, view logs, and interact with it using Headlamp's visual tools. It's a great way to:
31+
32+
- Try out Kubernetes features without risk
33+
- Explore application behavior and resource configurations
34+
- Learn how clusters work in a hands-on, visual way
35+
36+
This setup is especially useful for developers who want to iterate quickly, students who are just getting started, or anyone looking to explore Kubernetes without needing a cloud account or command-line expertise.
37+
38+
39+
40+
## Key Capabilities
41+
42+
Once your local cluster is up and running, Headlamp provides a rich set of capabilities to help you interact with it visually and intuitively. These features are designed to support learning, experimentation, and lightweight development workflows.
43+
44+
- **Create and delete clusters** directly from the Headlamp UI, without needing to use the terminal or write configuration files
45+
- **Deploy applications** using built-in tools, including support for manifests and Helm charts
46+
- **View cluster details** such as node status, resource usage, and active workloads
47+
- **Start and stop the cluster** as needed, giving you control over local resource usage
48+
- **Explore resources** like pods, services, deployments, and volumes
49+
through a visual interface
50+
- **Edit YAML configurations** with syntax highlighting and validation
51+
- **Use context actions** to quickly view, edit, or remove resources
52+
from lists
53+
- **Install and use plugins** such as Prometheus for metrics or the AI
54+
Assistant for natural language queries
55+
56+
These capabilities make Headlamp a powerful tool for working with Kubernetes locally, whether you're exploring how things work or building something new.
57+
58+
59+
60+
61+
62+
63+
64+
65+
66+
## Getting started
67+
68+
With these detailed instructions we're going to show how to add a local cluster, deploy something, and then delete the cluster.
69+
70+
### Add Local cluster
71+
72+
#### Add Local Cluster (Step 1) - Select the Add cluster button
73+
74+
<img alt="The Overview Home page with the Add cluster link highlighted" src="select-add-cluster-1.png" />
75+
76+
#### Add Local Cluster (Step 2) - Select the local cluster provider to create a local cluster on your PC
77+
78+
<img alt="Page with a Providers list and the Create Local Cluster section add button highlighted" src="select-local-cluster-provider-2.png" />
79+
80+
#### Add Local Cluster (Step 3) - appropriate driver is detected
81+
82+
Depending on the platform (Mac/Windows PC/Linux) different VM drivers are detected on the users machine.
83+
84+
Note how there is a warning about memory usage? We try to limit the amount of memory allocated to as small as is needed for development and testing needs. For users with low resource laptops, we warn them in case they don't have enough memory as well.
85+
86+
On Windows HyperV can be used which comes built into Windows. On Mac no extra software is required (it gets bundled with vfkit).
87+
88+
<img alt="Create cluster screen with the start button highlighted. Shows the user is warned about being low on memory." src="create-cluster-start-3.png" />
89+
90+
91+
#### Add Local Cluster (Step 4) - Cluster has been created, now go Home to use it
92+
93+
It shows some logs during cluster creation to show what's happening. When it's done we can go to the Overview on the Home to see what's happening in our cluster.
94+
95+
<img alt="Headlamp cluster creation information showing the cluster has been created" src="cluster-started-press-home-4.png" />
96+
97+
The cluster has been created. How do you access it from the command line? If you use kubectl on the command line you can access your cluster with that. The `.kube/config` file has been modified with the new cluster added.
98+
99+
```shell
100+
kubectl config use-context minikube-1
101+
kubectl get pods
102+
```
103+
104+
### Deploy an application
105+
106+
#### Deploy an application (Step 1) - Apply some yaml
107+
108+
109+
This is a demo web server deployment to copy/paste into Headlamp.
110+
111+
```yaml
112+
apiVersion: apps/v1
113+
kind: Deployment
114+
metadata:
115+
name: demo-nginx
116+
spec:
117+
replicas: 1
118+
selector:
119+
matchLabels:
120+
app: demo-nginx
121+
template:
122+
metadata:
123+
labels:
124+
app: demo-nginx
125+
spec:
126+
containers:
127+
- name: nginx
128+
image: nginx:latest
129+
ports:
130+
- containerPort: 80
131+
132+
---
133+
apiVersion: v1
134+
kind: Service
135+
metadata:
136+
name: demo-nginx-service
137+
spec:
138+
selector:
139+
app: demo-nginx
140+
ports:
141+
- protocol: TCP
142+
port: 80
143+
targetPort: 80
144+
type: NodePort
145+
```
146+
147+
<img alt="Screen shot of headlamp showing the yaml getting applied" src="apply-yaml-5.png" />
148+
149+
150+
#### Deploy an application (Step 2) - See the pod details that it has deployed
151+
152+
<img alt="A screen shot of Headlamp showing the pod details that it has deployed" src="pod-details-6.png" />
153+
154+
155+
#### Deploy an application (Step 3) - See the deployment in the browser
156+
157+
Here we see the deployed application in the browser.
158+
159+
<img alt="We see the nginx demo application deployed in the browser" src="nginx-in-browser-7.png" />
160+
161+
162+
163+
### Show cluster details
164+
165+
#### Show cluster details (Overview)
166+
167+
On the cluster overview page you can see events related to the cluster and CPU and memory, if the pods are running and if the nodes are healthy.
168+
169+
<img alt="Cluster overview with cpu memory and events shown" src="cluster-overview-8.png" />
170+
171+
#### Show cluster details (Search for our demo deployment)
172+
173+
You can search for different resources in the Kubernetes cluster. Here we see the search results for the demo deployment we just made.
174+
175+
<img alt="Shows the search items for nginx used in the demo" src="search-results-nginx-9.png" />
176+
177+
178+
179+
### Delete Cluster
180+
181+
When you want to clean up the cluster you have the option of deleting it, or stopping it to be started up later.
182+
183+
Deleting it frees all the memory and disk used by the cluster, and deletes all resources in the local Kubernetes cluster.
184+
185+
#### Delete Cluster (Step 1) - select action menu for cluster you want to delete
186+
<img alt="Cluster action menu with delete option highlighted" src="cluster-action-delete-10.png" />
187+
188+
189+
#### Delete Cluster (Step 2) - confirm deletion
190+
191+
192+
<img alt="Headlamp is showing a dialog confirming deletion" src="delete-confirmation-11.png" />
193+
194+
195+
### Starting and stopping clusters
196+
197+
Instead of deleting a cluster, you might want to just stop it instead. This frees up the memory and CPU usage on your laptop, but the disk space is still allocated to the cluster.
198+
199+
200+
Go to the Overview Home page, and you'll see a start and stop button.
201+
202+
<img alt="Cluster overview page showing start and stop buttons" src="start-stop-buttons-12.png" />
203+
204+
<img alt="Headlamp Overview Home page showing start and stop cluster buttons" src="overview-start-stop-13.png" />
205+
206+
## Post-Deployment Experience
207+
208+
Once your local cluster is created, it becomes fully integrated into your Headlamp interface. From here, you can begin interacting with it just like you would with any other Kubernetes cluster.
209+
210+
Here's what you'll see and be able to do:
211+
212+
- The cluster will appear in the **Cluster Chooser**, allowing you to switch between clusters easily
213+
- You'll have access to **real-time status indicators**, showing whether the cluster is running, stopped, or in transition
214+
- You can **start or stop the cluster** with a single click, giving you control over your system's resources
215+
- The **resource explorer** lets you browse workloads, services, pods, and more using a visual interface
216+
- You can **view and edit YAML configurations** directly in Headlamp, with syntax highlighting and validation
217+
- **Context actions** are available throughout the UI, allowing you to quickly inspect, modify, or remove resources
218+
219+
This experience is designed to be intuitive and responsive, making it easy to explore Kubernetes concepts, troubleshoot deployments, and iterate on your work without leaving the Headlamp UI.
220+
221+
222+
## What You Can Do Next
223+
224+
With your local cluster running, you can begin exploring Kubernetes in a hands-on way. Headlamp makes it easy to:
225+
226+
- Familiarize yourself with core concepts like pods, services, and deployments
227+
- Experiment with resource configurations using the YAML editor
228+
- Deploy sample applications to observe behavior and structure
229+
- Monitor activity and resource usage through visual tools
230+
- Extend your environment with plugins for metrics and insights
231+
232+
This is a safe space to learn, explore, and build without needing cloud infrastructure or command line tools.
233+
234+
235+
### See relationships between resources with the map view
236+
237+
<img alt="The map view showing relationships between deployments pods and namespaces" src="map-view-14.png" />
238+
239+
### Experiment with resource configurations using the YAML editor
240+
241+
<img alt="Showing the yaml editor for a deployment" src="yaml-editor-15.png" />
242+
243+
### Extend your environment with plugins for metrics and insights
244+
245+
<img alt="Plugin catalog screen shot showing different plugins available" src="plugin-catalog-16.png" />
246+
247+
### Ask the AI assistant
248+
249+
<img alt="ai assistant plugin showing a chat interface" src="ai-assistant-17.png" />
250+
251+
252+
253+
254+
## Roadmap
255+
256+
Headlamp Local is growing to support more flexible and complete local Kubernetes experiences. Upcoming improvements include:
257+
258+
- Support for **Windows nodes**, enabling local testing across operating systems
259+
- **Resource presets** for faster cluster setup based on common development needs
260+
261+
262+
## FAQ
263+
264+
- How much system resource does the local cluster use?
265+
- By default, the local cluster uses approximately 3 GB of memory
266+
and 20 GB of disk space.
267+
- Can I run multiple clusters at once?
268+
- Yes, you can run multiple clusters simultaneously.
269+
- What if Minikube fails to start?
270+
- Headlamp provides error messages with details and suggestions.
271+
If one driver fails, you can try another supported option such
272+
as Docker, VirtualBox, or Hyper-V depending on your operating
273+
system.
274+
- Where can I get help or report issues?
275+
- You can report issues or ask questions in the [Headlamp Plugins
276+
GitHub issue tracker](https://github.com/headlamp-k8s/plugins/issues).
480 KB
Loading
661 KB
Loading

0 commit comments

Comments
 (0)