Basic, mostly untested k8s setup.

This commit is contained in:
Sebastian Jeltsch
2025-02-02 22:15:58 +01:00
parent ce1b382c46
commit c2fc8b1223
5 changed files with 64 additions and 14 deletions

15
deploy/docker-compose.yml Normal file
View File

@@ -0,0 +1,15 @@
services:
trail:
image: docker.io/trailbase/trailbase:latest
# build: .
ports:
- "${PORT:-4000}:4000"
restart: unless-stopped
volumes:
- ${DATA_DIR:-.}/traildepot:/app/traildepot
environment:
# Override the default env-logger.
# RUST_LOG: "info,refinery_core=warn"
RUST_BACKTRACE: "1"
command: "/app/trail --data-dir /app/traildepot run --address 0.0.0.0:4000"

4
deploy/k8s/namespace.yml Normal file
View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: trailbase

View File

@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: trailbase-deployment
namespace: trailbase
labels:
app: trailbase
spec:
replicas: 1
selector:
matchLabels:
app: trailbase
strategy:
type: Recreate
template:
metadata:
labels:
app: trailbase
spec:
containers:
- name: trailbase
image: docker.io/trailbase/trailbase:latest
env:
- name: RUST_BACKTRACE
value: "1"
volumeMounts:
- name: trailbase-storage
mountPath: /app/traildepot
restartPolicy: Always
volumes:
- name: trailbase-storage
hostPath:
path: /home/sebastian/traildepot/

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: trailbase-service
namespace: trailbase
spec:
selector:
app: trailbase
ports:
- protocol: TCP
port: 4000
targetPort: 4000

View File

@@ -1,14 +0,0 @@
services:
trail:
build: .
ports:
- "4000:4000"
restart: unless-stopped
volumes:
- ./traildepot:/app/traildepot
environment:
# Setup Rust's env-logger.
RUST_LOG: "info,refinery_core=warn"
RUST_BACKTRACE: "1"
command: "/app/trail --data-dir /app/traildepot run --address 0.0.0.0:4000"