自定义安装和升级

安装 KubeVela 生产环境

1. 安装条件:

  • Kubernetes cluster >= v1.19 && <= v1.22

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

2. 安装 KubeVela 命令行

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

  • Script
  • Homebrew
  • Download directly from releases
  • Docker

MacOS/Linux

  1. curl -fsSl https://kubevela.net/script/install.sh | bash -s v1.4.9

Windows

  1. powershell -Command "iwr -useb https://kubevela.net/script/install.ps1 | iex"

macOS/Linux

Update your brew first. Please note that the brew method only supports the installation of the official release version.

  1. brew update

Then install KubeVela CLI

  1. brew install kubevela
  • 通过 release log 下载二进制压缩文件。
  • 解压文件并将二进制文件移动到 $PATH 路径下。
  1. sudo mv ./vela /usr/local/bin/vela

Installation Tips: If you are using a Mac system, it will pop up a warning that “vela” cannot be opened because the package from the developer cannot be verified.

MacOS imposes stricter restrictions on the software that can run in the system. You can temporarily solve this problem by opening System Preference ->Security & Privacy -> General and clicking on Allow Anyway.

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

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

参考 使用 Vela CLI 镜像文档 获取更多用法。

3. Install KubeVela Core

  • Default
  • Helm
  1. $ vela install --version v1.4.9

正常安装出现下述日志

  1. ...
  2. Watching for changes to Job kubevela-vela-core-cluster-gateway-tls-secret-patch with timeout of 18m0s
  3. Add/Modify event for kubevela-vela-core-cluster-gateway-tls-secret-patch: ADDED
  4. kubevela-vela-core-cluster-gateway-tls-secret-patch: Jobs active: 0, jobs failed: 0, jobs succeeded: 0
  5. Add/Modify event for kubevela-vela-core-cluster-gateway-tls-secret-patch: MODIFIED
  6. kubevela-vela-core-cluster-gateway-tls-secret-patch: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
  7. Add/Modify event for kubevela-vela-core-cluster-gateway-tls-secret-patch: MODIFIED
  8. kubevela-vela-core-cluster-gateway-tls-secret-patch: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
  9. Add/Modify event for kubevela-vela-core-cluster-gateway-tls-secret-patch: MODIFIED
  10. Starting delete for "kubevela-vela-core-admission" ServiceAccount
  11. Starting delete for "kubevela-vela-core-admission" ClusterRole
  12. Starting delete for "kubevela-vela-core-admission" ClusterRoleBinding
  13. Starting delete for "kubevela-vela-core-admission" Role
  14. Starting delete for "kubevela-vela-core-admission" RoleBinding
  15. Starting delete for "kubevela-vela-core-admission-patch" Job
  16. Starting delete for "kubevela-vela-core-cluster-gateway-admission" ServiceAccount
  17. Starting delete for "kubevela-vela-core-cluster-gateway-admission" Role
  18. Starting delete for "kubevela-vela-core-cluster-gateway-admission" RoleBinding
  19. Starting delete for "kubevela-vela-core-cluster-gateway-tls-secret-patch" Job
  20. KubeVela control plane has been successfully set up on your cluster.
  21. If you want to enable dashboard, please run "vela addon enable velaux"

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

helm v3.2.0+ required

  1. helm repo add kubevela https://charts.kubevela.net/core
  2. helm repo update
  3. helm install --create-namespace -n vela-system kubevela kubevela/vela-core --version 1.4.9 --wait

4 安装 VelaUX

请参考 VelaUX 插件文档.

升级

1. 升级 CLI

  • Script
  • Homebrew
  • Download directly from releases
  • Docker

MacOS/Linux

  1. curl -fsSl https://kubevela.io/script/install.sh | bash -s v1.4.9

Windows

Only the official release version is supported.

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

macOS/Linux

Update your brew first. Please note that the brew method only supports the installation of the official release version.

  1. brew update

Then install KubeVela CLI

  1. brew install kubevela
  • 通过 release log 下载二进制压缩文件。
  • 解压文件并将二进制文件移动到 $PATH 路径下。
  1. sudo mv ./vela /usr/local/bin/vela

Installation Tips: If you are using a Mac system, it will pop up a warning that “vela” cannot be opened because the package from the developer cannot be verified.

MacOS imposes stricter restrictions on the software that can run in the system. You can temporarily solve this problem by opening System Preference ->Security & Privacy -> General and clicking on Allow Anyway.

Pull the latest image from the docker registry, or specify a version as tag:

  1. docker pull oamdev/vela-cli:latest

2. 升级 Vela Core

请先升级 Vela CLI 到最新的稳定版本,默认情况下将安装与 CLI 匹配的 Vela Core 版本。

  1. vela install --version v1.4.9

3. 升级 VelaUX

  1. vela addon enable velaux --version v1.4.7

Uninstall

在卸载 KubeVela 之前,请确保已删除所有应用和禁用所有插件。

  1. 卸载 VelaUX
  1. vela addon disable velaux
  1. 卸载 KubeVela Core
  1. vela uninstall
  1. 卸载 CRD
  1. kubectl get crd |grep oam | awk '{print $1}' | xargs kubectl delete crd

Install KubeVela with cert-manager

By default, KubeVela will use a self-signed certificate provided by kube-webhook-certgen for admissionWebhooks. You can also use cert-manager if it’s available. Note that you need to install cert-manager before the KubeVela chart.

  1. helm repo add jetstack https://charts.jetstack.io
  2. helm repo update
  3. helm install cert-manager jetstack/cert-manager --namespace cert-manager --version v1.2.0 --create-namespace --set installCRDs=true

Install kubevela with enabled certmanager:

  1. vela install --set admissionWebhooks.certManager.enabled=true

Install Pre-release

  1. # List all releases
  2. vela version list -a
  3. # Install the specified version.
  4. vela install --version 1.4.0-beta.2

Install Kubectl Vela Plugin

kubectl-vela provides the same features with vela CLI, it helps you to integrate with kubectl better.

  • Krew
  • Script
  1. Install and set up Krew on your machine.
  2. Discover plugins available on Krew:
  1. kubectl krew update
  1. install kubectl vela:
  1. kubectl krew install vela

macOS/Linux

  1. curl -fsSl https://kubevela.io/script/install-kubectl-vela.sh | bash

You can also download the binary from release pages ( >= v1.0.3) manually. Kubectl will discover it from your system path automatically.