Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions base/api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ spec:
containers:
- image: ghcr.io/5stackgg/api:latest
name: api
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "4Gi"
cpu: "1000m"
ports:
- containerPort: 5585
startupProbe:
Expand Down
1 change: 1 addition & 0 deletions base/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- pdb.yaml
- ingress.yaml
- ingress-ws.yaml
- ingress-relay.yaml
Expand Down
10 changes: 10 additions & 0 deletions base/api/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: api-pdb
namespace: 5stack
spec:
maxUnavailable: 1
selector:
matchLabels:
app: api
14 changes: 11 additions & 3 deletions base/backups/postgres-backup-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
- |
set -euo pipefail

apk add --no-cache zip curl ca-certificates bash aws-cli || true
apk add --no-cache zip curl ca-certificates bash aws-cli

TS=$(date -u +"%Y%m%d%H%M%S")
DUMP_FILE="/tmp/backup-$TS.dump"
Expand All @@ -30,7 +30,12 @@ spec:
export PGPASSWORD="$POSTGRES_PASSWORD"

pg_dump -h "$POSTGRES_HOST" -p "$POSTGRES_PORT" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -F c -Z 0 --no-owner --no-privileges -f "$DUMP_FILE"


if [ ! -f "$DUMP_FILE" ] || [ ! -s "$DUMP_FILE" ]; then
echo "ERROR: pg_dump failed or produced empty file"
exit 1
fi

zip -j "$ZIP_FILE" "$DUMP_FILE"

ENDPOINT="${S3_ENDPOINT:-minio}"
Expand All @@ -49,7 +54,10 @@ spec:

echo "Uploading to $ENDPOINT : $S3_DB_BACKUP_BUCKET/backup-$TS.zip"

aws s3 cp "$ZIP_FILE" "s3://$S3_DB_BACKUP_BUCKET/backup-$TS.zip" --endpoint-url "$ENDPOINT"
if ! aws s3 cp "$ZIP_FILE" "s3://$S3_DB_BACKUP_BUCKET/backup-$TS.zip" --endpoint-url "$ENDPOINT"; then
echo "ERROR: S3 upload failed"
exit 1
fi

echo "Backup complete: $ZIP_FILE"

Expand Down
7 changes: 7 additions & 0 deletions base/hasura/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ spec:
containers:
- image: hasura/graphql-engine:v2.48.9-ce.cli-migrations-v3
name: hasura
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "4Gi"
cpu: "1000m"
ports:
- containerPort: 8080
startupProbe:
Expand Down
3 changes: 2 additions & 1 deletion base/hasura/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- ingress.yaml
- ingress.yaml
- pdb.yaml
10 changes: 10 additions & 0 deletions base/hasura/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: hasura-pdb
namespace: 5stack
spec:
maxUnavailable: 1
selector:
matchLabels:
app: hasura
7 changes: 7 additions & 0 deletions base/minio/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ spec:
containers:
- name: minio
image: quay.io/minio/minio:latest
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
ports:
- containerPort: 9000
- containerPort: 9090
Expand Down
7 changes: 7 additions & 0 deletions base/redis/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ spec:
containers:
- name: redis
image: redis:8.4-alpine
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "250m"
ports:
- containerPort: 6379
protocol: TCP
Expand Down
3 changes: 2 additions & 1 deletion base/timescaledb/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ kind: Kustomization

resources:
- stateful-set.yaml
- service.yaml
- service.yaml
- pdb.yaml
10 changes: 10 additions & 0 deletions base/timescaledb/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: timescaledb-pdb
namespace: 5stack
spec:
maxUnavailable: 1
selector:
matchLabels:
app: timescaledb
7 changes: 7 additions & 0 deletions base/timescaledb/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ spec:
containers:
- name: timescaledb
image: timescale/timescaledb:latest-pg17
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
args:
- postgres
- '-c'
Expand Down
7 changes: 7 additions & 0 deletions base/typesense/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ spec:
containers:
- name: typesense
image: typesense/typesense:29.0
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
ports:
- containerPort: 8108
startupProbe:
Expand Down
7 changes: 7 additions & 0 deletions base/web/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ spec:
containers:
- image: ghcr.io/5stackgg/web:latest
name: web
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "250m"
ports:
- containerPort: 3000
startupProbe:
Expand Down