Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Kubernetes via Terraform and Manifests #5721

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

LumosViridi
Copy link

Support for Kubernetes via Terraform and Manifests

Adding basic support for the following Kubernetes resources

  • persistent volume
    • server
    • database
  • persistent volume claim
    • server
    • database
  • deployment
    • server
    • database
  • ingress
    • server
  • service
    • server
    • database
  • secret
    • server

Copy link

github-actions bot commented Jun 4, 2024

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against 708c95a

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

  • Added Kubernetes deployments for server and database
  • Introduced services for server and database
  • Configured persistent volumes and claims for server and database
  • Set up Ingress for external access
  • Added Terraform configurations for Kubernetes resources

@FelixMalfait
Copy link
Member

Oh nice thanks :). I've never done any Terraform so I'm not able to review this but I know some people will be happy to see this

@sysaeon
Copy link

sysaeon commented Jun 9, 2024

Thanks for adding this! It motivated me to get Twenty setup in my k3s cluster for testing.

I ended up using the bjw-s App Template Helm Chart with many of the values you provided here in the manifests. Also, using Flux instead of Terraform.

Had to define FRONT_BASE_URL due to this error:

- property FRONT_BASE_URL has failed the following constraints: isUrl

Also, the service for twenty-postgres shows up as twenty-twenty-postgres, which changed the URL (for me) to:

postgres://twenty:[email protected]/default

Does anyone know if it's possible to change the postgres password without building a new docker image? It would make sense to put the postgres password and URL into secrets and call them with something like this (under each deployment):

- name: POSTGRES_PASSWORD
  valueFrom:
    secretKeyRef:
      name: twenty-config-secrets
      key: pgPassword
---
- name: PG_DATABASE_URL
  valueFrom:
    secretKeyRef:
      name: twenty-config-secrets
      key: pgDatabaseUrl

Otherwise, everything appears to be running well.

@LumosViridi
Copy link
Author

Thanks for adding this! It motivated me to get Twenty setup in my k3s cluster for testing.

I ended up using the bjw-s App Template Helm Chart with many of the values you provided here in the manifests. Also, using Flux instead of Terraform.

Had to define FRONT_BASE_URL due to this error:

- property FRONT_BASE_URL has failed the following constraints: isUrl

Also, the service for twenty-postgres shows up as twenty-twenty-postgres, which changed the URL (for me) to:

postgres://twenty:[email protected]/default

Does anyone know if it's possible to change the postgres password without building a new docker image? It would make sense to put the postgres password and URL into secrets and call them with something like this (under each deployment):

- name: POSTGRES_PASSWORD
  valueFrom:
    secretKeyRef:
      name: twenty-config-secrets
      key: pgPassword
---
- name: PG_DATABASE_URL
  valueFrom:
    secretKeyRef:
      name: twenty-config-secrets
      key: pgDatabaseUrl

Otherwise, everything appears to be running well.

Thanks for your comment @sysaeon!

The pg password caused a lot of trouble for me as well. I spent a few hours banging my head on my keyboard trying to get any value other than twenty to work. I was only able to establish a connection with the hardcoded / default value. 🫤

I had issues with the FRONT_BASE_URL as well but it looks like you were able to work through it.

@sashahilton00
Copy link

I'd just add, the use of ReadWriteMany for the persistent volumes will cause problems with most cloud providers. It may work in a k3s setup, but iirc GCP, AWS and DO do not support it for their storage classes.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

  • Updated useTasks hook to improve task fetching and filtering
  • Enhanced useWorkspaceFromInviteHash for better workspace invite handling
  • Modified RecordTableCellContainer to handle edit/display modes and hotkeys
  • Improved useFindManyRecords for efficient record fetching
  • Added useHandleToggleColumnFilter and useHandleToggleColumnSort for column filter/sort management

10 file(s) reviewed, no comment(s)

@LumosViridi
Copy link
Author

I'd just add, the use of ReadWriteMany for the persistent volumes will cause problems with most cloud providers. It may work in a k3s setup, but iirc GCP, AWS and DO do not support it for their storage classes.

Good call! Most default cases like AWS EBS-CSI don't support ReadWriteMany but AWS EFS-CSI now has native support.

I tried to convey in the README that storage is highly opinionated to the users environment and should be expected to be modified.

I update this to ReadWriteOnce since it will work in more use-cases than ReadWriteMany. Hopefully it helps others use this more easily! 🚀

@lucasbordeau lucasbordeau self-assigned this Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants