yogeshojha / rengine

reNgine is an automated reconnaissance framework for web applications with a focus on highly configurable streamlined recon process via Engines, recon data correlation and organization, continuous monitoring, backed by a database, and simple yet intuitive User Interface. reNgine makes it easy for penetration testers to gather reconnaissance with minimal configuration and with the help of reNgine's correlation, it just makes recon effortless.
https://yogeshojha.github.io/rengine/
GNU General Public License v3.0
7.53k stars 1.14k forks source link

K8s setup for reNgine #1457

Open 0xtejas opened 1 month ago

0xtejas commented 1 month ago

This pull request introduces several Kubernetes configurations for deploying various services, including Celery, Nginx, PostgreSQL, Redis, and a web application. The changes include deployment configurations, persistent volume claims, services, and secrets.

Deployment Configurations:

Persistent Volume Claims:

Services:

Secrets:

ConfigMaps:

StatefulSets:

These changes collectively set up the necessary infrastructure for deploying and managing the services in a Kubernetes environment.

github-actions[bot] commented 1 month ago

Woohoo @0xtejas! 🎉 You've just dropped some hot new code! 🔥

Hang tight while we review this! You rock! 🤘

0xtejas commented 1 month ago

I need additional hands on this to improvise a few more things:

0xtejas commented 1 month ago

The boot order for the services are: postgres, redis, web, celery and celery-beat.

0xtejas commented 1 month ago

@yogeshojha you'll also have to release packages (docker images) for celery and celery-beat. In the current setup, it is using the ones that I built and pushed to GHCR.

yogeshojha commented 3 weeks ago

@0xtejas I am reviewing this, is this ready?

0xtejas commented 3 weeks ago

No @yogeshojha I need some more help on the other points that I have listed out above. I'll try accomplishing if possible and update the checkboxes.

0xtejas commented 3 weeks ago

There seems to be an issue with the current PR, the celery pod gets evicted after an hour or so. Also, the current resource requests and limits will get the pod killed with OOM. If we remove it, the issue should be resolved. However, the former issue is not yet addressed.

github-actions[bot] commented 3 weeks ago

Hey, thanks for your contribution! 🙏

We appreciate the time and effort you put into this PR. Sadly this is not the right fit for reNgine at the moment.

While we couldn't merge it this time, we value your interest in improving reNgine.

Feel free to reach out if you have any questions. Thanks again!

0xtejas commented 3 weeks ago

Sorry closed the PR by mistake. I have a few more changes left and an investigation to conduct into why the pod celery gets evicted once it reaches the end.

0xtejas commented 3 weeks ago

Almost, everything is done. I still cannot figure out why the celery pod gets OOMKilled. I'd appreciate it if you could check. Overall it works. I did not implement a replication method for DBs. This means if a user has more than 1 replica then they'll have to figure out how to setup data replication. We can revisit this advanced stuff in later issues/pr.

0xtejas commented 3 weeks ago

I've confirmed that the celery pod used to get killed cuz of less resource in the node. We will have to figure out a proper resource request and limitation for it to work in the 2 nodes - 4 GB / 2 vCPU environment. I confirmed that it is working without eviction/termination in memory-optimized nodes m-4vcpu-32gb x 2

0xtejas commented 2 weeks ago

@yogeshojha, can you please take a look when you get time? I've added all the manifest required. Some say the correct way to distribute K8s is using the HELM Chart, but I'm not very familiar with doing it.