https://opsera.atlassian.net/browse/OPL-691 Opsera provides the ability to integrate with the tasks and management provided around the Elastic Container Services in AWS in multiple ways. Users can take advantage of Octopus based iterations through Opsera (see our Octopus documentation) or natively through direct Opsera to AWS integration. This native integration allows for both a more simplified experience with interacting with AWS and also provides more security and structure to the interactions. Tasks around creating clusters can be restricted behind our RBAC mechanisms and then deployment of updated containers can be managed through our pipelines directly. This creates a more secure and easily repeatable process for managing ECS in AWS.
The Opsera integration with AWS ECS is broken into two components: creation, management and execution of tasks (Opsera Tasks) for managing the clusters and then direct pipeline steps (Opsera Pipelines) to publish containers. The two aspects are necessary to work together in order to complete the functionality. Listed below are details on how to perform all of the tasks in Opsera.
Expand | |
---|---|
|
...
| |
Service Creation workflow requires setup in both Task and Pipeline. Service Creation and deployment requires the latest image URL in order to deploy and this is generated during pipeline runtime. The workflow is separated into two parts where the user enters certain static information in the Tasks page and then links the task to the respective Docker step in the pipeline. The following step refers to the setup in Task.
Once this Task template is created, a pipeline can now be setup using this Task. Deployment requires the latest image URL in order to deploy and that is generated during pipeline runtime. |
Expand | |
---|---|
|
...
| |
To set up an ECS Service Pipeline pipeline, create 3 pipeline steps: Build, Docker ECR Push and AWS ECS Deploy
|
Amazon ECS Service Creation Help Documentation
Service Creation workflow requires setup in both Task and Pipeline. The reason for this is that Service Creation and deployment requires the latest image URL in order to deploy and that is generated during pipeline runtime. The workflow is separated into two parts where the user enters certain static information in the Tasks page and then links the task to the respective Docker step in the pipeline. The following step refers to the setup in Task.
Amazon ECS Service Creation Setup - Tasks
Similar to ECS Cluster Creation, ECS Service creation templates can also be created via the Tasks tab.
Navigate to Tasks and click +Create New Task
Click Create AWS ECS Service from the Type drop down menu.
This then presents user with options that are required for service creation:
AWS Tool - Configured in Tool Registry
Required Compatibility
Cluster Name
Existing VPC
Desired Count - This is the count of deployments desired. Creation of the number of cluster replications. Number replications of the image that we are going to deploy
Service Log Group - any created name
Load Balancer ARN
Execution Role ARN
Subnets - Add 2 subnets from drop down.
...
Once this Task template is created, a pipeline can now be setup using this Task. Deployment requires the latest image URL in order to deploy and that is generated during pipeline runtime. Hence currently the workflow is separated into two parts where the user enters certain static information in the Tasks page and then links the task to the respective Docker step in the pipeline.
...
Once the user successfully creates a template they can then create a pipeline in the pipelines tab and add the AWS ECS Deploy step which is used to create and deploy services.
...
The pipeline to deploy a service requires a Docker Build and Docker Push step after which the user can add the AWS ECS Deploy step. The AWS ECS Deploy asks the following information from the user:
...
In the pipeline step the user then needs to select the step that conducts their docker push and they need to select the service template that they created in the Tasks page. Along with this we have the .
Amazon ECS Service Creation Setup - Pipeline
To set up an ECS Service pipeline, create 3 pipeline steps: Build, Docker ECR Push and AWS ECS Deploy.
...
Build
Docker ECR Push - Create a new pipeline step
Initial Setup: Create new pipeline step using Docker ECR Push as Tool and Save
...
Step Configuration:
Jenkins Tool - Select the jenkins tool that contains a docker push job.
Jenkins Job - DOCKER PUSH (must be created in selected Jenkins Tool)
AWS Credentials - Select an AWS account configured in Opsera Tool Registry
Build Step Info - Build
ECR Repository - Use an existing Repository or create a new one.
...
AWS ECS Deploy - Create new pipeline step using AWS ECS Deploy as Tool.
Docker Step - Create a name.
Service Task - Fetched from AWS ECS Service Tasks
Generate Dynamic Service Name toggle - currently not working, when it works the port name will not have to be changed for every pipeline run.
Dynamic Name Prefix
Service Name Example - User has option to dynamically generate service names on runtime as AWS does not allow two services to have the same name. The user can give a prefix to the service and the pipeline will generate a unique service name with the prefix and the run count when the pipeline runs.
Additionally, the user also needs to enter the port they they want to deploy the service at.
In future we will be adding an option to delete the service running at a particular port before the deployment. This is not available yet hence that option is disabled in the pipeline for now.
...
Service Container Port - This is the location where service will be deployed.