Import

LayerOps offers users the capability to define and deploy services using YML files.

You can either paste the YML configuration of your service directly or click on "import from CI". This allows you to initialize a service that's initially empty and ready to be populated later with actions via the API.

import YML

To access the complete schema for the YML file, click on the "Show YML structure" button. Or you can call /api/v1/services/exampleImportYml?format=text to get the schema.

For example, You can create a service from the following YML:

services:
  - id: myservice
    name: my service
    dockerConfiguration:
      image: nginx
      imageVersion: latest
    countMin: 1
    countMax: 1
    ports:
      - listeningPort: 80
        healthCheckType: HTTP
        healthCheckMethod: GET
        loadBalancerRules:
          - publicPort: 443
        healthCheckEnabled: true
        healthCheckTimeoutSeconds: 30
        healthCheckPath: /
        healthCheckIntervalSeconds: 60

This definition will create a service with the Nginx image and expose port 80 on the internet.

You can also import several services at the same time:

services:
  - id: myservice
    name: my service
    dockerConfiguration:
      image: nginx
      imageVersion: latest
    countMin: 1
    countMax: 1
    ports:
      - listeningPort: 80
        healthCheckType: HTTP
        healthCheckMethod: GET
        loadBalancerRules:
          - publicPort: 443
        healthCheckEnabled: true
        healthCheckTimeoutSeconds: 30
        healthCheckPath: /
        healthCheckIntervalSeconds: 60
  - id: otherservice
    name: my other service
    dockerConfiguration:
      image: nginx
      imageVersion: latest
    countMin: 1
    countMax: 1
    ports:
      - listeningPort: 80
        healthCheckType: HTTP
        healthCheckMethod: GET
        loadBalancerRules:
          - publicPort: 443
        healthCheckEnabled: true
        healthCheckTimeoutSeconds: 30
        healthCheckPath: /
        healthCheckIntervalSeconds: 60
Check App examples for more complex examples (links between services, side task, ...).