k8s-vind

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

vCluster (vind) Management

vCluster(vind)管理

Manage virtual Kubernetes clusters using kubectl-mcp-server's vind tools (14 tools).
vCluster enables running fully functional Kubernetes clusters as lightweight workloads inside a host cluster, combining multi-tenancy with strong isolation.
使用kubectl-mcp-server的vind工具(共14个工具)管理虚拟Kubernetes集群。
vCluster支持在宿主集群内部将功能完整的Kubernetes集群作为轻量级工作负载运行,兼顾多租户特性与强隔离性。

When to Apply

适用场景

Use this skill when:
  • User mentions: "vCluster", "vind", "virtual cluster", "lightweight cluster"
  • Operations: creating dev environments, multi-tenant isolation, ephemeral clusters
  • Keywords: "virtual Kubernetes", "dev cluster", "pause cluster", "tenant isolation"
在以下场景中使用本技能:
  • 用户提及:"vCluster"、"vind"、"virtual cluster"(虚拟集群)、"lightweight cluster"(轻量级集群)
  • 操作场景:创建开发环境、多租户隔离、临时集群
  • 关键词:"virtual Kubernetes"(虚拟Kubernetes)、"dev cluster"(开发集群)、"pause cluster"(暂停集群)、"tenant isolation"(租户隔离)

Priority Rules

优先级规则

PriorityRuleImpactTools
1Detect vCluster CLI firstCRITICAL
vind_detect_tool
2Check cluster status before operationsHIGH
vind_status_tool
3Connect before kubectl operationsHIGH
vind_connect_tool
4Pause unused clusters to save resourcesMEDIUM
vind_pause_tool
优先级规则影响级别工具
1先检测vCluster CLI关键
vind_detect_tool
2操作前检查集群状态
vind_status_tool
3执行kubectl操作前先连接集群
vind_connect_tool
4暂停未使用的集群以节省资源
vind_pause_tool

Quick Reference

快速参考

TaskToolExample
Detect vCluster
vind_detect_tool
vind_detect_tool()
List clusters
vind_list_clusters_tool
vind_list_clusters_tool()
Create cluster
vind_create_cluster_tool
vind_create_cluster_tool(name)
Connect to cluster
vind_connect_tool
vind_connect_tool(name)
任务工具示例
检测vCluster
vind_detect_tool
vind_detect_tool()
列出集群
vind_list_clusters_tool
vind_list_clusters_tool()
创建集群
vind_create_cluster_tool
vind_create_cluster_tool(name)
连接到集群
vind_connect_tool
vind_connect_tool(name)

Prerequisites

前提条件

  • vCluster CLI: Required for all vind tools
    bash
    curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)"
    chmod +x vcluster && sudo mv vcluster /usr/local/bin/
  • vCluster CLI:所有vind工具都需要依赖它
    bash
    curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)"
    chmod +x vcluster && sudo mv vcluster /usr/local/bin/

Check Installation

检查安装情况

python
vind_detect_tool()
python
vind_detect_tool()

List Clusters

列出集群

python
vind_list_clusters_tool()
python
vind_list_clusters_tool()

Get Cluster Status

获取集群状态

python
vind_status_tool(name="my-vcluster", namespace="vcluster")
python
vind_status_tool(name="my-vcluster", namespace="vcluster")

Get Kubeconfig

获取Kubeconfig

python
vind_get_kubeconfig_tool(name="my-vcluster", namespace="vcluster")
python
vind_get_kubeconfig_tool(name="my-vcluster", namespace="vcluster")

View Logs

查看日志

python
vind_logs_tool(name="my-vcluster", namespace="vcluster", tail=100)
python
vind_logs_tool(name="my-vcluster", namespace="vcluster", tail=100)

Cluster Lifecycle

集群生命周期

Create Cluster

创建集群

python
vind_create_cluster_tool(name="dev-cluster")

vind_create_cluster_tool(
    name="dev-cluster",
    namespace="dev",
    kubernetes_version="v1.29.0",
    connect=True
)

vind_create_cluster_tool(
    name="custom-cluster",
    set_values="sync.toHost.pods.enabled=true,sync.toHost.services.enabled=true"
)
python
vind_create_cluster_tool(name="dev-cluster")

vind_create_cluster_tool(
    name="dev-cluster",
    namespace="dev",
    kubernetes_version="v1.29.0",
    connect=True
)

vind_create_cluster_tool(
    name="custom-cluster",
    set_values="sync.toHost.pods.enabled=true,sync.toHost.services.enabled=true"
)

Delete Cluster

删除集群

python
vind_delete_cluster_tool(name="dev-cluster")

vind_delete_cluster_tool(
    name="dev-cluster",
    namespace="dev",
    delete_namespace=True
)
python
vind_delete_cluster_tool(name="dev-cluster")

vind_delete_cluster_tool(
    name="dev-cluster",
    namespace="dev",
    delete_namespace=True
)

