Brief introduction:Kubevela is the technical implementation of the OAM (Open Application Model) standard jointly initiated by AliCloud and Microsoft, aiming to create a unified, standard and cross-environment cloud Application delivery, which saves time and effort, and is easy and simple
By | KubeVela community
By | KubeVela community
This article is for all software engineers to read, especially front-end, mobile, and full-stack engineers who want to broaden their horizons on back-end technologies.
preface
In today’s increasingly agile software development, the back-end technology architecture is constantly evolving to meet changing requirements.
From the beginning of the physical machine era, to the emergence of the virtual machine era of cloud computing, to the explosion of the container era, we were all moving in a certain direction: to make application delivery better, faster, and more powerful. At present, we in the container era, while welcoming the rich capabilities brought by the wave of cloud native technology such as Kubernetes, we have to face these troubles:
- Kubernetes’ steep learning curve and a bewildering array of concepts make it hard for application developers to be productive.
- The platform team that serves application development does not have a framework in place to build user-friendly and highly extensible abstractions.
- Especially in the future mixed cloud, multi-cloud, distributed cloud, such as 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 AliCloud and Microsoft, aiming to create a unified, standard and cross-environment cloud Application delivery, which saves time and effort, and is easy and simple:
- Application-centric – Kubevela introduced the Open Application Model (OAM) as a higher-level API to capture all the information delivered by micro-services for mixed environments through a highly consistent workflow. Operation and maintenance features, including multi-cluster distribution policies, traffic deployment, and rolling updates, are declared at the application level. Users don’t need to worry about any infrastructure details, they just 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 programmatic way. There are no restrictions here, native extensibility.
- Runtime independent – Kubevela is a completely run-time independent application delivery and management control plane. It delivers and manages any application component for a mixed environment, including containers, cloud functions, databases, and even AWS EC2 instances, according to your defined workflows and policies.
Now come with me and go inside Kubevela to find out!
You can get familiar with the concept
Docker: A common container.
Image: Container Image. The core component of Docker is simply a copy – able installation disc.
DockerHub: An open download hub for container images maintained by Docker.
Kubernetes: Container orchestration standard. The job is to manage and schedule containers uniformly.
YAML: A configuration file format.
Without further ado, let’s have fun coding and learning!
Try the Kubevela environment setup
This time, we will introduce the use of KIND (Kubernetes in Docker) to build a local Kubernetes environment. Kubernetes in Docker, as the name implies, so before we move on, Please make sure to follow links first installed Docker (\ _https: / / docs.docker.com/desktop/\_) and Kubernetes command line tools Kubectl (\ _https: / / kubernetes. IO/useful/docs/tasks/tools / \ _).
To install Kind, if it is a MacOS system, type:
The curl - Lo. / kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-darwin-amd64chmod + x. / kindmv. / kind /some-dir-in-your-PATH/kind
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.exe
After installing KIND, start KIND by running 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 EOF
Also we need to install Ingress for Kind. If Kubernetes is the general manager of the Container Hotel, Ingress is the hotel’s greeter, directing “visiting guests” to the restaurant, to the guest room, to the gym, etc.
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
When all of this is in place, it means that we have a complete Kubernetes environment locally.
Next, let’s install Kubevela. Start by installing Helm Chart, the package management tool of the Kubernetes ecosystem, which runs:
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
Next update Helm Chart:
helm repo update
Finally install Kubevela:
helm install --create-namespace -n vela-system kubevela kubevela/vela-core
Let’s check to see if the installation was successful:
helm test kubevela -n vela-system
Tips on success: Welcome to use the Kubevela! Enjoy your shipping application journey!
OK, so let’s start writing our first Kubevela Demo!
Kubevela, Hello World!
In the environment configuration section in the previous section, we started a Kind cluster, and you can see the container information in the Docker GUI:
In Kubevela’s abstract way, we define a Web Service that pulls a mirror on DockerHub 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
Then deploy this YMAL using the kubectl apply command from Kubernetes:
kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/docs/examples/vela-app.yaml
Since 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
Viola! Here comes our most intimate words: Hello World!
<xmp>Hello World ## . ## ## ## == ## ## ## ## ## === /""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ \______ o _,/ \ \ _,' `'--.. _ \.. --''</xmp>
Summary and Preview
The above walk through Kubevela’s app delivery process is as simple and straightforward as “putting an elephant in the fridge in three steps”.
By writing an “Application Delivery Plan” YAML file called Application, we have delivered a Kubernetes component of Web Service type.
What is the mechanism behind the Web Service component? How does Kubevela deliver the Helm component? How do you deliver cloud service components? How do you orchestrate these components?
This will be saved for the next installment when we return to the core concepts of Kubevela: Application and Components.
If you want to learn more about the Kubevela project, please search for the key group number 23310022 or direct the key scan code to join the community exchange group:
Copyright Notice:The content of this article is contributed by Aliyun real-name registered users, and the copyright belongs to the original author. Aliyun developer community does not own the copyright and does not bear the corresponding legal liability. For specific rules, please refer to User Service Agreement of Alibaba Cloud Developer Community and Guidance on Intellectual Property Protection of Alibaba Cloud Developer Community. If you find any suspected plagiarism in the community, fill in the infringement complaint form to report, once verified, the community will immediately delete the suspected infringing content.