Commit graph

21 commits

Author SHA1 Message Date
FluxCD
15dd528e05 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771438486-46e01cd [skip ci] 2026-02-18 18:15:02 +00:00
46e01cdea1
Scale down to 1 replica until clustering is needed 2026-02-18 12:14:25 -06:00
FluxCD
75d1784a3b chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771438217-bd26556 [skip ci] 2026-02-18 18:12:01 +00:00
FluxCD
95c009db0d chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771437137-d886f5d [skip ci] 2026-02-18 17:53:42 +00:00
d886f5d987
Fix migration init container env vars and ConnectionMonitor crash
- Add missing env vars to migration init container (PHX_HOST, PORT,
  APRS_PORT, APRS_CALLSIGN, APRS_PASSCODE) so runtime.exs config
  provider doesn't fail due to Kubernetes service discovery injecting
  APRS_PORT as a full URL
- Guard ConnectionMonitor.accepting_connections?/0 with Process.whereis
  to avoid crashing when the GenServer isn't started (e.g. cluster
  enabled but no libcluster topologies configured)
2026-02-18 11:51:56 -06:00
FluxCD
e71034dd47 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771434255-a72d50c [skip ci] 2026-02-18 17:08:35 +00:00
FluxCD
f1b3a00882 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771433746-a0f72cf [skip ci] 2026-02-18 16:56:34 +00:00
FluxCD
06d09b590e chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771368069-24c01d0 [skip ci] 2026-02-18 16:56:17 +00:00
a0f72cfd43
Run database migrations as init container on each deploy
Adds an init container that runs `bin/migrate` before app pods start,
ensuring migrations are applied on every deployment. Uses the existing
advisory lock in MigrationLock so only one pod runs migrations during
a rolling update.
2026-02-18 10:55:25 -06:00
FluxCD
f1ce1b1e03 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1771368069-24c01d0 [skip ci] 2026-02-17 22:52:19 +00:00
a637b3b87c
Add k8s deployment manifests and FluxCD GitOps config
Kubernetes manifests for deploying to home cluster in the aprs
namespace with Forgejo Actions CI pipeline for building and
pushing container images to git.mcintire.me registry.
2026-02-17 16:11:27 -06:00
18b85ad512
cleanup 2025-07-30 14:35:11 -05:00
7e4bbbaff5
Fix deployment timestamp always showing 'less than a minute ago' in k8s
Previously, the deployment timestamp was set to DateTime.utc_now() when
the application started, which meant it would always show as recent in
k8s environments where pods are recreated on each deployment.

This commit:
- Updates Release.init() to check for DEPLOYED_AT environment variable
- Falls back to current time if env var is not set (backwards compatible)
- Adds proper ISO8601 timestamp parsing with error handling
- Updates GitHub Actions deploy workflow to set DEPLOYED_AT during deployment
- Creates k8s patch file for future manual deployments

The deployment timestamp will now persist across pod restarts in k8s,
showing the actual deployment time rather than pod startup time.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 12:06:12 -05:00
9189579a02
Implement distributed migration locking for cluster deployments
- Add MigrationLock module using PostgreSQL advisory locks
- Prevent concurrent migrations across multiple nodes
- Update Release.migrate to use distributed lock when cluster enabled
- Disable auto-migrations in cluster mode to avoid race conditions
- Add init container configuration for Kubernetes deployments
- Document migration strategies in k8s/README-migrations.md

This ensures only one node runs database migrations at a time, preventing
conflicts and race conditions in distributed deployments.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 10:41:36 -05:00
de74593d08
Remove hardcoded Redis configuration from config.exs
- Move Redis connection settings to runtime.exs only
- Remove localhost:6379 hardcoded values that were overriding runtime config
- Keep only non-environment-dependent Exq settings in compile-time config
- Fixes Exq trying to connect to localhost instead of Kubernetes Redis service

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 10:14:38 -05:00
f75b373dad
remove k8s 2025-07-24 19:52:36 -05:00
fe67866018
Update k3s deployment to use latest tag and correct registry
- Changed kubectl deployment command to use :latest tag
- Updated k8s deployment manifests to use ghcr.io/aprsme/aprs.me:latest
- This ensures k3s always pulls the most recent image from GitHub Container Registry

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 19:34:18 -05:00
ce7c50caa1
refactor to use external parser 2025-06-24 14:22:09 -05:00
308e216fe0 bump elixir ci version 2025-06-13 13:27:14 -05:00
4af05a6422 tweaks 2025-06-13 13:22:52 -05:00
google-labs-jules[bot]
1badb192b5 feat: Implement K3s deployment with GitHub Actions CI/CD
This commit introduces a complete setup for deploying the Phoenix application
to a K3s Kubernetes cluster, along with a GitHub Actions workflow for
automated builds and deployments.

Key changes include:

- **Kubernetes Manifests (`k8s/`)**:
    - Namespace (`aprs-app`) for isolating application resources.
    - PostgreSQL setup: PersistentVolumeClaim, Deployment, and Service.
    - Application setup: Deployment (with init container for migrations) and
      Service (NodePort).
    - An example secrets file (`k8s/secrets.yaml.example`) for configuration.
    - `.gitignore` updated to exclude `k8s/secrets.yaml`.

- **GitHub Actions Workflow (`.github/workflows/deploy-k3s.yaml`)**:
    - Builds the Docker image on pushes to the main branch.
    - Pushes the image to GitHub Container Registry (GHCR).
    - Deploys the application to K3s by applying the manifests.
    - Dynamically updates the application deployment with the correct image tag.
    - Requires `KUBE_CONFIG_DATA` GitHub secret for K3s authentication.

- **Application Configuration (`config/runtime.exs`)**:
    - Commented out `libcluster` configuration specific to Fly.io to prevent
      issues in a standard K3s environment.

- **Documentation (`README.md`)**:
    - Added a new "Kubernetes (K3s) Deployment" section detailing:
        - Prerequisites and initial setup (GitHub & K8s secrets).
        - Workflow overview.
        - Application configuration notes (health checks, migrations).
        - Instructions for accessing the application.

This setup provides a robust foundation for CI/CD and running the
application in a self-hosted K3s environment.
2025-06-13 18:18:34 +00:00