Pause Cluster (Save Resources)

暂停集群(节省资源)

python
vind_pause_tool(name="dev-cluster")
python
vind_pause_tool(name="dev-cluster")

Resume Cluster

恢复集群

python
vind_resume_tool(name="dev-cluster")
python
vind_resume_tool(name="dev-cluster")

Connect/Disconnect

连接/断开连接

Connect to Cluster

连接到集群

python
vind_connect_tool(name="dev-cluster")

vind_connect_tool(
    name="dev-cluster",
    namespace="dev",
    kube_config="~/.kube/vcluster-config"
)
python
vind_connect_tool(name="dev-cluster")

vind_connect_tool(
    name="dev-cluster",
    namespace="dev",
    kube_config="~/.kube/vcluster-config"
)

Disconnect from Cluster

断开集群连接

python
vind_disconnect_tool()
python
vind_disconnect_tool()

Upgrade Cluster

升级集群

python
vind_upgrade_tool(
    name="dev-cluster",
    kubernetes_version="v1.30.0"
)

vind_upgrade_tool(
    name="dev-cluster",
    values_file="new-values.yaml"
)
python
vind_upgrade_tool(
    name="dev-cluster",
    kubernetes_version="v1.30.0"
)

vind_upgrade_tool(
    name="dev-cluster",
    values_file="new-values.yaml"
)

Describe Cluster

描述集群

python
vind_describe_tool(name="dev-cluster")
python
vind_describe_tool(name="dev-cluster")

Platform UI

平台UI

python
vind_platform_start_tool()

vind_platform_start_tool(host="0.0.0.0", port=9898)
python
vind_platform_start_tool()

vind_platform_start_tool(host="0.0.0.0", port=9898)

Development Workflow

开发工作流

Quick Dev Environment

快速搭建开发环境

python
vind_create_cluster_tool(name="dev", connect=True)

kubectl_apply(manifest="""
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: app
        image: nginx:alpine
""")
python
vind_create_cluster_tool(name="dev", connect=True)

kubectl_apply(manifest="""
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: app
        image: nginx:alpine
""")

Multi-Tenant Setup

多租户配置

python
vind_create_cluster_tool(name="team-a", namespace="team-a-vcluster")
vind_create_cluster_tool(name="team-b", namespace="team-b-vcluster")

vind_list_clusters_tool()
python
vind_create_cluster_tool(name="team-a", namespace="team-a-vcluster")
vind_create_cluster_tool(name="team-b", namespace="team-b-vcluster")

vind_list_clusters_tool()

Resource Management

资源管理

python
vind_pause_tool(name="dev")

vind_resume_tool(name="dev")
python
vind_pause_tool(name="dev")

vind_resume_tool(name="dev")

Docker-Specific Configuration

Docker专属配置

For vCluster in Docker (vind) deployments, use
--set
values:
python
vind_create_cluster_tool(
    name="docker-cluster",
    set_values="experimental.docker.network=my-network,experimental.docker.ports[0].containerPort=80"
)
对于Docker环境中的vCluster(vind)部署,使用
--set
参数配置:
python
vind_create_cluster_tool(
    name="docker-cluster",
    set_values="experimental.docker.network=my-network,experimental.docker.ports[0].containerPort=80"
)

Troubleshooting

故障排查

Cluster Not Starting

集群无法启动

text
1. vind_detect_tool()
2. vind_logs_tool(name="my-cluster", tail=200)
3. vind_status_tool(name="my-cluster")
text
1. vind_detect_tool()
2. vind_logs_tool(name="my-cluster", tail=200)
3. vind_status_tool(name="my-cluster")

Connection Issues

连接问题

text
1. vind_disconnect_tool()
2. vind_connect_tool(name="my-cluster")
3. vind_get_kubeconfig_tool(name="my-cluster")
text
1. vind_disconnect_tool()
2. vind_connect_tool(name="my-cluster")
3. vind_get_kubeconfig_tool(name="my-cluster")

Resource Issues

资源问题

text
1. vind_pause_tool(name="unused-cluster")
2. vind_delete_cluster_tool(name="old-cluster", delete_namespace=True)
text
1. vind_pause_tool(name="unused-cluster")
2. vind_delete_cluster_tool(name="old-cluster", delete_namespace=True)

CLI Installation

CLI安装

Install vCluster CLI:
bash
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)"
chmod +x vcluster
sudo mv vcluster /usr/local/bin/

vcluster version
安装vCluster CLI:
bash
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)"
chmod +x vcluster
sudo mv vcluster /usr/local/bin/

vcluster version

Related Skills

相关技能

  • k8s-multicluster - Multi-cluster management
  • k8s-helm - Helm chart operations
  • k8s-operations - kubectl operations
  • k8s-multicluster - 多集群管理
  • k8s-helm - Helm Chart操作
  • k8s-operations - kubectl操作