Use Plug.Telemetry's dynamic log level feature to disable logging for /health requests. This is the proper Phoenix way to exclude specific endpoints from request logs. - Add log_level/1 function to endpoint that returns false for /health - Configure Plug.Telemetry to use dynamic log level - Remove log: false from router (handled by endpoint now) This prevents Kubernetes health probe spam in application logs. |
||
|---|---|---|
| .. | ||
| certificate.yaml | ||
| deployment.yaml | ||
| Dockerfile | ||
| ingressroute.yaml | ||
| kustomization.yaml | ||
| namespace.yaml | ||
| README.md | ||
| service-headless.yaml | ||
| service.yaml | ||
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