Migrating from on-prem to cloud using agnostic layer

Standard way of migrating from on-prem to cloud using Dockerfiles is tempting as it promises quick first results but these projects tend to get stuck as soon as they scale up since there is no good way to handle growing complexity. Here are the problems with standard approach:

  1. No first-class configuration management layer causing projects to get stuck or even get off the rails as soon as scale hits them. Handling growing complexity with config maps and bash scripts or home-grown solutions often proves to be not sustainable in large scale.
  2. Moving from platform specific solution (on-prem) to platform specific solution (docker). Any other platform or going back to on-prem requires new migration effort.
  3. Creating second source of infrastructure configuration parallel to existing on-prem solution. During migration process both require to be in-synch and with changing on-prem configuration this proves to be very costly sometimes not even possible. Creates a problem of “never done”.
  4. Docker multi-layered approach makes images explode in size or may even create security concerns with sensitive information removed but still being available in lower layers.

Alternative approach is to be build an agnostic layer that will abstract from technical platform. Such layer will have to cover three domains and may consist of:

  1. Ansible for configuration management to handle growing complexity as solution scales.
  2. Packer for building artefacts for multiple potential platforms.
  3. Terraform for agnostic deployments.

Such approach has following advantages:

  1. Provides proper configuration management layer. Secures transition from small to mid and large scale covering functional and inventory aspect as complexity grows.
  2. Forces project to automate existing on-prem configuration. Removing manual work brings speed, traceability, stability and quality of change.
  3. Creates single source of configuration for all platforms. Releases prepared for on-prem can be used to trigger build and deployment to other platforms. No synchronisation needed.
  4. Open solution for the future. It is not uncommon to see deployments to multiple technical platforms especially in big global companies. Such framework can be used to deploy on different platforms including going back on-prem if cloud solution proves not suitable or too expensive. No migration needed.
  5. Always working with one layer on top of base image reducing image sizes.