-
Notifications
You must be signed in to change notification settings - Fork 5
Run and debug backend Flask applications
In order to debug your application locally you can run __main__.py
to run as a plain flask application.
Depending on what your application uses of the infrastructure you may need to define some environmental variables and files.
The main file that the cloudharness applications will look for is /opt/cloudharness/resources/allvalues.yaml
.
This value is a copy of values.yaml that is generated by harness-deployment as deployment/helm/values.yaml
.
Can copy/link that file to /opt/cloudharness/resources/allvalues.yaml
or set the environmental variable CH_VALUES_PATH to use a different path.
Remote debug can be achieved through Skaffold by using the Cloud Code extension for Visual studio code. All required configurations for Skaffold and VS code are generated by the harness-deployment command.
- Setup kubectl to use your remote cluster or minikube*. Set the default namespace to be the same namespace you are making the deployment (the same specified on running harness-deployment)
- Install Skaffold: see https://skaffold.dev/docs/install/
- Install Cloud Code extension on VS Code: https://cloud.google.com/code/docs/vscode/quickstart-local-dev#installing
- Launch the "CloudHarness: run/debug configuration"
Skaffold configuration is generated by harness-deployment
.
Can build and deploy with Skaffold with:
skaffold dev --namespace=[NAMESPACE]
(local minikube)
skaffold dev --namespace=osb2 --default-repo=[DOCKER_REGISTRY]
(external cluster or forwarded minikube)