Onboard a Service in your Environment

Deploy a service on the environment

Picking a simple enough App

For the purpose of understanding how to onboard a service, we are going to use a simple "Hello World" springboot application by dstar55.

You can build a container with the existing Dockerfile and run it locally. It simply responds with a "Hello World" on port 8080. Let's build, run, test and push to Facets Control Plane manually :point-down:

You can refer to Facets Command Line Tool for more details on the command line tool.

📘

In this example, we are pushing the build manually. Please refer to Integrating with CI for more information on automating build pushing to the Facets Control Plane.

Defining the service in the Blueprint

Create a directory named applications in the Blueprint. Place a json file named sizing.$Namespace.json . The keys of the json file can be referred in the application intents to specify the pod limits for the service. For e.g., sizing.GP.json can contain the following.

{
  "$schema": "https://docs.facets.cloud/schemas/application/sizing.schema",

  "small": {
    "podCPULimit": 1,
    "podMemoryLimit": 2
  }
}

Create a named ingress

We need a service to expose the pod to the outside world. Create a directory named ingress/instances and place a file named appingress.json.

{
  "$schema": "https://docs.facets.cloud/schemas/ingress/instances/ingress.schema",
  "apiVersion": "v2",
  "subdomains" : []
}

Create an application blueprint

Place a file in application/instances. In this case, we can call it backend.json.

{
 "$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": "appingress",
      "path": "/",
      "portName" : "port8080"
     }
    ]
   },
   "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": "port8080",
     "port": 8080
    }]
   }
  }
 }

📘

In this example we didn't need additional environment variables. Please refer to Working with Env Vars for more details on additional variables.

Perform a Release

Now perform a full release from the releases tab.

📘

For more information on releases, please refer Performing a Release.

Test the application

Head over to the Application page in the Control Plane and locate the backend application.

Test the output of the application. You should see the output displayed as "Hello World".

$ curl https://appingress-621a28187396e300079633f8.console.facets.cloud/
Hello World

Did this page help you?