Files
bootnode/infra/k8s/shared/datastore.yaml
zeekay 73a3d23053 feat: production deployment with shared Hanzo infrastructure
- Add k8s configs for production deployment
- Use shared postgres/datastore in hanzo namespace
- Fix image registry to ghcr.io/hanzoai/bootnode
- Add deploy script with shared infra support
- Simplify compose.yml for local development
2026-02-02 16:39:52 -08:00

105 lines
2.4 KiB
YAML

# Shared Datastore (ClickHouse) for Hanzo services
# Deployed to hanzo namespace, used by bootnode for analytics
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: datastore
namespace: hanzo
labels:
app: datastore
spec:
serviceName: datastore
replicas: 1
selector:
matchLabels:
app: datastore
template:
metadata:
labels:
app: datastore
spec:
containers:
- name: clickhouse
image: clickhouse/clickhouse-server:24-alpine
ports:
- containerPort: 8123
name: http
- containerPort: 9000
name: native
env:
- name: CLICKHOUSE_DB
value: hanzo
- name: CLICKHOUSE_USER
valueFrom:
secretKeyRef:
name: datastore
key: username
- name: CLICKHOUSE_PASSWORD
valueFrom:
secretKeyRef:
name: datastore
key: password
- name: CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT
value: "1"
volumeMounts:
- name: datastore-data
mountPath: /var/lib/clickhouse
resources:
requests:
cpu: "250m"
memory: "512Mi"
limits:
cpu: "2000m"
memory: "4Gi"
livenessProbe:
httpGet:
path: /ping
port: http
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /ping
port: http
initialDelaySeconds: 5
periodSeconds: 5
volumeClaimTemplates:
- metadata:
name: datastore-data
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: do-block-storage
resources:
requests:
storage: 50Gi
---
apiVersion: v1
kind: Service
metadata:
name: datastore
namespace: hanzo
labels:
app: datastore
spec:
type: ClusterIP
ports:
- port: 8123
targetPort: 8123
name: http
- port: 9000
targetPort: 9000
name: native
selector:
app: datastore
---
apiVersion: v1
kind: Secret
metadata:
name: datastore
namespace: hanzo
type: Opaque
stringData:
username: hanzo
password: "${DATASTORE_PASSWORD}"
url: "clickhouse://hanzo:${DATASTORE_PASSWORD}@datastore:8123/hanzo"