Align deploy paths and namespace with current k8s target
This commit is contained in:
@@ -34,23 +34,16 @@ deploy-db.sh
|
||||
README.md
|
||||
```
|
||||
|
||||
## Database
|
||||
# Database
|
||||
|
||||
The app connects to a PostgreSQL database using the `DATABASE_URL` environment variable.
|
||||
|
||||
### Deploy / rotate the database secret on Kubernetes
|
||||
Kubernetes runtime uses:
|
||||
|
||||
Run the helper script. It generates a secure random password, encrypts it to `~/.lahuasca-db-pass.enc`, and applies it to the `la-huasca-db-secrets` secret in the `la-huasca` namespace.
|
||||
|
||||
```bash
|
||||
./deploy-db.sh
|
||||
```
|
||||
|
||||
To reveal the stored password, use the PIN `78963`:
|
||||
|
||||
```bash
|
||||
./deploy-db.sh reveal
|
||||
```
|
||||
- namespace: `lahuasca`
|
||||
- Postgres: 15, PVC-backed
|
||||
- app secrets: `calendar-db-secrets`, key `url`
|
||||
- ingress: Traefik on `lahuasca.com`
|
||||
|
||||
### Initialize the database schema and seed data
|
||||
|
||||
@@ -66,6 +59,8 @@ To reset everything (drops and recreates tables with seed data):
|
||||
curl -X POST "http://localhost:3000/api/db/init?reset=true"
|
||||
```
|
||||
|
||||
Note: database initialization is blocked in production. Use `reset=true` only if you actually want schema reinitialization.
|
||||
|
||||
## Authentication
|
||||
|
||||
The app includes JWT-based session authentication backed by the database. Demo accounts are seeded automatically:
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ set -euo pipefail
|
||||
|
||||
# Deploy Postgres for la-huasca in its own namespace
|
||||
|
||||
NAMESPACE="la-huasca"
|
||||
NAMESPACE="lahuasca"
|
||||
SECRET_NAME="la-huasca-db-secrets"
|
||||
PVC_NAME="postgres-data"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ set -euo pipefail
|
||||
# - docker or buildah/push capability (we build locally and push)
|
||||
# - registry secret exists or REGISTRY_USER/REGISTRY_PASS are exported
|
||||
|
||||
NAMESPACE="la-huasca"
|
||||
NAMESPACE="lahuasca"
|
||||
IMAGE="gitea.ajavasoft.com/muken/la-huasca-ts"
|
||||
TAG="${TAG:-$(git rev-parse --short HEAD)}"
|
||||
HOSTS=("lahuasca.com" "www.lahuasca.com")
|
||||
|
||||
+5
-17
@@ -2,7 +2,7 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: la-huasca-ts
|
||||
namespace: la-huasca-ts
|
||||
namespace: lahuasca
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
@@ -29,18 +29,6 @@ spec:
|
||||
secretKeyRef:
|
||||
name: calendar-db-secrets
|
||||
key: url
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/health
|
||||
port: http
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 15
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/health
|
||||
port: http
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
resources:
|
||||
requests:
|
||||
cpu: 200m
|
||||
@@ -53,7 +41,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: la-huasca-ts
|
||||
namespace: la-huasca-ts
|
||||
namespace: lahuasca
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
@@ -67,17 +55,17 @@ apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: la-huasca-ts
|
||||
namespace: la-huasca-ts
|
||||
namespace: lahuasca
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
tls:
|
||||
- hosts:
|
||||
- la-huasca.ajavasoft.com
|
||||
- lahuasca.com
|
||||
secretName: la-huasca-ts-tls
|
||||
rules:
|
||||
- host: la-huasca.ajavasoft.com
|
||||
- host: lahuasca.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
|
||||
Reference in New Issue
Block a user