An application deployment process in Skopos is defined by up to 3 different descriptor files (manifests):
- the application model, which defines the components and their dependencies. The model, among other things, refers to the particular images (versions) of components to be deployed. Multiple versions of the model may exist and the model file is usually checked in version control together with the application's code (or in a separate, deployment-only source repository). The format of the Skopos model file is defined in the Skopos Model Reference. There is also limited support for using a docker-compose application descriptor as a Skopos model.
- the target environment descriptor, which defines how the model is mapped to an execution environment (cluster, infrastructure). If there are multiple deployments of the application (also known as instances, environments, or theaters), they all share a model but each has its own environment descriptor.
- (starting with Skopos 0.8, this is optional) the deployment plan, which defines the steps that need to be taken for the application to be deployed to an environment. If a custom plan is not provided, Skopos will create a plan based on the current state of the application and the provided model. Automatic planning is available in Skopos 0.8 and later; note that an imported docker-compose model has a limited ability to express relationships between application's components and may be insufficient to produce a correct deployment plan, therefore the native Skopos model descriptor is preferred when using automatic plan generation. The same application may have multiple deployment plans, each defining a different deployment process (initial deployment, upgrade, teardown, hotfix, etc.). If manually-created plans are used, they are also usually checked into version control, together with the model.
Starting with Skopos 0.8, the deployment plan is created automatically by Skopos; it is no longer necessary to provide deployment plans manually, although it is possible to do so. It is also possible to extract the plan generated by Skopos, modify it and resubmit it for execution.
The model and environment are tied together under the notion of a project, which represents a particular instance (target environment) of the application. Skopos plans are always executed in the context of a project. The project name is also used to tag the components of the application's deployment so they can be easily identified among other components that may be executing in the same infrastructure (Docker cluster, AWS VPC, etc.). When upgrading or otherwise modifying an existing deployment of an application, the project name must match the project name with which the application was initially deployed.
To prepare Skopos for a deployment process, the model and environment need to be loaded into an available instance of the Skopos engine. Then Skopos will use the environment descriptor to collect the existing state of the application (if any) and create a deployment plan that will start from the existing state and result into a transformation into the target state defined by the model. The target state, among other things, includes the set of components (services), their images & versions, and the number of replicas for each.
A Skopos deployment process can perform one or more of the following:
- initial deployment (from no components running to the target model)
- rolling upgrade (from a running set of components to a new version of one or more components)
- replica scale (change the number of replicas for one or more components)
- teardown (of the whole application or components removed from the model)
The deployment process can be run from a remote host. To do this, pass the
server host:port to the
--bind parameter of the
skopos utility. Run
skopos --help or see the next section for details on supported operations.
skopos load --bind localhost:80 --project HelloWorld --env prod.yaml model.yaml
To start the deployment process, open the Skopos user interface, review the model and the generated plan,
and press the Start button. The start can also be initiated using the
skopos utility. (Note that if the current state of the application matches the model's target state,
there will be no plan and Skopos will indicate that the deployment matches the target.)
It is also possible to automatically start the deployment process after load, using the
command instead of
skopos load. The
run command loads the descriptors and starts the plan's execution.
See Command Line Options for details on the available commands and options.