Debug in the environment

    When you deploy your application in a test environment and find problems with the application, you may want to debug the application in the environment. KubeVela provides the command to help you debug your application in the environment.

    If your application uses workflow, make sure your app has the debug policy before using the vela debug command:

    You can also use vela up -f <application yaml> --debug to automatically add debug policy to your application.

    You can also use vela debug <application-name> -s <step-name> -f <variable> to view the contents of specified variables in a single step.

    Debug in the environment - 图2

    Applications with components only

    Deploy the following application. The first component will use k8s-objects to create a Namespace, and the second component will use the webservice with gateway trait to create a Deployment and its corresponding Service and Ingress.

    1. apiVersion: core.oam.dev/v1beta1
    2. metadata:
    3. name: gateway-app
    4. spec:
    5. components:
    6. type: k8s-objects
    7. properties:
    8. objects:
    9. - apiVersion: v1
    10. kind: Namespace
    11. metadata:
    12. name: test-ns1
    13. properties:
    14. image: oamdev/hello-world
    15. ports:
    16. - port: 8000
    17. traits:
    18. - type: gateway
    19. properties:
    20. domain: testsvc.example.com
    21. "/": 8000

    After the application is deployed, you can use the vela debug <application-name> command to view all the resources rendered by the application.

    Debug in the environment - 图4