Deploy First Application

    Welcome to KubeVela! In this guide, we’ll walk you through how to install KubeVela, and deploy your first simple application.

    Make sure you have finished and verified KubeVela installation following this guide.

    A Simple Application

    A simple deployment definition in KubeVela looks as below:

    Now deploy it to KubeVela:

    This command will deploy a web service component to target environment, which in our case is the Kubernetes cluster that KubeVela itself is installed.

    After deployed, you can now directly visit this application as it already attached with a ingress trait (assume your cluster has Ingress enabled).

    You can also try:

    1. apiVersion: core.oam.dev/v1beta1
    2. kind: Application
    3. metadata:
    4. name: app-delivering-chart
    5. spec:
    6. components:
    7. - name: redis-comp
    8. type: helm
    9. properties:
    10. chart: redis-cluster
    11. version: 6.2.7
    12. url: https://charts.bitnami.com/bitnami
    13. repoType: helm
    1. apiVersion: core.oam.dev/v1beta1
    2. kind: Application
    3. metadata:
    4. name: git-app
    5. spec:
    6. components:
    7. - name: git-comp
    8. type: kustomize
    9. properties:
    10. repoType: git
    11. url: https://github.com/<path>/<to>/<repo>
    12. git:
    13. branch: master
    14. path: ./app/dev/

    … and many many more. Please check the Deploying Components section under User Manuals for all supported types, and even go ahead to add your own.

    Attach Operational Behaviors

    KubeVela is not just about deploy. It allows you to attach predefined operational behaviors (named Traits) to your components in-place. For example, let’s assign a batch rollout strategy to our web service:

    Now whenever the image version is updated in above YAML file, the express-server component will rollout following strategy defined in rolloutBatches.

    For all supported traits in KubeVela, please check Attaching Traits section under User Manuals. Not surprisingly, you can also add your own traits to KubeVela with just minimal effort.

    Components and traits are just the beginning of your vela sail. KubeVela is by design a full functional Continuous Delivery (CD) platform with fine grained support for hybrid/multi-cloud/multi-cluster deployment.

    I want to deploy an micro-services application with two components, firstly to staging cluster with only 1 instance, then pause and wait for manual approval. If approved, then deploy it to production cluster but with instances scaled to 3.

    Oops, imagine how many add-hoc scripts and glue code are needed in your CI/CD pipeline to achieve automation and deployment success rate in above process.

    While with KubeVela, above process can be easily modeled as a declarative deployment plan as below:

    1. apiVersion: core.oam.dev/v1beta1
    2. name: example-app
    3. namespace: default
    4. spec:
    5. components:
    6. - name: hello-world-server
    7. type: webservice
    8. properties:
    9. image: crccheck/hello-world
    10. port: 8000
    11. traits:
    12. - type: scaler
    13. properties:
    14. replicas: 1
    15. - name: data-worker
    16. type: worker
    17. properties:
    18. image: busybox
    19. cmd:
    20. - sleep
    21. - '1000000'
    22. policies:
    23. - name: example-multi-env-policy
    24. type: env-binding
    25. properties:
    26. envs:
    27. - name: staging
    28. placement: # selecting the cluster to deploy to
    29. clusterSelector:
    30. name: cluster-staging
    31. selector: # selecting which component to use
    32. components:
    33. - hello-world-server
    34. - name: prod
    35. placement:
    36. clusterSelector:
    37. components:
    38. - name: hello-world-server
    39. type: webservice
    40. traits:
    41. - type: scaler
    42. properties:
    43. replicas: 3
    44. - name: health-policy-demo
    45. type: health
    46. properties:
    47. probeInterval: 5
    48. probeTimeout: 10
    49. workflow:
    50. steps:
    51. # deploy to staging env
    52. - name: deploy-staging
    53. type: deploy2env
    54. properties:
    55. policy: example-multi-env-policy
    56. env: staging
    57. # manual check
    58. - name: manual-approval
    59. type: suspend
    60. # deploy to prod env
    61. - name: deploy-prod
    62. type: deploy2env
    63. properties:
    64. policy: example-multi-env-policy
    65. env: prod

    No more add-hoc scripts or glue code, KubeVela will get the application delivery workflow done with full automation and determinism. Most importantly, KubeVela expects you keep using the CI solutions you are already familiar with and KubeVela is fully complementary to them as the CD control plane.

    For using KubeVela with your own CI pipelines and other tools, please check Best Practices section in the sidebar for more real world examples.

    What’s Next

    All above features are just the first glance of KubeVela. For next steps, we recommend: