MetaCell / cloud-harness

Other
14 stars 5 forks source link

drawing

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:

Why CloudHarness?

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:

Command line tools

CloudHarness provides the following command line tools to help application scaffolding and deployment.

Prerequisites

Operative system

Cloudharness can be used on all major operative systems.

Python

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

Docker is required to build locally.

Kubernetes command line client

kubectl allows you to connect to your Kubernetes cluster or local environment.

Helm

Helm is required to deploy to your Kubernetes cluster or local environment.

Skaffold

Skaffold is the way to go to build and debug your application in your local development environment.

Node environment

A node environment with npm is required for developing web applications and to run end to end tests.

Recommended:

Java Runtime Environment

A JRE is needed to run the code generators based on openapi-generator.

For more info, see here.

CloudHarness command line tools

To use the cli tools, install requirements first:

bash install.sh

Generate deployment

To generate a deployment, run harness-deployment. See below for more.

Create new REST application

To create a new REST application, run harness-application from the root of your solution.

Generate server and client code from openapi

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.

Extend CloudHarness to build your solution

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.

Build and deploy

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.

Add and manage applications

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.

Configure the deployment

First, create the folder deployment-configuration on project level.

Then, you can selectively add files related to configuration that you want to personalize:

For more information about how to configure a deployment, see here

Codefresh build status