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:
- 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.
- 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.
- 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”.
- 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:
- Ansible for configuration management to handle growing complexity as solution scales.
- Packer for building artefacts for multiple potential platforms.
- Terraform for agnostic deployments.
Such approach has following advantages:
- Provides proper configuration management layer. Secures transition from small to mid and large scale covering functional and inventory aspect as complexity grows.
- Forces project to automate existing on-prem configuration. Removing manual work brings speed, traceability, stability and quality of change.
- 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.
- 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.
- Always working with one layer on top of base image reducing image sizes.