Part 1 - Write and Deploy the App
Step 1: Create a blueprint directory and files.
The starting point of interacting with Facets Control Plane is the creation of a blueprint. A blueprint is a git version controlled collection of json files. Each of this json files represents an intent and defines the resources required and their configurations and dependencies.
For our demo application, we only need an application instance and an ingress to access the application from the outside world. There are 2 parts to creating a blueprint in Facets Control Plane.
- First is the creation of json files in a pre-defined directory structure and pushing it to a git repository.
- The second part is using this git repository to create a blueprint on Facets console.
The directory structure and directory names have to be in pre-defined format. Each resource type has a directory named after it. Each resource is defined by a JSON file, usually placed in the instances directory of a resource type. For example, if an application instance is needed, the directory name should be application and its json file would be placed in instances directory inside application directory
Our directory structure would look like below

Create features.json
and stack.json
as described in Bootstrap a Blueprint.
app.json
- Create a file namedapp.json
atapplication/instances
the following content in it. This file defines all the application resource related configurations like sizing, autoscaling, load balancing etc.
{
"$schema": "https://docs.facets.cloud/schemas/application/instances/application.schema",
"kind": "facets.modules.common.application",
"disabled": false,
"apiVersion": "v2",
"metadata": {
},
"spec": {
"env": {
},
"loadbalancing": {
"rules": [
{
"ingress": "ingress",
"path": "/",
"portName" : "port5000"
}
]
},
"permission": [],
"release": {
"strategy": "RollingUpdate",
"build": {
"image": "313496281593.dkr.ecr.us-east-1.amazonaws.com/facets/springbootsample/springboot-backend:latest"
}
},
"runtime": {
"size": {
"value": "small",
"namespace": "GP"
},
"autoscaling": {
"cpuThreshold": "50",
"max": 1,
"min": 1
},
"ports": [{
"name": "port5000",
"port": 5000
}]
}
sizing.GP.json
- Create a file namedsizing.GP.json
inside theapplication/
and put the following content in it. This file provides T-Shirt sizing options that can be used in app.json.
{
"$schema": "https://docs.facets.cloud/schemas/application/sizing.schema",
"small": {
"podCPULimit": 1,
"podMemoryLimit": 2
}
}
ingress.json
- Create a directory namedingress/instances
. Placeingress.json
with the following content in it. This file defines all the ingress related resource configurations.
{
"$schema": "https://docs.facets.cloud/schemas/ingress/instances/ingress.schema",
"apiVersion": "v2",
"subdomains" : []
}
Step 2: Launch the App
- Push all the files to a git repository and register the blueprint in the control plane
- Push the built using
Updated 10 months ago