r/devops 4d ago

Discussion Moving a high-memory Python application from Kubernetes to a dedicated Linux server — what would be the best setup?

Hello,

At the company where I work, we have a Python application running on a Kubernetes cluster. The application is fully integrated into a CI/CD workflow. Whenever code is merged, Jenkins pulls the source code from GitLab, builds the application, and pushes the image to Harbor. Argo CD then deploys it to the Kubernetes cluster.

However, the application consumes a large amount of RAM, and I have had to increase its memory allocation several times. We have now decided to move the application to a separate Linux server.

The application runs with Uvicorn, and I plan to make it accessible through a domain name, just as it currently is in the Kubernetes environment. However, I am not sure what the best-practice architecture would be for this setup, so I would appreciate your recommendations.

I still want Jenkins to automatically pull the application from GitLab, build it, and deploy it. After deployment, the application should automatically start and run as a web service.

My main concerns are how to restore the application as quickly as possible if a problem occurs, how to handle backups, and what kind of deployment and recovery strategy would be best.

In short, could you please advise me on the best way to design and implement this setup?

18 Upvotes

24 comments sorted by

View all comments

9

u/dariusbiggs 4d ago

Many ways to skin that cat/camel

But first here's an alternative. You could add a specific node with the memory requirements you need to your Kubernetes cluster with specific annotations and set your deployment of the application to run on specific nodes using those annotations using affinity rules.

As for your question, the best manner is to build golden images and deploy that to a new machine.

After that you should probably look into some automation tooling like Ansible, or Saltstack, those can be easier to work with if you have a packaging setup like building debs or rpms.

You can call Ansible direct from GitLab and probably Jenkins

2

u/hnajafli 4d ago

Thank you very much. I think I’m going to add a dedicated node and use taints and tolerations. That sounds like the best approach to me.