Skip to content

luogangyi/KubeCanvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KubeCanvas Logo

KubeCanvas

Visual Kubernetes Resource Orchestration Tool

License Vue Vite

English | δΈ­ζ–‡


πŸ“– Introduction

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.

✨ Features

🎨 Visual Resource Editing

  • 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

πŸ”— Smart Connection System

  • 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

πŸ“¦ Supported Kubernetes Resources

  • Workloads: Deployment, StatefulSet, Pod, Job, CronJob
  • Networking: Service, Ingress
  • Configuration: ConfigMap, Secret
  • Storage: PersistentVolumeClaim (PVC)

πŸš€ Kubernetes Integration

  • 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

πŸ–₯️ Screenshots

KubeCanvas Screenshot

πŸ› οΈ Tech Stack

  • Frontend Framework: Vue 3 with Composition API
  • Build Tool: Vite
  • Flow Visualization: Vue Flow
  • HTTP Client: Axios

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Access to a Kubernetes cluster (optional, for deployment features)

Installation

# Clone the repository
git clone https://github.com/yourusername/KubeCanvas.git
cd KubeCanvas

# Install dependencies
npm install

# Start development server
npm run dev

The application will be available at http://localhost:5173

Deploy to Kubernetes Cluster

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:8080

Security 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.

Install via Helm

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 default

Configuration

To 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'
}

πŸ“– Usage Guide

Creating Resources

  1. Add Resources: Drag resources from the left sidebar onto the canvas
  2. Configure Properties: Click on a resource to open the properties panel
  3. Edit Settings: Modify resource properties like name, replicas, image, etc.

Connecting Resources

  1. 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
  2. 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

Deploying to Kubernetes

  1. Design your resource composition on the canvas
  2. Click "πŸ’Ύ Save to K8s" button
  3. Resources will be created with unified labels for easy management

Managing Compositions

  • 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

πŸ“ Project Structure

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

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Vue Flow - For the excellent flow visualization library
  • Kubernetes - For the amazing container orchestration platform
  • All contributors who help improve this project

Made with ❀️ for the Kubernetes community

About

A modern, schema-driven graphical editor for Kubernetes resources. Seamlessly bridge the gap between visual forms and raw YAML with real-time validation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors