KubeCanvas is a modern, visual Kubernetes resource orchestration tool that allows you to design and manage Kubernetes resource compositions through an intuitive drag-and-drop interface. Instead of writing complex YAML files manually, you can quickly create and connect Kubernetes resources on a visual canvas.
- Drag & Drop: Simply drag Kubernetes resources from the sidebar onto the canvas
- Visual Connections: Connect resources with intuitive connection lines to define relationships
- Real-time Preview: See your resource configuration in real-time
- Connection Brush Tool: Use the connection brush to easily link resources together
- 4-Point Connection: Each resource node has 4 connection points (top, bottom, left, right)
- Auto-routing: Connections automatically calculate the optimal path based on node positions
- Cancel Support: Press ESC or right-click to cancel connection operations
- Workloads: Deployment, StatefulSet, Pod, Job, CronJob
- Networking: Service, Ingress
- Configuration: ConfigMap, Secret
- Storage: PersistentVolumeClaim (PVC)
- Direct Deployment: Save and deploy resources directly to your Kubernetes cluster
- Composition Management: Organize resources into compositions with unified labels
- Load Existing: Load and visualize existing resource compositions from your cluster
- Frontend Framework: Vue 3 with Composition API
- Build Tool: Vite
- Flow Visualization: Vue Flow
- HTTP Client: Axios
- Node.js 18+
- npm or yarn
- Access to a Kubernetes cluster (optional, for deployment features)
# Clone the repository
git clone https://github.com/yourusername/KubeCanvas.git
cd KubeCanvas
# Install dependencies
npm install
# Start development server
npm run devThe application will be available at http://localhost:5173
For quick deployment to an existing Kubernetes cluster:
# Clone the repository
git clone https://github.com/luogangyi/KubeCanvas.git
cd KubeCanvas
# Deploy RBAC, Deployment, and internal Service
kubectl apply -f deploy/01-rbac.yaml
kubectl apply -f deploy/02-deployment.yaml
kubectl apply -f deploy/03-service.yaml
# Access the application through a local tunnel
kubectl port-forward svc/kubecanvas 8080:80 -n default
# http://localhost:8080Security note: KubeCanvas proxies Kubernetes API calls with its ServiceAccount. Do not expose it with NodePort/LoadBalancer/Ingress unless you put authentication and network controls in front of it.
If you prefer using Helm:
# Clone the repository
git clone https://github.com/luogangyi/KubeCanvas.git
cd KubeCanvas
# Install the chart
helm install kubecanvas ./charts/kubecanvas
# Access through a local tunnel
kubectl port-forward svc/kubecanvas 8080:80 -n defaultTo connect to your Kubernetes cluster, create .env.local file:
export default {
apiServer: 'https://your-k8s-api-server:6443',
token: 'your-service-account-token',
namespace: 'default'
}- Add Resources: Drag resources from the left sidebar onto the canvas
- Configure Properties: Click on a resource to open the properties panel
- Edit Settings: Modify resource properties like name, replicas, image, etc.
-
Using Connection Brush:
- Click and drag the "Connection Brush" tool from the toolbar
- Drag to the source node, then continue to the target node
- Release to create the connection
-
Using Connection Points:
- Hover over a node to see connection points (small circles)
- Click and drag from a connection point to another node
- Release on the target node or its connection point
- Design your resource composition on the canvas
- Click "πΎ Save to K8s" button
- Resources will be created with unified labels for easy management
- Refresh: Click "π Refresh" to load existing compositions from cluster
- Load: Click on a composition in the sidebar to load it onto the canvas
- Clear: Click "ποΈ Clear" to reset the canvas
KubeCanvas/
βββ src/
β βββ components/
β β βββ Canvas.vue # Main canvas component
β β βββ Sidebar.vue # Resource sidebar
β β βββ PropertyPanel.vue # Properties editor
β β βββ nodes/
β β βββ BaseNode.vue # Base resource node component
β βββ composables/
β β βββ useK8sApi.js # Kubernetes API composable
β βββ config/
β β βββ k8s.js # K8s configuration
β βββ utils/
β β βββ resourceTemplates.js # Resource YAML templates
β βββ App.vue # Root component
β βββ main.js # Application entry
β βββ style.css # Global styles
βββ index.html
βββ vite.config.js
βββ package.json
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Vue Flow - For the excellent flow visualization library
- Kubernetes - For the amazing container orchestration platform
- All contributors who help improve this project

