Skip to content

Enhance deployment sidekiq - #3

Merged
mnfaizp merged 10 commits into
mainfrom
enhance/deployment-sidekiq
May 7, 2026
Merged

Enhance deployment sidekiq#3
mnfaizp merged 10 commits into
mainfrom
enhance/deployment-sidekiq

Conversation

@mnfaizp

@mnfaizp mnfaizp commented May 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Database migrations were running as an init container inside the main API deployment, which coupled migration execution to every pod replica startup. This caused issues when multiple replicas tried to run migrations simultaneously and blocked the main deployment rollout. Additionally, the Sidekiq deployment had incorrect health check paths (relative instead of absolute), was referencing the wrong image registry, and lacked proper startup/shutdown status signaling — causing readiness and liveness probes to fail.

Solution

  • Moved database migrations from an init container to a dedicated ephemeral kubectl run pod in the CI/CD pipeline. Migrations now run once before the deployment update, with proper success/failure handling and log output.
  • Updated the deploy pipeline to separately update the ai-interview-sidekiq deployment image and annotate it with the change cause, keeping Sidekiq rollouts in sync with the API.
  • Fixed Sidekiq health check paths from relative (tmp/sidekiq_status) to absolute (/ai-interview/tmp/sidekiq_status) so probes can locate the status file correctly.
  • Added startup and shutdown hooks in config/initializers/sidekiq.rb to write/delete the status file, enabling the liveness and readiness probes to work reliably.
  • Corrected the Sidekiq image registry path to point to the production registry (rakamin-poc instead of rakamin-staging).
  • Removed the non-root appuser from the Dockerfile to avoid permission issues when writing to the status file at runtime.
  • Removed the ai-interview-secret secret reference from the Sidekiq deployment (now sourced via configmap only).

mnfaizp and others added 9 commits May 6, 2026 14:14
- Move db:migrate from initContainer to a dedicated kubectl run pod in CI/CD
- Wire sidekiq deployment image update and annotation into deploy workflow
- Update sidekiq image registry from rakamin-staging to rakamin-poc
- Remove secretRef from sidekiq deployment (using configMap only)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mnfaizp mnfaizp self-assigned this May 6, 2026
@mnfaizp mnfaizp changed the title Enhance/deployment sidekiq Enhance deployment sidekiq May 7, 2026
@mnfaizp
mnfaizp merged commit aa218e9 into main May 7, 2026
3 checks passed
@mnfaizp
mnfaizp deleted the enhance/deployment-sidekiq branch May 7, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant