feat(k8s): 事件页简化、可视化编辑 P0、Deployment 五 Tab 修复
- 事件中心:去彩虹图表,改专业排名列表 + 主题变量 - 网络/配置/存储:ResourceVisualEditor 双向 YAML 同步、导入 YAML、新建 - vite manualChunks 减小 embed 主包体积 - run.sh:多副本强制 MODE=release + MySQL/Redis - Deployment 编辑:共享 manifest、统一 saveDeploymentManifest - 修复存储挂载 initContainers 混入 bug、补 Tolerations UI - 服务 Tab:applyYAML 创建 + ResourceVisualEditor 编辑 - 基本信息:Pod 模板标签 + Selector 同步
This commit is contained in:
1 parent
339b24a579
commit
d0cf71b05a
17 files changed
+814
-497
No files matched your search
@@ -0,0 +1,63 @@
|
||||
// 网络/配置/存储资源新建时的空 manifest 模板 // Logan.Li
|
||||
|
||||
export function createEmptyManifest(resource: string, namespace: string, name: string): Record<string, any> {
|
||||
switch (resource) {
|
||||
case 'services':
|
||||
return {
|
||||
apiVersion: 'v1',
|
||||
kind: 'Service',
|
||||
metadata: { name, namespace },
|
||||
spec: {
|
||||
type: 'ClusterIP',
|
||||
selector: {},
|
||||
ports: [{ name: 'http', port: 80, targetPort: 80, protocol: 'TCP' }],
|
||||
},
|
||||
};
|
||||
case 'ingresses':
|
||||
return {
|
||||
apiVersion: 'networking.k8s.io/v1',
|
||||
kind: 'Ingress',
|
||||
metadata: { name, namespace },
|
||||
spec: {
|
||||
ingressClassName: 'nginx',
|
||||
rules: [{
|
||||
host: '',
|
||||
http: {
|
||||
paths: [{
|
||||
path: '/',
|
||||
pathType: 'Prefix',
|
||||
backend: { service: { name: '', port: { number: 80 } } },
|
||||
}],
|
||||
},
|
||||
}],
|
||||
},
|
||||
};
|
||||
case 'configmaps':
|
||||
return {
|
||||
apiVersion: 'v1',
|
||||
kind: 'ConfigMap',
|
||||
metadata: { name, namespace },
|
||||
data: {},
|
||||
};
|
||||
case 'secrets':
|
||||
return {
|
||||
apiVersion: 'v1',
|
||||
kind: 'Secret',
|
||||
metadata: { name, namespace },
|
||||
type: 'Opaque',
|
||||
data: {},
|
||||
};
|
||||
case 'pvcs':
|
||||
return {
|
||||
apiVersion: 'v1',
|
||||
kind: 'PersistentVolumeClaim',
|
||||
metadata: { name, namespace },
|
||||
spec: {
|
||||
accessModes: ['ReadWriteOnce'],
|
||||
resources: { requests: { storage: '1Gi' } },
|
||||
},
|
||||
};
|
||||
default:
|
||||
return { apiVersion: 'v1', kind: 'Unknown', metadata: { name, namespace } };
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user