Introduction: KubeVela is the technical implementation of the OAM (Open Application Model) standard jointly initiated by Ali Cloud and Microsoft, aiming to create a unified, standard, cross-environment cloud Application delivery, saving time and effort, easy and simple
Author | KubeVela Community
This article is suitable for all software engineers, especially front-end, mobile, and full-stack engineers who want to expand their vision of back-end technology.
preface
As software development becomes more agile, the backend technology architecture is constantly evolving to meet changing requirements. From the physical machine era, to the virtual machine era of cloud computing, to the container era of explosion, we were all moving in a certain direction: making application delivery better, faster, and stronger. We in the container era, while embracing the rich capabilities of cloud native technologies such as Kubernetes, have to face these worries:
- Kubernetes’ steep learning curve and dizzying array of concepts make it hard for application developers to be productive.
- The platform team for service application development, however, does not have a framework in place to build user-friendly and highly extensible abstractions.
- Especially in the future of hybrid cloud, multi-cloud, distributed cloud increasingly complex business scenarios, application delivery is becoming more fragmented.
KubeVela is the technical implementation of the OAM (Open Application Model) standard jointly initiated by Ali Cloud and Microsoft, aiming to create a unified, standard, cross-environment cloud Application delivery, saving time and effort, easy and simple:
- Application-centric – KubeVela introduces the Open Application Model (OAM) as a higher-level API to capture all information about microservice delivery for a mixed environment through a highly consistent workflow. O&m features, including the multi-cluster distribution policy, traffic allocation, and rolling update, are declared at the application level. Users need not care about any infrastructure details, just defining and deploying 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 together all the steps and application deployment requirements programmatically. There are no restrictions, native scalability.
- 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, including containers, cloud functions, databases, and even AWS EC2 instances, according to the workflows and policies you define.
Now come with me and take a look inside KubeVela!
You can get familiar with the concept
Docker: a common container.
Image: Image of a container. The core composition of Docker, simply understood as a copy of the installation CD.
DockerHub: a container image public download center maintained by Docker.
Kubernetes: Container choreography standard, the job is to unify the management of scheduling containers.
YAML: A configuration file format.
Without further ado, let’s have fun coding!
Play the KubeVela environment builder
This time, we will introduce the use of Kind (Kubernetes in Docker) to build a local Kubernetes environment. As the name implies, Kubernetes in Docker, so make sure you install Docker (_docs.docker.com/desktop/\_) before you go any further. Kubernetes command-line tools kubectl (_kubernetes. IO/useful/docs/tas…
To install Kind, type on the command line for MacOS:
The curl - Lo. / kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-darwin-amd64chmod + x. / kindmv. / kind /some-dir-in-your-PATH/kindCopy the code
For Windows, use:
Curl the. 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.exeCopy the code
After Kind is installed, start Kind and run the following command:
Cat < < EOF | kind the 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 EOFCopy the code
Also we need to install Ingress for Kind. If Kubernetes is likened to the general manager of a container hotel, Ingress is akin to the hotel’s greeter, responsible for directing visiting guests to the restaurant, guest room, gym, etc. :
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
Copy the code
When all of this is in place, it means we have a complete Kubernetes environment locally. Next, let’s install KubeVela. First please install Helm Chart, which is a package management tool for Kubernetes ecosystem. It runs:
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
Copy the code
Then add KubeVela to Helm Chat:
helm repo add kubevela https://charts.kubevela.net/core
Copy the code
Next update Helm Chart:
helm repo update
Copy the code
Finally install KubeVela:
helm install --create-namespace -n vela-system kubevela kubevela/vela-core
Copy the code
Let’s check if the installation is successful:
helm test kubevela -n vela-system
Copy the code
Welcome to use the KubeVela! Enjoy your shipping application journey!
Ok, so start writing your first KubeVela Demo!
KubeVela, Hello World!
In the environment configuration in the previous section, we started a Kind cluster, and the container information can be viewed in the Docker GUI:
In the way KubeVela abstracts, we define a Web Service that pulls a DockerHub image named “crccheck/hello-world”.
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
Copy the code
Then use Kubernetes kubectl apply to deploy the YMAL:
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/docs/examples/vela-app.yaml
Copy the code
Because Ingress for Kind binds the webService you declared in YAML to localhost by default, if you want to access the deployed application, just type:
curl -H "Host:testsvc.example.com" localhost
Copy the code
Viola! Then came the word that makes us most affectionate: Hello World!
<xmp>Hello World ## . ## ## ## == ## ## ## ## ## === /""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ \______ o _,/ \ \ _,' `'--.. _ \.. --''</xmp>Copy the code
Summary and notice
We walked through the entire KubeVela application delivery process, which is as straightforward as putting an elephant in the fridge in three steps.
By writing an “Application delivery Plan” YAML file called Application, we get delivered a Kubernetes component of the Web Service type.
What is the mechanism behind Web Service components? How does KubeVela deliver Helm components? How do you deliver cloud service components? How do you orchestrate these components?
I’ll leave that for the next installment when we come back to the core concepts of KubeVela: Application and Components.
The original link
This article is the original content of Aliyun and shall not be reproduced without permission.