Skip to content

Commit dd5a0fc

Browse files
authored
Merge pull request #4126 from illume/local-cluster
docs: local-cluster: Add local cluster usage tutorial
2 parents f5ccc65 + 4e20bc9 commit dd5a0fc

19 files changed

+288
-0
lines changed

docs/learn/index.md

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

0 commit comments

Comments
 (0)