Deploy First Application

    Before starting, please confirm that you’ve installed KubeVela and enabled the VelaUX addon according to the installation guide.

    Welcome to KubeVela! This section will guide you to deliver your first app.

    Below is a classic KubeVela application which contains one component with one operational trait, basically, it means to deploy a container image as webservice with one replica. Additionally, there are three policies and workflow steps, it means to deploy the application into two different environments with different configurations.

    • Create an environment for your first app.
    1. vela env init prod --namespace prod

    expected output

    1. environment prod with namespace prod created
    • Starting deploy the application
    1. vela up -f https://kubevela.net/example/applications/first-app.yaml

    expected output

    1. Applying an application in vela K8s object format...
    2. I0516 15:45:18.123356 27156 apply.go:107] "creating object" name="first-vela-app" resource="core.oam.dev/v1beta1, Kind=Application"
    3. App has been deployed 🚀🚀🚀
    4. Port forward: vela port-forward first-vela-app
    5. SSH: vela exec first-vela-app
    6. Logging: vela logs first-vela-app
    7. App status: vela status first-vela-app
    8. Endpoint: vela status first-vela-app --endpoint
    9. Application prod/first-vela-app applied.
    • View the process and status of the application deploy

    expected output

    1. About:
    2. Name: first-vela-app
    3. Namespace: prod
    4. Created at: 2022-05-16 15:45:18 +0800 CST
    5. Status: workflowSuspending
    6. Workflow:
    7. ...
    8. Services:
    9. - Name: express-server
    10. Cluster: local Namespace: default
    11. Type: webservice
    12. Healthy Ready:1/1
    13. Traits:
    14. scaler

    The application will become a workflowSuspending status, it means the workflow has finished the first two steps and waiting for manual approval as the step specified.

    • Access the application

    We can check the application by:

    1. vela port-forward first-vela-app 8000:8000

    expected output

    1. <xmp>
    2. Hello KubeVela! Make shipping applications more enjoyable.
    3. ...snip...
    • Resume the workflow

    After we finished checking the application, we can approve the workflow to continue:

    1. vela workflow resume first-vela-app

    expected output

    Then the rest will be delivered in the prod namespace:

    1. vela status first-vela-app

    expected output

    1. About:
    2. Name: first-vela-app
    3. Namespace: prod
    4. Created at: 2022-05-16 15:45:18 +0800 CST
    5. Workflow:
    6. ...snipt...
    7. Services:
    8. - Name: express-server
    9. Cluster: local Namespace: prod
    10. Type: webservice
    11. Healthy Ready:2/2
    12. Traits:
    13. scaler
    14. - Name: express-server
    15. Cluster: local Namespace: default
    16. Type: webservice
    17. Healthy Ready:1/1
    18. Traits:
    19. scaler

    Great! You have finished deploying your first KubeVela application, you can also view and manage it in UI.

    After finished , you can view and manage the application created.

    • Port forward the UI if you don’t have endpoint for access:

      1. vela port-forward addon-velaux -n vela-system 8080:80

    It requires you to override with a new password for the first login, please make sure to remember the new password.

    • Check the resources deployed

    Click the application card, then you can view the details of the application.

    The UI console shares a different metadata layer with the controller. It’s more like a PaaS architecture of a company which choose a database as the source of truth instead of relying on the etcd of Kubernetes.

    By default, if you’re using CLI to manage the applications directly from Kubernetes API, we will sync the metadata to UI backend automatically. Once you deployed the application from the UI console, the automatic sync process will be stopped as the source of truth may be changed.

    If there’re any changes happen from CLI after that, the UI console will detect the difference and show it for you. However, it’s not recommended to modify the application properties from both sides.

    In conclusion, if you’re a CLI/YAML/GitOps user, you’d better just use CLI to manage the application CRD and just use the UI console (velaux) as a dashboard. Once you’ve managed the app from the UI console, you need to align the behavior and manage apps from UI, API, or Webhook provided by velaux.

    expected output

    • View Core Concepts to learn more about how it works.
    • View to look on more of what you can achieve with KubeVela.