Code Monkey home page Code Monkey logo

samples's Introduction

KubeVela Samples

These samples demonstrate how to ship applications through KubeVela. Each sample walks you through only a few steps required to ship an application super-quickly by KubeVela.

⚠️ Intended Audiences

KubeVela are designated to serve two typical kinds of users, one is the platform builder, the other is end-user of platform. Platform builders leverage KubeVela to develope PaaS platform (based on Kubernetes), while end-users consume the platform capabilities to ship or manage their applications through KubeVela. To avoid confusion and ambiguity, it's necessary to figure out which role you are playing and which role is the intended audience for the samples or any other documents about KubeVela.

End-users are intended audiences for samples in this repository.

As an end-user, you should know below as prerequisite:

As an end-user, you should NOT worry about:

  • how a capability works under the hood
  • how to define a capability schema
  • how to implement a capability

Above stuff is in the domain of platform builders.

Generic Steps To Ship An Application

No matter how complex the application is or how many operational characteristics the application needs, KubeVela only requires three steps for end-users to ship their applications, as significantly reduces the study cost and on-board difficulty for them.

  • Determine Component Type
  • Choose Traits For Components
  • Assemble Components & Traits In Application

Each step will be explained and demonstrated in the samples.

Supported KubeVela version

KubeVela has released version 1.0 with numbers of powerful features and built-in capabilities. The master branch may include breaking changes, therefore ensure that you're running the samples with the right version of KubeVela. Samples in this repo is been tested with the current latest version (KubeVela-v1.0.3). Please install KubeVela as per the instructions here.

Samples

Sample Description
1. hello-world Demonstrates how to ship a simple python application.
2. ServiceTracker App This is an example microservices application with a Javascript Web UI, a MongoDB database, and a series of API microservices. The idea is that various app developers would create Components for their corresponding apps. The overall config will add traits and allow the app to be fully deployed
3. BikeSharing 360 Multi Container App This is an example microservices application with an ASP.NET Core Webform UI, and a series of API microservices. The idea is that various app developers would create Components for their corresponding apps. The overall config will add traits and allow the app to be fully deployed
4. BikeSharing 360 Single Container App Demonstrates KubeVela implementation of BikeSharing 360 app created in a Single Container. This sample has a single component and a configuration
6. Knative App Demonstrates how KubeVela integrates Knative Configuration/Route to deploy and manage applications.
7. GoogleCloudPlatform MicroServices Demo This is an example application consists of a 10-tier microservices application. The idea is that various app developers would create Workload for their corresponding apps. The overall config will add traits and allow the app to be fully deployed
8. Terraform Demo This is an example application to create an ECS, install Nginx and deploy a website in it
9. GitOps Demo This is an example to use KubeVela in a GitOps way. The example will show you how to update the config in Git repo to trigger automated re-deployment.
10. Nocalhost Demo This is an example to use KubeVela with Nocalhost. The example will show you how to debug in local environment with Nocalhost and KubeVela.
11. Machine Learning Demo This is an example to train and serve model with KubeVela. The example will show you how to use KubeVela AI addon.
12. Multi-Cluster Demo This is an example to KubeVela for managing and deploying application into multi-clusters. It includes the major features from version 1.3.
13. ArgoCD Appfile Demo This is an example to deploy application written in Appfile format using Argo CD.

To get started with the samples, clone this repository and follow instructions in each sample:

git clone https://github.com/oam-dev/samples.git

samples's People

Contributors

artursouza avatar barnettzqg avatar binaryhb0916 avatar captainroy-hy avatar chzbrgr71 avatar dependabot[bot] avatar devholic avatar fogdong avatar hasheddan avatar hongchaodeng avatar jiqh avatar jschluchter avatar microsoftopensource avatar msftgits avatar philliphoff avatar rbitia avatar resouer avatar ryanzhang-oss avatar s4rd1nh4 avatar sgreenmsft avatar somefive avatar sowsan avatar suhuruli avatar vshan avatar wonderflow avatar yangsoon avatar yue9944882 avatar zzxwill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samples's Issues

Sass tenant per namespace demo

Hi team,
I'm really interested in your effort with Kuvela.
I'm curious about applying the Kuvela model for Sass, tenant per K8S namespace.
Could you give me a suggestion? After that, I can contribute my sample project.

migrate all demos to v1alpha2

OAM v1alpha2 has released, some of demos have migrated and some are left.
We should migrate all of them to v1alpha2.

  • Helloworld #40
  • BikeSharing360_MultiContainer_App #41
  • BikeSharing360_SingleContainer_App #42

Hit two issue when ran sample "1.Helloworld"

Ran the sample https://github.com/oam-dev/samples/tree/master/1.Helloworld in Alibaba ACK cluster, I hit two issues.

  1. Health check failed due to services "helloworld" not found.
✗ kubectl get svc
NAME         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
helloworld   ClusterIP   172.16.137.106   <none>        8080/TCP   24m
  1. Domain localhost host could be not visited.
➜  /Users/zhouzhengxi/Programming/golang/src/github.com/oam-dev/samples/1.Helloworld git:(master) ✗ k describe application first-app
Name:         first-app
Namespace:    default
Labels:       <none>
Annotations:  API Version:  core.oam.dev/v1beta1
Kind:         Application
Metadata:
  Creation Timestamp:  2021-05-14T07:53:50Z
  Generation:          2
  Managed Fields:
    API Version:  core.oam.dev/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
      f:spec:
        .:
        f:components:
    Manager:      k
    Operation:    Update
    Time:         2021-05-14T08:12:22Z
    API Version:  core.oam.dev/v1beta1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        .:
        f:components:
        f:conditions:
        f:latestRevision:
          .:
          f:name:
          f:revision:
          f:revisionHash:
        f:rollout:
          .:
          f:batchRollingState:
          f:currentBatch:
          f:lastTargetAppRevision:
          f:rollingState:
          f:upgradedReadyReplicas:
          f:upgradedReplicas:
        f:services:
        f:status:
    Manager:         kubevela
    Operation:       Update
    Time:            2021-05-14T08:13:17Z
  Resource Version:  80411761
  Self Link:         /apis/core.oam.dev/v1beta1/namespaces/default/applications/first-app
  UID:               a3ce4891-6b2b-49c0-890e-388214755003
Spec:
  Components:
    Name:  helloworld
    Properties:
      Env:
        Name:   TARGET
        Value:  KubeVela
      Image:    oamdev/helloworld-python:v1
      Port:     8080
    Traits:
      Properties:
        Domain:  localhost
        Http:
          /:  8080
      Type:   ingress
    Type:     webservice
Status:
  Components:
    API Version:  core.oam.dev/v1alpha2
    Kind:         Component
    Name:         helloworld
    UID:          a3ce4891-6b2b-49c0-890e-388214755003
  Conditions:
    Last Transition Time:  2021-05-14T07:53:50Z
    Reason:                Available
    Status:                True
    Type:                  Parsed
    Last Transition Time:  2021-05-14T07:53:50Z
    Reason:                Available
    Status:                True
    Type:                  Built
    Last Transition Time:  2021-05-14T07:53:51Z
    Reason:                Available
    Status:                True
    Type:                  Applied
    Last Transition Time:  2021-05-14T08:13:17Z
    Reason:                Available
    Status:                True
    Type:                  HealthCheck
  Latest Revision:
    Name:           first-app-v2
    Revision:       2
    Revision Hash:  18c3a8c9b7ba40d5
  Rollout:
    Batch Rolling State:
    Current Batch:             0
    Last Target App Revision:
    Rolling State:
    Upgraded Ready Replicas:   0
    Upgraded Replicas:         0
  Services:
    Healthy:  true
    Name:     helloworld
    Traits:
      Healthy:  true
      Message:  Visiting URL: localhost, IP: 47.243.62.107
      Type:     ingress
    Workload Definition:
      API Version:  apps/v1
      Kind:         Deployment
  Status:           running
Events:
  Type     Reason             Age                From         Message
  ----     ------             ----               ----         -------
  Normal   HealthChecked      39m (x3 over 39m)  Application  Health checked healthy
  Normal   Deployed           39m (x3 over 39m)  Application  Deployed successfully
  Normal   Rendered           21m (x6 over 39m)  Application  Rendered successfully
  Normal   FailedApply        21m (x6 over 39m)  Application  Applied successfully
  Warning  FailedHealthCheck  21m                Application  app=first-app, comp=helloworld, trait=ingress, check health error: get template context: failed to get obj helloworld with gvk /v1, Kind=Service : services "helloworld" not found

Update the 2.ServiceTracker_App to match crosspane doc https://crossplane.io/docs/v0.11/

Current version of the installation needs some update:
a. The wording "Install either the local OAM addon following its instructions or install both Crossplane and remote OAM addon." sounds like a free choice.
It should lay out the scenarios, such as " if you deploy locally use OAM_local".
b. The links in the section "Infrastructure Operator: Install Crossplane" point the 0.9 version not 0.11.
c. The current crossplane provider database secret is called "alibaba-rdspostgresql-conn" under namespace "crossplane-system". The sample still uses "trackerdbconn" under "default".

A end to end sample with OAM, Crossplane, Trait Injector and Serverless workload

Let's do a cool demo and verify some recent ideas.

  1. Use OAM to define a Serverless Component (I choose Serverless so we don't need to define our own abstraction)
  2. Define a database Component for it to consume, provisioned by ROS-OAM (other cloud could be backup)
  3. Use Trait injector to inject credential. It's also a chance to verify Trait injector in this case. If it doesn't work, we need to re-think the design.

knative serving and OpenFaaS are best candidates. I'd suggest we start from knative, scaling could be a nice trait, eventing could be a nice Component, though those are non-goal for stage 1.

Need clean up script

After each demo, it's really hard to clean up. It would be nice to have a cleanup script.

Make ServiceTracker app postgres compatible

In order for the ServiceTracker app to be made portable across different infrastructure currently supported by Crossplane, it needs to be updated to use Postgres as its database instead of MongoDB (or to be able to be deployed with either).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.