3

I'm creating a CI/CD pipeline, and I'd want to understand how am I going to use the same docker image (assuming it is possible) and deploy it to multiple AKS environments such as QA, STG, and Prod.

Additionally, how am I supposed to perform the transformation in my code if the idea is to create a single image and deploy it to a different environment?

1

If you think about the base Sitecore images distributed from the Sitecore container registry, these images deliver immutable code that can be deployed on any AKS cluster. The reason this is possible is because all unique configuration variables are managed via environment variables in the images and managed as Kubernetes secrets in AKS.

If you want your custom images containing your custom code to be deployed on different AKS clusters representing different environments (QA, UAT, regression,...), you need to handle custom settings in your solution that might have different values among your environments using environment variables as well.

For the transformations, you can still use them to apply changes to config files that cannot be patched (ie. web.config) when you build your solution asset image, but you cannot use different transformations for different environments. Instead you can use custom config roles (with custom app settings) to define rule-based configurations that apply to a specific environment only (see documentation). The value of the custom app setting that defines your environment would of course still be managed with an environment variable.

0

You might want to give a try and use Init Images, as described by George Chang at this article: https://georgechang.io/posts/2021/installing-sitecore-packages-to-containers/

Init images are special images that run once to do some initialization on the containers once they load. These typically are to handle exceptions for things that can’t be baked into images (or don’t make sense to be baked in). The two that ship with Sitecore are to create the Solr indexes and SQL databases - makes sense in case you’re using a hosted service for either so you’ve got options.

So, if you’re adding/updating files to your runtime images - easy. You’ve got your various files and DLLs to copy in. Hold on to those.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.