Skip to content

Conversation

@khalid244
Copy link

Summary

Rewrites the .helm/ chart to fix all known Kubernetes deployment issues from #119. Tested and verified on a production cluster.

Fixes

  • Missing templates — adds Service, PVC, ServiceAccount, _helpers.tpl
  • Ingress YAML errorhost was a list instead of a scalar
  • APP_KEY generation — replaces non-standard encryptAES with randAlphaNum + b64enc
  • Bitnami MySQL dependency removed — built-in MySQL deployment (no external chart repos needed)
  • DB startup race condition — init container waits for MySQL before app starts
  • MySQL trigger migration failure — adds --log-bin-trust-function-creators=1
  • MySQL startup probe — uses TCP instead of socket-based (socket doesn't exist during init)
  • s6-overlay fixes — mounts /var/run, /tmp, framework/cache, framework/sessions as emptyDir
  • TimeoutS6_CMD_WAIT_FOR_SERVICES_MAXTIME=300000
  • TLS — cert-manager annotation support on ingress
  • Values restructured — Bitnami-style with @param annotations, global.storageClass, existingClaim support

Tested on

  • 3-node Hetzner cluster (MicroK8s, kubectl v1.32)
  • Longhorn StorageClass
  • nginx-ingress + cert-manager (Let's Encrypt)
  • All 144 migrations complete successfully
  • All s6 services healthy: nginx, octane, reverb, queue, supercronic
  • HTTP 200 on HTTPS endpoint

Migration notes

Two Cattr migrations have duplicate table/column creation that fail on fresh installs:

  1. 2020_07_21_095849_create_redmine_instances_table — table already created by 2020_06_01 migration
  2. 2023_03_09_224051_upgrade_laravel_sanctum_to_3_0expires_at column already exists

Workaround documented in the related issue #312.

Test plan

  • helm lint .helm/ passes
  • helm template .helm/ renders valid YAML
  • helm install on a fresh cluster deploys MySQL + Cattr
  • All s6 services start without errors
  • Migrations run to completion
  • App accessible via ingress

Resolves #119
Related: #312

- Add missing Service and PVC templates
- Fix ingress YAML syntax error (host was list instead of scalar)
- Replace non-standard encryptAES with randAlphaNum + b64enc for APP_KEY
- Replace Bitnami MySQL subchart with built-in MySQL deployment
- Add init container to wait for MySQL before starting app
- Add --log-bin-trust-function-creators=1 for trigger migrations
- Add TCP startup probe for MySQL (socket not available during init)
- Mount /var/run, /tmp, framework/cache, framework/sessions as emptyDir
- Set S6_CMD_WAIT_FOR_SERVICES_MAXTIME=300000
- Add TLS/cert-manager support to ingress
- Add ServiceAccount template
- Restructure values.yaml with Bitnami-style @param annotations
- Add global.storageClass and existingClaim support

Tested on 3-node Hetzner cluster with Longhorn storage,
nginx-ingress, and cert-manager. All 144 migrations run
successfully, all s6 services start cleanly.

Resolves cattr-app#119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Unable to run cattr on Kubernetes

1 participant