towerops/k8s
Graham McIntire 25b82848d6
Run migrations on app start instead of separate job
- Migrations now run in Application.start/2 before starting services
- Ecto's advisory locks prevent concurrent migrations in clustered setup
- Simplified deployment - no separate migration job needed
- Removed migrate-job.yaml manifest
2026-01-03 16:09:31 -06:00
..
certificate.yaml Remove www subdomain from certificate and IngressRoute 2026-01-02 15:06:21 -06:00
deployment.yaml Add security context to meet PodSecurity restricted standard 2026-01-03 16:02:27 -06:00
Dockerfile Silence debconf warnings in Docker builds 2026-01-03 16:00:54 -06:00
ingressroute.yaml Remove www subdomain from certificate and IngressRoute 2026-01-02 15:06:21 -06:00
kustomization.yaml add sendgrid 2026-01-03 15:26:48 -06:00
namespace.yaml Add Kubernetes deployment manifests for towerops.net 2026-01-02 14:38:52 -06:00
README.md add sendgrid 2026-01-03 15:26:48 -06:00
service-headless.yaml cluster 2026-01-02 15:29:02 -06:00
service.yaml Add Kubernetes deployment manifests for towerops.net 2026-01-02 14:38:52 -06:00

Kubernetes Deployment

Secrets Management

Secrets are stored in .envrc files (gitignored):

  • Project root .envrc - Used by direnv for local development
  • k8s/.envrc - Used by Kustomize for secret generation

Kustomize automatically generates the towerops-sendgrid Secret from k8s/.envrc using the secretGenerator in kustomization.yaml.

Both .envrc files should contain:

# SendGrid Configuration
SENDGRID_API_KEY=your-api-key-here
export SENDGRID_API_KEY

The KEY=VALUE format works for both Kustomize and direnv.

Deploying

Apply all resources using kustomize:

kubectl apply -k k8s/

Or individually:

kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/secret.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/service-headless.yaml
kubectl apply -f k8s/certificate.yaml
kubectl apply -f k8s/ingressroute.yaml