---
title: 在 Kubernetes 中安装 KubeVela
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

### 1. 安装条件:

- Kubernetes cluster >= v1.19 && <= v1.29

KubeVela 依赖 Kubernetes 作为管控平面，你需要自行搭建生产可用的 Kubernetes 集群，支持的方式包括：

- Alibaba Cloud [ACK Service](https://www.aliyun.com/product/kubernetes)
- AWS [EKS Service](https://aws.amazon.com/cn/eks)
- Azure [AKS Service](https://azure.microsoft.com/en-us/services/kubernetes-service)
- Google [GKE Service](https://cloud.google.com/kubernetes-engine)
- Rancher [K3s](https://rancher.com/docs/k3s/latest/en/quick-start/) or [RKE](https://github.com/rancher/rke/releases)

### 2. 安装 KubeVela 命令行 {#install-vela-cli}

KubeVela CLI 提供了常用的集群和应用管理能力。

<Tabs
    className="unique-tabs"
    defaultValue="script"
    values={[
      {label: 'Script', value: 'script'},
      {label: 'Homebrew', value: 'homebrew'},
      {label: 'Download directly from releases', value: 'download'},
      {label: 'Docker', value: 'docker'},
    ]}>
<TabItem value="script">

** MacOS/Linux **

```shell script
curl -fsSl https://kubevela.io/script/install.sh | bash
```

**Windows**

```shell script
powershell -Command "iwr -useb https://kubevela.io/script/install.ps1 | iex"
```

</TabItem>
<TabItem value="homebrew">

**macOS/Linux**

首先更新你的 Homebrew。注意，使用 Homebrew 安装只支持安装正式 release 的版本。

```shell
brew update
```

安装 Vela CLI。

```shell
brew install kubevela
```

</TabItem>
<TabItem value="download">

- 通过 [release log](https://github.com/kubevela/kubevela/releases) 下载二进制压缩文件。
- 解压文件并将二进制文件移动到 $PATH 路径下。

```shell script
sudo mv ./vela /usr/local/bin/vela
```

> [安装提示](https://github.com/kubevela/kubevela/issues/625):
> 如果你使用的是 macOS，会弹出因为开发者的包无法验证，“vela”无法打开的警告。
>
> macOS 对可以在系统中运行的软件施加了更严格的限制。您可以通过打开“系统偏好设置 -> 安全和隐私 -> 常规”，并选择“从任何位置下载的程序”来临时解决此问题。

</TabItem>
<TabItem value="docker">

如果你需要在容器环境中使用 Vela CLI，我们提供了 CLI 镜像 `oamdev/vela-cli`:

```
$ docker run --rm -it -v ~/.kube:/root/.kube oamdev/vela-cli version
CLI Version: master
Core Version: v1.3.4
GitRevision: git-1d823780
GolangVersion: go1.17.10
```

参考 [使用 Vela CLI 镜像文档](../platform-engineers/system-operation/vela-cli-image.md) 获取更多用法。

</TabItem>
</Tabs>

### 3. 安装 KubeVela Core

<Tabs
    className="unique-tabs"
    defaultValue="vela"
    values={[
      {label: 'Default', value: 'vela'},
      {label: 'Helm', value: 'helm'},
    ]}>
<TabItem value="vela">

```shell script
$ vela install
```

<details> <summary> 正常安装出现下述日志 </summary>

  ```shell
  ...
  Watching for changes to Job kubevela-vela-core-cluster-gateway-tls-secret-patch with timeout of 18m0s
  Add/Modify event for kubevela-vela-core-cluster-gateway-tls-secret-patch: ADDED
  kubevela-vela-core-cluster-gateway-tls-secret-patch: Jobs active: 0, jobs failed: 0, jobs succeeded: 0
  Add/Modify event for kubevela-vela-core-cluster-gateway-tls-secret-patch: MODIFIED
  kubevela-vela-core-cluster-gateway-tls-secret-patch: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
  Add/Modify event for kubevela-vela-core-cluster-gateway-tls-secret-patch: MODIFIED
  kubevela-vela-core-cluster-gateway-tls-secret-patch: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
  Add/Modify event for kubevela-vela-core-cluster-gateway-tls-secret-patch: MODIFIED
  Starting delete for "kubevela-vela-core-admission" ServiceAccount
  Starting delete for "kubevela-vela-core-admission" ClusterRole
  Starting delete for "kubevela-vela-core-admission" ClusterRoleBinding
  Starting delete for "kubevela-vela-core-admission" Role
  Starting delete for "kubevela-vela-core-admission" RoleBinding
  Starting delete for "kubevela-vela-core-admission-patch" Job
  Starting delete for "kubevela-vela-core-cluster-gateway-admission" ServiceAccount
  Starting delete for "kubevela-vela-core-cluster-gateway-admission" Role
  Starting delete for "kubevela-vela-core-cluster-gateway-admission" RoleBinding
  Starting delete for "kubevela-vela-core-cluster-gateway-tls-secret-patch" Job

  KubeVela control plane has been successfully set up on your cluster.
  If you want to enable dashboard, please run "vela addon enable velaux"
  ```

</details>

</TabItem>

<TabItem value="helm">

如果你是 Helm 用户，你可以通过 Helm 命令完成 VelaCore 的安装和升级：

> helm v3.2.0+ required

```
helm repo add kubevela https://charts.kubevela.net/core
helm repo update
helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wait
```

</TabItem>
</Tabs>

### 4 安装 VelaUX

VelaUX 是 KubeVela 的仪表板。 它是在你的集群中运行的 Web 应用程序。 你可以使用浏览器访问它。
如果你不使用 KubeVela 的 UI 控制台，这是可选的。

请参考 [VelaUX 插件文档](../reference/addons/velaux.md).


### 5. 自定义安装或升级

请参考[升级和高级安装选项](../platform-engineers/advanced-install.mdx)