KubernetesController is a C# WinForms desktop application designed to simplify the monitoring and management of a Kubernetes cluster running on K3s.
The application provides a graphical interface for users who want to inspect, create, delete, and export Kubernetes resources without relying exclusively on command-line tools such as kubectl.
It also includes a lightweight local AI assistant powered by Ollama and Llama 3.2 1B, capable of answering questions about the application and the Kubernetes resources displayed in it.
The main goal of this project is to provide an accessible desktop interface for interacting with a K3s cluster through the Kubernetes REST API.
The application connects directly to the Kubernetes API server using:
- the IP address or URL of the K3s server;
- port
6443; - a Kubernetes ServiceAccount bearer token.
For development or testing, it can also connect through kubectl proxy.
The project was developed as an educational application focused on Kubernetes administration, REST API communication, C# desktop development, RBAC authentication, resource visualization, and local AI integration.
The dashboard presents a visual overview of the connected cluster, including:
- total number of nodes;
- ready and unavailable nodes;
- total CPU capacity;
- total memory capacity;
- pod capacity;
- total namespaces;
- total pods;
- running pods;
- deployments and active deployments;
- total services;
- available ingresses;
- master node IP address;
- most frequently used container image;
- pods grouped by namespace;
- node status charts;
- memory capacity by node;
- container images detected in the cluster.
The Nodes tab displays detailed information about each cluster node, such as:
- node name;
- readiness state;
- roles;
- Kubernetes and K3s versions;
- operating system;
- architecture;
- internal IP address;
- CPU and memory capacity;
- pod capacity;
- conditions;
- labels;
- annotations;
- addresses;
- taints;
- system information;
- managed fields.
The Namespaces tab allows the user to:
- list all namespaces;
- inspect namespace details;
- create namespaces;
- delete namespaces;
- export a selected namespace as YAML or JSON.
The Pods tab allows the user to:
- list pods from all namespaces;
- inspect pod status and configuration;
- view containers, images, conditions, labels, annotations, owners, volumes, and tolerations;
- create pods;
- delete pods;
- export a selected pod as YAML or JSON.
When creating a pod, the user can select an existing namespace and choose or enter a container in the name:image format.
The Deployments tab allows the user to:
- list deployments from all namespaces;
- inspect replica status;
- inspect containers, images, selectors, strategy, conditions, labels, annotations, and managed fields;
- create deployments;
- define the number of replicas;
- delete deployments;
- export a selected deployment as YAML or JSON.
The Services tab allows the user to:
- list services from all namespaces;
- inspect service type, ClusterIP, external IP, ports, selectors, load balancer information, labels, annotations, finalizers, and managed fields;
- create
ClusterIP,NodePort, andLoadBalancerservices; - configure service port, target port, and protocol;
- delete services;
- export a selected service as YAML or JSON.
The Ingresses section allows the user to:
- list ingresses from all namespaces;
- inspect hosts, paths, destination services, addresses, TLS information, labels, annotations, load balancer data, and managed fields;
- create ingresses;
- select an existing namespace;
- select an existing destination service;
- automatically use a service port when available;
- delete ingresses;
- export a selected ingress as YAML or JSON.
Namespaces, pods, deployments, services, and ingresses can be exported individually.
The export workflow is:
- Select a resource.
- Click Export.
- Choose either YAML or JSON.
- Select the destination folder.
- Save the file.
The default file name is based on the selected Kubernetes resource.
XML export is not currently supported.
The application includes a ChatBot tab connected to a local Ollama instance running inside the Ubuntu VM.
The chatbot uses:
llama3.2:1b
It can help users with questions such as:
- What is a pod?
- What is the purpose of a namespace?
- How do I create a deployment?
- How do I delete a service?
- How do I export a resource as YAML or JSON?
- What does
CrashLoopBackOffmean? - What resources are currently loaded by the application?
- How do I navigate through the application?
The assistant is restricted to topics related to:
- Kubernetes;
- K3s;
- KubernetesController;
- resources displayed by the application;
- basic errors and operations supported by the interface.
Questions unrelated to the application are rejected with an appropriate message.
The chatbot does not directly create, delete, or modify resources. It only explains how to perform operations through the application.
The screenshots below are stored in the docs/images directory.
┌──────────────────────────────────────┐
│ KubernetesController │
│ C# WinForms desktop application │
└──────────────────┬───────────────────┘
│
│ HTTPS + Bearer token
▼
┌──────────────────────────────────────┐
│ Kubernetes API Server │
│ K3s on Ubuntu VM │
│ https://VM_IP:6443 │
└──────────────────────────────────────┘
┌──────────────────────────────────────┐
│ KubernetesController ChatBot tab │
└──────────────────┬───────────────────┘
│
│ HTTP
▼
┌──────────────────────────────────────┐
│ Ollama on Ubuntu VM │
│ http://VM_IP:11434 │
│ Model: llama3.2:1b │
└──────────────────────────────────────┘
The application automatically builds the default Ollama address from the host used for the Kubernetes connection.
Example:
Kubernetes API:
https://192.168.1.50:6443
Ollama:
http://192.168.1.50:11434
The chatbot connection status is displayed only inside the ChatBot tab. A temporary Ollama connection failure does not prevent the rest of the application from opening or managing the cluster.
- C#;
- Windows Forms;
- Kubernetes REST API;
- K3s;
- JSON;
- YAML;
- HTTP and HTTPS;
- bearer token authentication;
- Kubernetes RBAC;
- Ollama;
- Llama 3.2 1B;
- Ubuntu Server VM;
- Visual Studio.
- Windows 10 or Windows 11;
- Visual Studio with C# and Windows desktop development support;
- network access to the Ubuntu VM.
- Ubuntu Server;
- K3s installed and running;
- Ollama installed and running;
llama3.2:1binstalled;- ports
6443and11434accessible from the Windows host.
The application requires a Kubernetes ServiceAccount and the necessary RBAC permissions.
Create a file named:
kubernetes-controller-access.yaml
Add the following configuration:
apiVersion: v1
kind: Namespace
metadata:
name: kubernetes-controller
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubernetes-controller-sa
namespace: kubernetes-controller
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubernetes-controller-admin
subjects:
- kind: ServiceAccount
name: kubernetes-controller-sa
namespace: kubernetes-controller
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.ioApply it:
sudo k3s kubectl apply -f kubernetes-controller-access.yamlGenerate a token:
sudo k3s kubectl create token kubernetes-controller-sa \
-n kubernetes-controller \
--duration=8760hCopy the generated token and use it on the application connection screen.
The
cluster-adminrole is convenient for a controlled educational environment, but it provides unrestricted access to the cluster. A production deployment should use a dedicated least-privilege ClusterRole.
Confirm that Ollama is installed:
ollama --versionConfirm that the model is available:
ollama listInstall the model when required:
ollama pull llama3.2:1bTest it locally:
ollama run llama3.2:1bBy default, Ollama may only listen on localhost. To allow the Windows application to connect to it, edit the systemd service:
sudo systemctl edit ollama.serviceAdd:
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"Reload and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart ollamaCheck its state:
sudo systemctl status ollama --no-pagerTest it from the Windows computer:
curl http://VM_IP:11434Expected response:
Ollama is running
-
Start the Ubuntu VM.
-
Confirm that K3s is running:
sudo systemctl status k3s --no-pager
-
Confirm that Ollama is running:
sudo systemctl status ollama --no-pager
-
Open the solution in Visual Studio.
-
Build the project.
-
Start the application.
-
Enter the Ubuntu VM IP address.
-
Paste the Kubernetes ServiceAccount token.
-
Connect to the cluster.
The application normally builds the Kubernetes API URL as:
https://VM_IP:6443
When no token is provided, the application may use a kubectl proxy connection such as:
http://VM_IP:8001
The application uses endpoints such as:
GET /version
GET /api/v1/nodes
GET /api/v1/namespaces
GET /api/v1/pods
GET /apis/apps/v1/deployments
GET /api/v1/services
GET /apis/networking.k8s.io/v1/ingresses
Namespaced operations use endpoints such as:
/api/v1/namespaces/{namespace}/pods
/apis/apps/v1/namespaces/{namespace}/deployments
/api/v1/namespaces/{namespace}/services
/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses
Create and delete operations are performed through the corresponding Kubernetes REST API endpoints.
KubernetesController/
├── KubernetesController/
│ ├── Form1.cs
│ ├── DashboardForm.cs
│ ├── DashboardPods.partial.cs
│ ├── DashboardDeployments.partial.cs
│ ├── DashboardServicesIngresses.partial.cs
│ ├── DashboardChatbot.partial.cs
│ ├── CreateNamespaceForm.cs
│ ├── CreatePodForm.cs
│ ├── CreateDeploymentForm.cs
│ ├── CreateServiceForm.cs
│ ├── CreateIngressForm.cs
│ ├── Models/
│ └── Services/
├── docs/
│ └── images/
├── kubernetes-controller-access.yaml
├── LICENSE
└── README.md
The exact structure may vary depending on the current project version.
Do not commit the following information to GitHub:
- Kubernetes bearer tokens;
- ServiceAccount tokens;
- credentials;
- kubeconfig files containing certificates or tokens;
- exported resources containing secrets.
Recommended .gitignore entries:
.vs/
bin/
obj/
*.user
*.suo
*.cache
*.log
appsettings.local.json
secrets.json
token.txt
kubeconfigIf a token is accidentally exposed, generate a new one and stop using the previous token.
- The application is intended primarily for educational and controlled laboratory environments.
- The current chatbot uses a small 1B parameter model, so complex answers may be limited.
- Chatbot availability depends on the Ubuntu VM and the Ollama service.
- The chatbot is informational and does not execute cluster operations.
- XML export is not supported.
- The current RBAC example uses
cluster-admin. - Advanced resources such as ConfigMaps, Secrets, StatefulSets, DaemonSets, Jobs, CronJobs, and persistent volumes are not yet managed by the interface.
- least-privilege Kubernetes RBAC;
- support for ConfigMaps and Secrets;
- support for StatefulSets, DaemonSets, Jobs, and CronJobs;
- pod log visualization;
- Kubernetes event visualization;
- resource editing;
- YAML import and deployment;
- filtering and searching;
- namespace-specific views;
- configurable Ollama model and endpoint;
- chatbot conversation history;
- more detailed cluster health diagnostics;
- secure configuration storage;
- automated tests;
- installer or release package.
This project demonstrates practical knowledge in:
- Kubernetes resource management;
- K3s administration;
- Kubernetes REST API usage;
- authentication and RBAC;
- asynchronous HTTP communication in C#;
- JSON and YAML processing;
- WinForms interface development;
- local AI model integration;
- virtual machine networking;
- software documentation.
Add a LICENSE file to define how other users may use, modify, and distribute the project.
For an open-source educational project, the MIT License is a common option.
Developed as an academic and portfolio project focused on Kubernetes, K3s, C# WinForms, REST APIs, and local artificial intelligence.








