Skip to content

Latest commit

 

History

History
58 lines (34 loc) · 2.31 KB

File metadata and controls

58 lines (34 loc) · 2.31 KB

Work with a local development environment

Initial setup

  1. Setup a development Kubernetes installation (e.g. Minikube or Docker Desktop). Make sure the kubectl context points there
  2. Follow the general CloudHarness installation steps and deployment setup

In addition to the above instructions is recommended to use the following parameters to generate the deployment to make the development easier:

harness-deployment cloud-harness . -u -dtls -l -e local -d ch.local ...

Certificates

By default, your browser won't access SSL secured applications. You can either ignore the errors (On Chrome use flag --ignore-certificate-errors) or manually trust the certificates located on infrastructure/helm/mnp/certs.

By using the option -dtls all applications will run by default on plain http.

Local backend development

Set up the configuration file

Some backend functionality provided by the Cloudharness runtime library uses the deployment configuration to know about application references and other configuration. If you are running a backend locally, there is a good chance that some calls are looking for a file on /opt/cloudharness/resources/allvalues.yaml as default, as configured in the environment variable CH_VALUES_PATH

That file is the helm chart values.yaml generated by harness-deployment, by default at deployment/helm/values.yaml.

So you have three options:

  • Set CH_VALUES_PATH=deployment/helm/values.yaml on your run environment
  • Link the file (ln -s deployment/helm/values.yaml /opt/cloudharness/resources/allvalues.yaml)
  • Copy the file (cp deployment/helm/values.yaml /opt/cloudharness/resources/allvalues.yaml)

Port-forwarding: locally call pods and deployments

Forwarding pods and deployments can be necessary if you want to run your backend or other scripts locally

For instance, to port forward accounts, use

kubectl port-forward -n ch deployment/accounts 8080:8080

Inside the pods, the above deployment is referred as accounts.ch. So, depending on what you run, you may need to set the hosts file entry

127.0.0.1 accounts.ch

Port-forwarding commands and hosts file configuration are shown at the end of the harness-deployment output.

Debug backend applications

See here