forked from twentyhq/twenty
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating terraform and k8s files adding redis... (twentyhq#7425)
Also updated the way secrets are generated with Terraform and some code cleanup
- Loading branch information
1 parent
b508dd1
commit 0fce824
Showing
21 changed files
with
515 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/twenty-docker/k8s/manifests/deployment-redis.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: twentycrm-redis | ||
name: twentycrm-redis | ||
namespace: twentycrm | ||
spec: | ||
progressDeadlineSeconds: 600 | ||
replicas: 1 | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
selector: | ||
matchLabels: | ||
app: twentycrm-redis | ||
template: | ||
metadata: | ||
labels: | ||
app: twentycrm-redis | ||
spec: | ||
containers: | ||
- name: redis | ||
image: redis/redis-stack-server:latest | ||
imagePullPolicy: Always | ||
env: | ||
- name: PORT | ||
value: 6379 | ||
ports: | ||
- containerPort: 6379 | ||
name: redis | ||
protocol: TCP | ||
resources: | ||
requests: | ||
memory: "1024Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "2048Mi" | ||
cpu: "500m" | ||
|
||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,67 +22,78 @@ spec: | |
app: twentycrm-server | ||
spec: | ||
volumes: | ||
- name: twentycrm-server-data | ||
persistentVolumeClaim: | ||
claimName: twentycrm-server-pvc | ||
- name: twentycrm-server-data | ||
persistentVolumeClaim: | ||
claimName: twentycrm-server-pvc | ||
- name: twentycrm-docker-data | ||
persistentVolumeClaim: | ||
claimName: twentycrm-docker-data-pvc | ||
containers: | ||
- env: | ||
- name: PORT | ||
value: 3000 | ||
- name: SERVER_URL | ||
value: "https://crm.example.com:443" | ||
- name: FRONT_BASE_URL | ||
value: "https://crm.example.com:443" | ||
- name: PG_DATABASE_URL | ||
value: "postgres://twenty:[email protected]/default" | ||
- name: ENABLE_DB_MIGRATIONS | ||
value: "true" | ||
- name: SIGN_IN_PREFILLED | ||
value: "true" | ||
- name: STORAGE_TYPE | ||
value: "local" | ||
- name: "MESSAGE_QUEUE_TYPE" | ||
value: "pg-boss" | ||
- name: ACCESS_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: accessToken | ||
- name: LOGIN_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: loginToken | ||
- name: REFRESH_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: refreshToken | ||
- name: FILE_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: fileToken | ||
- image: twentycrm/twenty:latest | ||
imagePullPolicy: Always | ||
name: twentycrm | ||
ports: | ||
- containerPort: 3000 | ||
name: http-tcp | ||
protocol: TCP | ||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "1024Mi" | ||
cpu: "1000m" | ||
stdin: true | ||
tty: true | ||
volumeMounts: | ||
- mountPath: /app/docker-data | ||
name: twentycrm-server-data | ||
- mountPath: /app/.local-storage | ||
name: twentycrm-server-data | ||
- name: twentycrm | ||
image: twentycrm/twenty:latest | ||
imagePullPolicy: Always | ||
env: | ||
- name: PORT | ||
value: 3000 | ||
- name: SERVER_URL | ||
value: "https://crm.example.com:443" | ||
- name: FRONT_BASE_URL | ||
value: "https://crm.example.com:443" | ||
- name: "PG_DATABASE_URL" | ||
value: "postgres://twenty:[email protected]/default" | ||
- name: "REDIS_HOST" | ||
value: "twentycrm-redis.twentycrm.svc.cluster.local" | ||
- name: "REDIS_PORT" | ||
value: 6379 | ||
- name: ENABLE_DB_MIGRATIONS | ||
value: "true" | ||
- name: SIGN_IN_PREFILLED | ||
value: "true" | ||
- name: STORAGE_TYPE | ||
value: "local" | ||
- name: "MESSAGE_QUEUE_TYPE" | ||
value: "bull-mq" | ||
- name: "ACCESS_TOKEN_EXPIRES_IN" | ||
value: "7d" | ||
- name: "LOGIN_TOKEN_EXPIRES_IN" | ||
value: "1h" | ||
- name: ACCESS_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: accessToken | ||
- name: LOGIN_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: loginToken | ||
- name: REFRESH_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: refreshToken | ||
- name: FILE_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: fileToken | ||
ports: | ||
- containerPort: 3000 | ||
name: http-tcp | ||
protocol: TCP | ||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "1024Mi" | ||
cpu: "1000m" | ||
stdin: true | ||
tty: true | ||
volumeMounts: | ||
- mountPath: /app/docker-data | ||
name: twentycrm-docker-data | ||
- mountPath: /app/packages/twenty-server/.local-storage | ||
name: twentycrm-server-data | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,58 +21,60 @@ spec: | |
labels: | ||
app: twentycrm-worker | ||
spec: | ||
volumes: | ||
- name: twentycrm-worker-data | ||
persistentVolumeClaim: | ||
claimName: twentycrm-worker-pvc | ||
containers: | ||
- env: | ||
- name: SERVER_URL | ||
value: "https://crm.example.com:443" | ||
- name: FRONT_BASE_URL | ||
value: "https://crm.example.com:443" | ||
- name: PG_DATABASE_URL | ||
value: "postgres://twenty:[email protected]/default" | ||
- name: ENABLE_DB_MIGRATIONS | ||
value: "false" # it already runs on the server | ||
- name: STORAGE_TYPE | ||
value: "local" | ||
- name: "MESSAGE_QUEUE_TYPE" | ||
value: "pg-boss" | ||
- name: ACCESS_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: accessToken | ||
- name: LOGIN_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: loginToken | ||
- name: REFRESH_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: refreshToken | ||
- name: FILE_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: fileToken | ||
- image: twentycrm/twenty:latest | ||
imagePullPolicy: Always | ||
name: twentycrm | ||
command: | ||
- yarn | ||
- worker:prod | ||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "1024Mi" | ||
cpu: "1000m" | ||
stdin: true | ||
tty: true | ||
- name: twentycrm | ||
image: twentycrm/twenty:latest | ||
imagePullPolicy: Always | ||
env: | ||
- name: SERVER_URL | ||
value: "https://crm.example.com:443" | ||
- name: FRONT_BASE_URL | ||
value: "https://crm.example.com:443" | ||
- name: PG_DATABASE_URL | ||
value: "postgres://twenty:[email protected]/default" | ||
- name: ENABLE_DB_MIGRATIONS | ||
value: "false" # it already runs on the server | ||
- name: STORAGE_TYPE | ||
value: "local" | ||
- name: "MESSAGE_QUEUE_TYPE" | ||
value: "bull-mq" | ||
- name: "CACHE_STORAGE_TYPE" | ||
value: "redis" | ||
- name: "REDIS_HOST" | ||
value: "twentycrm-redis.twentycrm.svc.cluster.local" | ||
- name: "REDIS_PORT" | ||
value: 6379 | ||
- name: ACCESS_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: accessToken | ||
- name: LOGIN_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: loginToken | ||
- name: REFRESH_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: refreshToken | ||
- name: FILE_TOKEN_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: tokens | ||
key: fileToken | ||
command: | ||
- yarn | ||
- worker:prod | ||
resources: | ||
requests: | ||
memory: "1024Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "2048Mi" | ||
cpu: "1000m" | ||
stdin: true | ||
tty: true | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.