Overview

A service deployment “recipe” is written in a Definition. A Provision then instantiates such a Definition to create a deployment for this service. The Provision may need to provide settings if the definition has requested so.

A Definition consists of the following blocks:

# resource kind declaration...
spec:
  # instance definition...
  clusters:
    # list of cluster definitions...
    nodes:
      # nodes definition...
    provides:
      # list of endpoint definitions...
  dependencies:
    # map of dependency definitions...

Resource kind

In AEP a resource needs to be typed and named and is defined by the resource kind and metadata. For Definitions this resource kind is Definition in the serivce.aep.asag.io API. The metadata specifies the name and the vendor of this resource which combination must be unique per AEP cluster. For Definitions namespaces respresent the vendor.

apiVersion: service.aep.asag.io/v1
kind: Definition
metadata:
  namespace: myvendor
  name: myname

Instance definition

The instance block primarily contains properties which identify the recipe, a list of clusters as well as a list of dependencies. It requires a name representing the wished service constellation and the version of this recipe, which means you can have different recipe versions for the same name.

kind: Definition
# ...
spec:
  name: myservice
  version: 0.0.1
  # ...

Cluster definition

The cluster block primarily contains properties to define nodes, sizing and provided endpoints of this cluster. It requires a name to represent the wished cluster constellation, which means you can have different clusters within a instance definition (E.g. In a LAMP definition an apache cluster with separate mysql cluster).

kind: Definition
# ...
spec:
  # ...
  clusters:
    - name: mycluster
      # ...

Nodes definition

Any property in the nodes definition apply to every instance of the node. As an overview the nodes block does not offer unique properties. It can contain inheritable properties and those are in more detail described in Inheritable Properties.

kind: Definition
# ...
spec:
  # ...
  clusters:
    - # ...
      nodes:
        # ...

Endpoint definition

The endpoint block primarily contains properties to define the type of clustering, filtering rules for which nodes are included as well as generic address coordinates. It requires a name to respresent the wished access constellation as a local identifier, which means you can have different endpoints within a cluster definition. (E.g. In a MySQL cluster a readwrite endpoint to the master and a readonly endpoint to the slaves) and services consuming those endpoints can find the coordinates with this identifier.

kind: Definition
# ...
spec:
  # ...
  clusters:
    - # ...
      provides:
        - name: myendpoint
          # ...

Dependency definition

The dependency block primarily contains properties to reference other definitions. It requires a name to represent the referenced definition as a local identifier. Instead of defining a cluster to which a service relies on you can also reference a Definition of such service constellation, granted it provides the wished implementation details and endpoints. A Provision of this Definition will receive the coordinates and thus will be able to consume the provided endpoints of the dependency.

kind: Definition
# ...
spec:
  # ...
  dependencies:
    mydependency:
      # ...