It sounds like you're facing an issue where the static error page you've generated within Sitecore is not persisting across deployments in your Docker-based AKS environment. This could be due to the statelessness of your containers, which might not be preserving the changes you make to the static error page between deployments.
To address this issue, you can consider the following approaches:
External Content Store: Instead of relying solely on the content within the containers, you can store your Sitecore media and content in an external storage solution, such as Azure Blob Storage or a dedicated content repository. This way, your content will be decoupled from the container instances, allowing you to keep consistent content even when containers are redeployed.
Persistent Volumes: If you're using Kubernetes, consider using Persistent Volumes (PVs) and Persistent Volume Claims (PVCs) to store your Sitecore data. This can help in persisting data across container instances and deployments. By ensuring that the generated static error page is stored in a persistent volume, it should remain intact even when pods are recreated.
Custom Docker Image: Create a custom Docker image for your Sitecore application that includes the static error page as part of the image. This way, the error page will be baked into the image itself, and each new deployment will automatically include the static error page without needing manual generation.
Automated Deployment Scripts: Develop automated deployment scripts or processes that ensure the static error page is generated and deployed as part of your deployment pipeline. This way, the error page generation becomes a standard step in your deployment process, reducing the manual effort required.
Infrastructure as Code (IaC): Utilize Infrastructure as Code tools like Terraform or Azure Resource Manager templates to manage your AKS environment and ensure that the necessary resources for your static error pages are provisioned consistently.
Configuration Management: Use a configuration management tool like Ansible, Puppet, or Chef to handle the configuration of your Sitecore application, including the static error page. This ensures that the configuration is consistent across deployments.
Content Synchronization: Consider implementing a content synchronization mechanism between your Sitecore instances. This can involve using Sitecore's built-in content serialization features or third-party tools that allow you to sync content between different environments.
Ultimately, the goal is to decouple the content, including the static error page, from the ephemeral nature of container instances and ensure that it is managed in a way that persists across deployments. The specific approach you choose will depend on your architecture, deployment process, and familiarity with the different tools and technologies mentioned above. Hope this will help you to pick an approach that could be better to implement in your case.