Version: v1.1

Installation

For upgrading existing KubeVela, please read the upgrade guide.

1. Choose Control Plane Cluster

Requirements:

  • Kubernetes cluster >= v1.18.0
  • kubectl installed and configured

KubeVela relies on Kubernetes as control plane. The control plane could be any managed Kubernetes offering or your own cluster.

For local deployment and test, you could use kind or minikube. For production usage, you could use Kubernetes services provided by cloud providers.

  • Kind
  • RKE
  • Minikube
  • Cloud Provider

Follow the minikube installation guide.

Then spins up a minikube cluster

  1. minikube start

Install ingress to enable service route

  1. minikube addons enable ingress

(1)Install docker:

The rke depend on docker, Follow the docker installation guide.

(2)Install rke:

Download rke binary from rke release page.

If you have limited Internet access:

  1. wget https://static.kubevela.net/binary/rke/rke_linux-amd64 -O /usr/bin/rke
  2. chmod +x /usr/bin/rke

(3)Install kubernetes cluster:

  1. mkdir ~/rkeinit && cd ~/rkeinit
  2. # Wizard-style configuration
  3. rke config
  4. # Kubernetes Cluster Installation
  5. rke up
  6. # Install kubectl Command
  7. mkdir ~/.kube
  8. cp kube_config_cluster.yml ~/.kube/config
  9. docker cp kubelet:/usr/local/bin/kubectl /usr/local/bin/kubectl

Follow this guide to install kind.

Then spins up a kind cluster:

  1. cat <<EOF | kind create cluster --image=kindest/node:v1.18.15 --config=-
  2. kind: Cluster
  3. apiVersion: kind.x-k8s.io/v1alpha4
  4. nodes:
  5. - role: control-plane
  6. kubeadmConfigPatches:
  7. - |
  8. kind: InitConfiguration
  9. nodeRegistration:
  10. kubeletExtraArgs:
  11. node-labels: "ingress-ready=true"
  12. extraPortMappings:
  13. - containerPort: 80
  14. hostPort: 80
  15. protocol: TCP
  16. - containerPort: 443
  17. hostPort: 443
  18. protocol: TCP
  19. EOF

Install ingress to enable service route

  1. kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml

Please ensure ingress-nginx is installed and enabled.

2. Install KubeVela

Before install, you have to make sure the helm is available. Follow this guide to install helm.

If you have limited Internet access

  1. wget https://static.kubevela.net/binary/helm/helm-v3.7.0-linux-amd64 -O /usr/bin/helm
  2. chmod +x /usr/bin/helm
  1. Add and update helm chart repo for KubeVela

    1. helm repo add kubevela https://charts.kubevela.net/core
    2. helm repo update
  2. Install KubeVela

    1. helm install --create-namespace -n vela-system kubevela kubevela/vela-core --set multicluster.enabled=true --wait

    You can refer to advanced installation guide for more custom ways.

  3. Verify chart installed successfully

    1. helm test kubevela -n vela-system

    Click to see the expected output of helm test

    1. Pod kubevela-application-test pending
    2. Pod kubevela-application-test pending
    3. Pod kubevela-application-test running
    4. Pod kubevela-application-test succeeded
    5. NAME: kubevela
    6. LAST DEPLOYED: Tue Apr 13 18:42:20 2021
    7. NAMESPACE: vela-system
    8. STATUS: deployed
    9. REVISION: 1
    10. TEST SUITE: kubevela-application-test
    11. Last Started: Fri Apr 16 20:49:10 2021
    12. Last Completed: Fri Apr 16 20:50:04 2021
    13. Phase: Succeeded
    14. TEST SUITE: first-vela-app
    15. Last Started: Fri Apr 16 20:49:10 2021
    16. Last Completed: Fri Apr 16 20:49:10 2021
    17. Phase: Succeeded
    18. NOTES:
    19. Welcome to use the KubeVela! Enjoy your shipping application journey!

3. [Optional] Get KubeVela CLI

KubeVela CLI gives you a simplified workflow to manage applications with optimized output. It is not mandatory though.

KubeVela CLI could be installed as kubectl plugin, or install as standalone binary.

  • Script
  • Homebrew
  • Download directly from releases

macOS/Linux

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

Windows

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

macOS/Linux

Update your brew firstly.

  1. brew update

Then install kubevela client.

  1. brew install kubevela
  • Download the latest vela binary from the releases page.
  • Unpack the vela binary and add it to $PATH to get started.
  1. sudo mv ./vela /usr/local/bin/vela

