Skip to content
Marketing Factory Digital GmbH
Contact
Logo Marketing Factory Digital GmbH
  • Agency
    • About us
    • History
  • Services
    • Consulting, Analysis and Strategy
    • Programming and Development
      • Interface Development
      • PIM/ERP Links
      • Custom Development
      • Seamless CMS Integration
    • Hosting and Support
      • Cloud Strategies
      • Hosting Partners of Marketing Factory
    • Services with Third Parties
  • Technology
    • TYPO3
      • Current TYPO3 Versions
    • Shopware
    • IT Security
      • DDoS Protection
      • Continuous Upgrading
      • Privacy First
    • Tech Stack
      • Commitment to Open Source
      • Technology Selection
      • PHP Ecosystem
      • Containerisation & Clustering
      • Content Delivery Networks
      • Search Technologies
  • References
    • Projects
    • Clients
      • Client List
    • Screenshot of the homepage of the new Maxion Wheels websiteNEW: Relaunch of the corporate website of Maxion Wheels
  • Community
    • Community Initiatives
  • Blog
  • Contact
  • Deutsch
  • English

You are here:

  1. Blog
  2. Efficient review environments: Why we replaced Kubernetes with Virtual Machines
[Translate to English:]
  • Development
  • Hosting
  • Tech Stack
  • Shopware
  • TYPO3
09.10.2024

Efficient review environments: Why we replaced Kubernetes with Virtual Machines


Show larger version for: The image displays a deployment log for a software project in gitlab. It shows successful deployments for two tasks.
Screenshot from GitLab: Active review environments for our website

For the development of our TYPO3 and Shopware projects, we use an approval environment where we create a copy of the website based on the current development code, including the live data set. This allows us and our clients to test new features directly, without being distracted by outdated or test data.

This process is fully automated in our GitLab instance. When the first commit is made in a feature branch, the environment is created, and with each subsequent commit, the code is updated. Once the branch is approved and merged, the environment is automatically torn down.

Until a few months ago, these environments ran on an external Kubernetes cluster. We created Docker images for each instance and deployed them using the appropriate Helm charts. However, several issues arose. First, simply purchasing a cluster is not enough. To stay as close as possible to the existing production setup, storage needs to be provided in such a way that the application behaves as expected. However, this isn't truly "Kubernetes-native," which created additional overhead that wasn't directly related to running test systems.

Moreover, debugging issues - the primary goal of test systems - became significantly more complex in such an environment. Cloud-native applications are typically stateless. They can run in read-only environments because they expect databases to be external and logs to be collected by an external log analysis system. This makes sense for distributed systems and enables horizontal scaling on a large scale. A Kubernetes pod running an application can be replaced by another at any time and then removed. Without in-depth knowledge, it can be difficult to determine or control exactly when this happens, which complicates error analysis. Additionally, during development, it is challenging to execute simple CLI commands or inspect log files.

While it’s possible to connect to the next pod using kubectl and perform these tasks, this adds unnecessary complexity for the development team, which negatively impacts Developer Experience (DX).

Show larger version for: A workflow pipeline is displayed, showing various job stages: 'prepare,' 'analysis,' 'build,' and 'deployment.' Each stage lists specific jobs with checkmarks indicating completion, such as 'collect-build-dependencies' and 'frontend-build,' while some jobs are in progress.
Screenshot of our deployment pipeline

Complicated isn’t always better

Another issue arose from the fact that instances running on Kubernetes were architecturally far removed from our production systems. This led to subtly altered application behavior once they were running on the cluster, which was also difficult to debug in practice.

So, we went back to the drawing board and re-examined the problem we were trying to solve. The main goal was to dynamically provide test instances and consume compute and storage resources only as long as those instances were needed.

Most infrastructure providers now offer APIs to programmatically allocate and decommission resources. Terraform, a widely-used tool, provides a common abstraction that allows us to easily switch between providers if needed. With Terraform, we can script the creation of VMs with defined properties at various providers. The provider takes care of the initial setup of the VM and typically installs an image of a selected operating system, such as a Linux distribution.

What was missing was the automated setup and configuration of the necessary software to run our test instances, i.e., a typical PHP-based web server stack. This is something we handle daily, and in collaboration with Terraform, we were able to automate it for the test environments using Ansible.

The result is that we now have environments that are much closer to what we run in production. These systems allow direct access via SSH, just like our production systems, making it easy to analyze errors, inspect logs, or check whether specific processes are running. Despite the fact that the test instances we create are effectively production-grade systems, we can still provision or decommission them as needed. Our goal was fully achieved: The environments are now more stable and faster.

This shift once again showed us that not everything that is technically possible is necessarily the best option. In hindsight, Kubernetes is not the optimal choice for the scenario of a "1:1 copy of a web application." We regularly review the technologies we use and adjust them as needed, allowing us to continuously improve both technically and conceptually - to the benefit of our client.

That said, Kubernetes still has its place for us. We continue to use it successfully in other areas, such as for running our GitLab runners.

65% savings

Yesterday, we received the second monthly invoice for our new infrastructure. Compared to the months with Kubernetes, we are now saving 65% in costs. Granted, this wasn’t our initial goal, but we’re happy to take this additional benefit! :-)

Authors

"Mr. Fix-It" likes to impose his will on software and hardware. Speaks fluent meme and picdump. Responsible for development and technical design at Marketing Factory.

More posts by this author

Fluent in TypoScript, php and sql; knows perl and bash and has very basic knowledge in java. Joined in 1996 and is meanwhile as managing director responsible for development, operation and hosting of our products. Articles in this blog cover technical and sustainable topics.

More posts by this author

Get blog posts as RSS feed

Related blog posts

  • Relaunch of the website of our client Maxion Wheels based on TYPO3 12.4 LTS
  • User-friendly customization of the TYPO3 backend
  • Show Trusted Shops reviews in Shopware 6
  • Logging-Extension for Shopware 6

Please feel free to share this article.


Comments

No comments yet.

Write a comment.

I have been informed that the processing of my data is on a voluntary basis and that I can refuse my consent without detrimental consequences for me or withdraw my consent at any time to Marketing Factory Digital GmbH by mail (Marienstraße 14, D-40212 Düsseldorf) or e-mail (info@marketing-factory.de).

I understand that the above data will be stored for as long as I wish to be contacted by Marketing Factory. After my revocation my data will be deleted. Further storage may take place in individual cases if this is required by law.

  • Data privacy policy
  • Legal notice

© Marketing Factory Digital GmbH

Picture Credits
  1. "Screenshot Environment ": © Ingo Schmitt / Marketing Factory Digital GmbH
  2. "Screenshot deployment pipeline": © Ingo Schmitt / Marketing Factory Digital GmbH
  3. "battleship engine room": GregoryButler / License: Pixabay License (CC0 1.0)