feat: complete E2E deployment flow with storage layered config and values template versioning
- Instance deployment: charts browser, deploy modal, instances list - Values Template version management (create/history/rollback) - Storage layered config (cluster > workspace > shared priority) - Cluster credential decryptIfNeeded for mixed encrypted/plaintext kubeconfig - YAML syntax validation (client-side + server-side warning) - Frontend: charts, instances, storage, templates, admin pages - Backend: storage service, instance service, cluster service, helm client - Multi-Tenant Kubeconfig.md: added by user
This commit is contained in:
@ -142,6 +142,8 @@ CREATE INDEX IF NOT EXISTS idx_workspaces_name ON workspaces(name);
|
||||
CREATE TABLE IF NOT EXISTS storage_backends (
|
||||
id VARCHAR(36) PRIMARY KEY,
|
||||
workspace_id VARCHAR(36),
|
||||
owner_id VARCHAR(36),
|
||||
cluster_id VARCHAR(36),
|
||||
name VARCHAR(255) NOT NULL,
|
||||
type VARCHAR(50) NOT NULL,
|
||||
config JSONB NOT NULL,
|
||||
@ -154,6 +156,8 @@ CREATE TABLE IF NOT EXISTS storage_backends (
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_storage_workspace ON storage_backends(workspace_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_storage_cluster ON storage_backends(cluster_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_storage_default_cluster ON storage_backends(cluster_id, is_default) WHERE cluster_id IS NOT NULL;
|
||||
|
||||
-- ===== Chart References 表 =====
|
||||
CREATE TABLE IF NOT EXISTS chart_references (
|
||||
@ -183,7 +187,7 @@ CREATE TABLE IF NOT EXISTS values_templates (
|
||||
is_default BOOLEAN DEFAULT FALSE,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
UNIQUE(workspace_id, chart_reference_id, name)
|
||||
UNIQUE(workspace_id, chart_reference_id, name, version)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_values_template_chart ON values_templates(chart_reference_id);
|
||||
|
||||
15
backend/scripts/migrations/20250418_add_cluster_storage.sql
Normal file
15
backend/scripts/migrations/20250418_add_cluster_storage.sql
Normal file
@ -0,0 +1,15 @@
|
||||
-- Migration: Add cluster_id to storage_backends for layered storage config
|
||||
-- This enables storage backends to be associated with specific clusters
|
||||
-- Priority order: User Override > Workspace Default > Cluster Default > Shared Storage
|
||||
|
||||
-- Add cluster_id column to storage_backends table
|
||||
ALTER TABLE storage_backends ADD COLUMN IF NOT EXISTS cluster_id VARCHAR(36) REFERENCES clusters(id) ON DELETE SET NULL;
|
||||
|
||||
-- Index for faster lookups by cluster
|
||||
CREATE INDEX IF NOT EXISTS idx_storage_backends_cluster ON storage_backends(cluster_id);
|
||||
|
||||
-- Composite index for cluster + default storage lookup
|
||||
CREATE INDEX IF NOT EXISTS idx_storage_backends_default_cluster ON storage_backends(cluster_id, is_default) WHERE cluster_id IS NOT NULL;
|
||||
|
||||
-- Add comment for documentation
|
||||
COMMENT ON COLUMN storage_backends.cluster_id IS 'Associated cluster ID for cluster-level default storage. NULL means workspace or shared storage.';
|
||||
Reference in New Issue
Block a user