Known Issue(https://github.com/oam-dev/kubevela/issues/625): If you’re using mac, it will report that “vela” cannot be opened because the developer cannot be verified.

The new version of MacOS is stricter about running software you’ve downloaded that isn’t signed with an Apple developer key. And we haven’t supported that for KubeVela yet.
You can open your ‘System Preference’ -> ‘Security & Privacy’ -> General, click the ‘Allow Anyway’ to temporarily fix it.

4. [Optional] Enable Addons

KubeVela support a dozen of out-of-box addons, please at least enable following addons to make sure KubeVela functioning well:

  • Helm and Kustomize Components addons

    1. vela addon enable fluxcd
  • Terraform addon

    1. vela addon enable terraform
  • Terraform Provider addon

    Enable Terraform Alibaba Cloud Provider as below to provision and/or consume cloud resources.

    Here is how to get access key. Set the value for ALICLOUD_REGION by picking one RegionId from Alibaba Cloud region list. You can also set the value for parameter ALICLOUD_SECURITY_TOKEN, which is optional, per this doc.

    1. vela addon enable terraform/provider-alibaba ALICLOUD_ACCESS_KEY=<xxx> ALICLOUD_SECRET_KEY=<yyy> ALICLOUD_REGION=<region>

5. Verify

You can also using kubectl get comp -A and kubectl get trait -A instead if you haven’t installed CLI.

  • Get built-in component types by vela CLI:

    1. vela components

    Outputs

    1. NAME NAMESPACE WORKLOAD DESCRIPTION
    2. alibaba-ack vela-system configurations.terraform.core.oam.dev Terraform configuration for Alibaba Cloud ACK cluster
    3. alibaba-oss vela-system configurations.terraform.core.oam.dev Terraform configuration for Alibaba Cloud OSS object
    4. alibaba-rds vela-system configurations.terraform.core.oam.dev Terraform configuration for Alibaba Cloud RDS object
    5. helm vela-system autodetects.core.oam.dev helm release is a group of K8s resources from either git
    6. repository or helm repo
    7. kustomize vela-system autodetects.core.oam.dev kustomize can fetching, building, updating and applying
    8. Kustomize manifests from git repo.
    9. raw vela-system autodetects.core.oam.dev raw allow users to specify raw K8s object in properties
    10. task vela-system jobs.batch Describes jobs that run code or a script to completion.
    11. webservice vela-system deployments.apps Describes long-running, scalable, containerized services
    12. that have a stable network endpoint to receive external
    13. network traffic from customers.
    14. worker vela-system deployments.apps Describes long-running, scalable, containerized services
    15. that running at backend. They do NOT have network endpoint
    16. to receive external network traffic.
  • Get built-in traits by vela CLI:

    1. vela traits

    Outputs

    1. NAME NAMESPACE APPLIES-TO CONFLICTS-WITH POD-DISRUPTIVE DESCRIPTION
    2. annotations vela-system * true Add annotations on K8s pod for your workload which follows
    3. the pod spec in path 'spec.template'.
    4. configmap vela-system * true Create/Attach configmaps on K8s pod for your workload which
    5. follows the pod spec in path 'spec.template'.
    6. cpuscaler vela-system deployments.apps false Automatically scale the component based on CPU usage.
    7. env vela-system * false add env on K8s pod for your workload which follows the pod
    8. spec in path 'spec.template.'
    9. expose vela-system false Expose port to enable web traffic for your component.
    10. hostalias vela-system * false Add host aliases on K8s pod for your workload which follows
    11. the pod spec in path 'spec.template'.
    12. ingress vela-system false Enable public web traffic for the component.
    13. ingress-1-20 vela-system false Enable public web traffic for the component, the ingress API
    14. matches K8s v1.20+.
    15. init-container vela-system deployments.apps true add an init container and use shared volume with pod
    16. kustomize-json-patch vela-system false A list of JSON6902 patch to selected target
    17. kustomize-patch vela-system false A list of StrategicMerge or JSON6902 patch to selected
    18. target
    19. kustomize-strategy-merge vela-system false A list of strategic merge to kustomize config
    20. labels vela-system * true Add labels on K8s pod for your workload which follows the
    21. pod spec in path 'spec.template'.
    22. lifecycle vela-system * true Add lifecycle hooks for the first container of K8s pod for
    23. your workload which follows the pod spec in path
    24. 'spec.template'.
    25. node-affinity vela-system * true affinity specify node affinity and toleration on K8s pod for
    26. your workload which follows the pod spec in path
    27. 'spec.template'.
    28. pvc vela-system deployments.apps true Create a Persistent Volume Claim and mount the PVC as volume
    29. to the first container in the pod
    30. resource vela-system * true Add resource requests and limits on K8s pod for your
    31. workload which follows the pod spec in path 'spec.template.'
    32. rollout vela-system false rollout the component
    33. scaler vela-system * false Manually scale K8s pod for your workload which follows the
    34. pod spec in path 'spec.template'.
    35. service-binding vela-system webservice,worker false Binding secrets of cloud resources to component env
    36. sidecar vela-system * true Inject a sidecar container to K8s pod for your workload
    37. which follows the pod spec in path 'spec.template'.
    38. volumes vela-system deployments.apps true Add volumes on K8s pod for your workload which follows the
    39. pod spec in path 'spec.template'.

These capabilities are built-in so they are ready to use if showed up. KubeVela is designed to be programmable and fully self-service, so the assumption is more capabilities will be added later per your own needs.

What’s Next