CloudHarness is a base infrastructure facilitator for microservice based applications deployed on Kubernetes. Can scaffold and maintain your cloud solution on top of Cloudharness without writing Kubernetes templates, with in place common utilities and applications already configured for you.
What building your cloud solution with CloudHarness gives to you:
The microservice architecture is a great to get code separation and flexible development, but may not be of easy implementation, especially for small development teams/projects. In particular, these questions may rise:
CloudHarness provides the following command line tools to help application scaffolding and deployment.
harness-deployment
- generate the helm chart to deploy on Kubernetes. harness-application
- create a new CloudHarness REST application.harness-generate
- generates server and client code for all CloudHarness REST applications.harness-test
- run end to end tests
Cloudharness can be used on all major operative systems.
Python 3.9 must be installed.
It is recommended to setup a virtual environment. With conda:
conda create --name ch python=3.9
conda activate ch
Docker is required to build locally.
kubectl allows you to connect to your Kubernetes cluster or local environment.
Helm is required to deploy to your Kubernetes cluster or local environment.
Skaffold is the way to go to build and debug your application in your local development environment.
A node environment with npm is required for developing web applications and to run end to end tests.
Recommended:
A JRE is needed to run the code generators based on openapi-generator.
For more info, see here.
To use the cli tools, install requirements first:
bash install.sh
To generate a deployment, run harness-deployment
. See below for more.
To create a new REST application, run harness-application
from the root of your solution.
To (re)generate the code for your applications, run harness-generate
from the root.
The script will look for all openapi applications, and regenerate the Flask server code and documentation.
Note: the script will eventually override any manually modified file. To avoid that, define a file openapi-generator-ignore.
CloudHarness is born to be extended. In order to extend CloudHarness you just need to mirror the folder structure:
or simply copy the blueprint folder.
The script harness-deployment
scans your applications and configurations to create the build and deploy artifacts.
Created artifacts include:
With your solution folder structure looking like
applications
deployment-configuration
infrastructure
cloud-harness
run
harness-deployment cloud-harness . [PARAMS]
to create the build and deployment artifacts for your solution. See the dedicated Build and deploy document for more details and examples.
Any Dockerfile added in a subfolder below the applications directory is interpreted as an application part of the deployment.
The harness-application
cli tool creates new applications from predefinite code templates.
See the dedicated Applications documents for more details and examples.
First, create the folder deployment-configuration
on project level.
Then, you can selectively add files related to configuration that you want to personalize:
values-template.yaml
: base for helm/<chart-name>/values.yaml
. Modify this file to add values related to new infrastructure elements not defined as an applicationvalue-template.yaml
: cloud-harness application configuration inside values.yaml
. Prefer adding a custom values.yaml
to your application over changing this file.codefresh-template-dev.yaml
: base for codefresh/codefresh-dev.yaml
. Modify this file if you want to change the build and deploy steps in the codefresh dev pipelinecodefresh-template-prod.yaml
: base for codefresh/codefresh-prod.yaml
. Modify this file if you want to change the deploy and publish steps in the codefresh production pipeline. The production pipeline is meant to reause the same set of images from a previously completed dev pipeline.codefresh-build-template.yaml
: base for a single build entry in codefresh.yaml
For more information about how to configure a deployment, see here