kubevela.github.io/docs/install.mdx

157 lines
6.4 KiB
Plaintext

---
title: Installation
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
- For Installation from existing Kubernetes Cluster, please read the [advanced installation guide](./platform-engineers/advanced-install#install-kubevela-with-existing-kubernetes-cluster).
- For upgrading from existing KubeVela control plane, please read the [upgrade guide](./platform-engineers/advanced-install#upgrade).
## 1. Install VelaD
[VelaD](https://github.com/kubevela/velad) packages KubeVela with all dependencies that enables you to run KubeVela on any of docker compatible environments or linux system.
- VelaD provides Kubernetes by leveraging [K3s](https://rancher.com/docs/k3s/latest/en/quick-start/) on linux or [k3d](https://k3d.io/) on docker environment.
- KubeVela along with all related images, and `vela` command line are packaged together that enables air-gapped installation.
- **VelaD suits great for local development and quick demos, while we strongly recommend you to [install KubeVela with managed Kubernetes services](./platform-engineers/advanced-install#install-kubevela-with-existing-kubernetes-cluster) for production usage**.
### Prerequisites
- Docker v20.10.5+ (runc >= v1.0.0-rc93) **or** Linux system
### Download VelaD
It will download and place the binary in your system `PATH`,
so you may be required for root privilege during the installation process.
If you don't need the automation with root access, you can download from the [release page](https://github.com/kubevela/velad/releases) and uncompress manually.
- ** MacOS/Linux **
```shell
curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash
```
- **Windows**
> Only the official release version is supported.
Run following command in powershell:
```shell
powershell -Command "iwr -useb https://static.kubevela.net/script/install-velad.ps1 | iex"
```
Check `velad` and `vela` command line tools are exist in `/usr/local/bin/` for MacOS/Linux or `C:\vela\` for Windows.
### Setup
```shell
velad install
```
The expected output:
<details>
```
Preparing K3s images...
Successfully prepare k3s image: /Users/sunjianbo/.vela/velad/k3s/k3s-airgap-images-amd64.tgz
Successfully prepare k3d images
...snip...
KubeVela control plane has been successfully set up on your cluster.
If you want to enable dashboard, please run "vela addon enable /Users/sunjianbo/.vela/addons/velaux"
Keep the token below if you want to restart the control plane
K1075e7f6c77555e6ebdaf4854e4a2f39ae4287cfad23f27cdac5b33608d44633fe::server:zSpzbdbGzVxOwfBvvjgT
🚀 Successfully install KubeVela control plane
🔭 See available commands with `vela help`
```
</details>
**Export the Kubernetes config **
```
export KUBECONFIG=$(velad kubeconfig --host)
vela comp
```
The expected output:
<details>
```
NAME DEFINITION DESCRIPTION
kustomize autodetects.core.oam.dev kustomize can fetching, building, updating and applying
Kustomize manifests from git repo.
helm autodetects.core.oam.dev helm release is a group of K8s resources from either git
repository or helm repo
config-helm-repository autodetects.core.oam.dev Config information to authenticate helm chart repository
yurt-helm autodetects.core.oam.dev helm release is a group of K8s resources from either git
repository or helm repo
daemon daemonsets.apps Describes daemonset services in Kubernetes.
cron-task cronjobs.batch Describes cron jobs that run code or a script to completion.
worker deployments.apps Describes long-running, scalable, containerized services
that running at backend. They do NOT have network endpoint
to receive external network traffic.
task jobs.batch Describes jobs that run code or a script to completion.
webservice deployments.apps Describes long-running, scalable, containerized services
that have a stable network endpoint to receive external
network traffic from customers.
clickhouse autodetects.core.oam.dev Clickhouse Component provision a clickhouse cluster.
config-image-registry autodetects.core.oam.dev Config information to authenticate image registry
k8s-objects autodetects.core.oam.dev K8s-objects allow users to specify raw K8s objects in
properties
raw autodetects.core.oam.dev Raw allow users to specify raw K8s object in properties.
This definition is DEPRECATED, please use 'k8s-objects'
instead.
ref-objects autodetects.core.oam.dev Ref-objects allow users to specify ref objects to use.
Notice that this component type have special handle logic.
```
</details>
## 2. Install VelaUX
> This is optional if you don't use UI console of KubeVela.
VelaUX is a dashboard including UI console and API services.
```shell script
vela addon enable ~/.vela/addons/velaux
```
expected output:
```
Addon: velaux enabled Successfully.
```
By default, velaux didn't have any exposed port, If there is the browser in local, you can view it by:
```
vela port-forward addon-velaux -n vela-system 8080:80
```
Choose `> Cluster: local | Namespace: vela-system | Component: velaux | Kind: Service` for visit.
If you are installing it in a remote environment such as a virtual machine, you can refer to [VelaUX addon](./reference/addons/velaux) document to expose an endpoint or other advanced installation arguments.
VelaUX needs authentication. The default username is `admin` and the password is **`VelaUX12345`**.
It requires you to override with a new password for the first login, please make sure to remember the new password.
## 3. Cleanup
```
velad uninstall
```
This command will clean up KubeVela controllers along with the Kubernetes cluster, refer to [the advanced guide](./platform-engineers/advanced-install#uninstall) for more detailed steps.
## Next Step
- [Deploy your first application](./quick-start).