1
Introduction to KubeVela is a technical implementation of the OAM (Open Application Model) standard jointly initiated by Alibaba Cloud and Microsoft. It aims to create a unified, standard, and cross-environmental cloud application delivery, saving time, effort, and simplicity.

Author|KubeVela Community

封面图.jpg

Author|KubeVela Community

This article is suitable for all software engineers to read and use, especially front-end, mobile and full-stack engineers who want to open up their back-end technology horizons.

Preface

Today, when software development is becoming more and more agile, the back-end technical architecture has also been constantly evolving to adapt to changes in demand.

From the initial physical machine era, the budding virtual machine era of cloud computing, to the explosive container era, all of this we have been moving in a certain direction, namely: making application delivery better, faster and stronger . Currently in the container era, we have to face these troubles while welcoming the rich capabilities brought by the wave of cloud-native technologies such as Kubernetes:

  • Kubernetes' steep learning curve and a dazzling bunch of concepts make it difficult for application developers to achieve satisfactory development efficiency.
  • The platform team for service application development does not have a suitable framework to build a user-friendly and highly extensible abstraction.
  • Especially in the increasingly complex business scenarios of hybrid cloud, multi-cloud, and distributed cloud in the future, application delivery will become fragmented.

KubeVela is a technical implementation of the OAM (Open Application Model) standard jointly initiated by Alibaba Cloud and Microsoft. It aims to create a unified, standard, and cross-environmental cloud application delivery, which saves time and effort, and is easy and simple:

  • Application-centric-KubeVela introduces the Open Application Model (OAM) as a higher-level API to capture all the information delivered by microservices for hybrid environments through a highly consistent workflow. Operation and maintenance features including multi-cluster distribution strategies, traffic allocation, and rolling updates are all declared at the application level. Users do not need to care about any infrastructure details, only need to define and deploy applications.
  • Programmable delivery workflow-KubeVela's model layer is implemented using CUE. It allows you to easily declare the application delivery workflow as a DAG, and glue all the steps and application deployment requirements together in a programmable way. There are no restrictions here, natively scalable.
  • Runtime independent-KubeVela is a completely runtime independent application delivery and management control plane. It can deliver and manage any application component for a hybrid environment according to your defined workflow and strategy: including containers, cloud functions, databases, and even AWS EC2 instances.

Come with me now and walk into KubeVela to find out!

Concepts that can be familiar first

Docker : a commonly used container.

Image : container image. The core component of Docker is simply understood as a copyable installation CD.

DockerHub : A container image public download center maintained by Docker.

Kubernetes : Container orchestration standard, the job is to manage and schedule containers in a unified manner.

YAML : A configuration file format.

Not much to say, let's happily type the code and learn!

Try KubeVela environment setup

This time, we will introduce the use of Kind (Kubernetes in Docker) to build a local Kubernetes environment. As the name suggests, Kubernetes is in Docker, so before continuing to read, please make sure to install Docker (\_ https://docs.docker.com/desktop/\_ ) and the Kubernetes command line tool kubectl (\_ https://kubernetes.io/zh/docs/tasks/tools/\_ ).

Install Kind, if it is a MacOS system, type in the command line:

curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-darwin-amd64chmod +x ./kindmv ./kind /some-dir-in-your-PATH/kind

If it is Windows, use:

curl.exe -Lo kind-windows-amd64.exe https://kind.sigs.k8s.io/dl/v0.11.1/kind-windows-amd64Move-Item .\kind-windows-amd64.exe c:\some-dir-in-your-PATH\kind.exe

After installing Kind, start Kind and run the following command:


cat <<EOF | kind create cluster --image=kindest/node:v1.18.15 --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  kubeadmConfigPatches:
  - |
    kind: InitConfiguration
    nodeRegistration:
      kubeletExtraArgs:
        node-labels: "ingress-ready=true"
  extraPortMappings:
  - containerPort: 80
    hostPort: 80
    protocol: TCP
  - containerPort: 443
    hostPort: 443
    protocol: TCP
EOF

At the same time we need to install Ingress for Kind. If Kubernetes is compared to the general manager of a "container hotel", Ingress is similar to the hotel's greeter, responsible for guiding the "visiting guests" to the next specific step, whether to go to the restaurant, to the guest room, or to go Fitness and more:

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

When all the above are in place, it means that we have a complete Kubernetes environment locally.

Next, let's install KubeVela. First, please install Helm Chart, which is a package management tool for the Kubernetes ecosystem. Run:

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

Then add KubeVela to Helm Chat:

helm repo add kubevela https://charts.kubevela.net/core

Then update the Helm Chart:

helm repo update

Finally install KubeVela:

helm install --create-namespace -n vela-system kubevela kubevela/vela-core

Let's check whether the installation is successful:

helm test kubevela -n vela-system

Prompt after success: Welcome to use the KubeVela! Enjoy your shipping application journey!

Okay, let's start writing the first KubeVela Demo!

KubeVela,Hello World!

In the environment configuration in the previous section, we started a Kind cluster, and you can view the relevant container information in the Docker GUI:

1.png

According to the abstract method of KubeVela, we define a Web Service, which will pull the image named "crccheck/hello-world" on DockerHub.

apiVersion: core.oam.dev/v1beta1kind: Applicationmetadata:  name: first-vela-appspec:  components:    - name: express-server      type: webservice      properties:        image: crccheck/hello-world        port: 8000      traits:        - type: ingress          properties:            domain: testsvc.example.com            http:              "/": 8000

Then use Kubernetes' kubectl apply command to deploy this YMAL:

kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/docs/examples/vela-app.yaml

Since Ingress for Kind will bind the webservice you declared in YAML to localhost by default, so if you want to access the deployed application, you only need to type in the command line:​

curl -H "Host:testsvc.example.com" localhost

Viola! The most affectionate words appeared for us: Hello World!

<xmp>Hello World

                                       ##         .                           
                                       ## ## ##        ==     
                                       ## ## ## ## ##    ===      
                                       /""""""""""""""""\___/ ===             
    ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~                           \______ o 
        _,/                            \      \       _,'                       
        
        `'--.._\..--''</xmp>
      
     

Summary and preview

The above takes us to a complete experience of the application delivery process brought by KubeVela, which is as simple and straightforward as "it only takes three steps to put an elephant in the refrigerator".

By writing an "application delivery plan" YAML file called Application, we get a Web Service type Kubernetes component to be delivered.

What is the mechanism behind the Web Service component? How does KubeVela deliver Helm components? How to deliver cloud service components? How to orchestrate these components?

These are left to the next issue. We will come back to explain in detail the core concepts of KubeVela: Application and Components (component system).

If you want to better understand the KubeVela project, you are welcome to search Dingding group number 23310022 or directly Dingding scan code to join the community exchange group:


二维码.png

Copyright Statement: content of this article is contributed spontaneously by Alibaba Cloud real-name registered users, and the copyright belongs to the original author. The Alibaba Cloud Developer Community does not own its copyright, and does not assume corresponding legal responsibilities. For specific rules, please refer to the "Alibaba Cloud Developer Community User Service Agreement" and the "Alibaba Cloud Developer Community Intellectual Property Protection Guidelines". If you find suspected plagiarism in this community, fill in the infringement complaint form to report it. Once verified, the community will immediately delete the suspected infringing content.

阿里云开发者
3.2k 声望6.3k 粉丝

阿里巴巴官方技术号,关于阿里巴巴经济体的技术创新、实战经验、技术人的成长心得均呈现于此。