From shared hosting to Kubernetes: how we moved CrossPost in one afternoon

Title card reading From shared hosting to Kubernetes: how CrossPost moved

In early October we moved CrossPost from a shared cPanel server to our Kubernetes platform. This is the story of that afternoon: what we built, what broke, and the three lessons we would hand to anyone doing the same.

Why move at all

The old home worked, but it had grown awkward. Websocket connections for live updates failed behind the shared web server. The command-line PHP was a different version from the one serving requests. Image conversion for HEIC uploads was impossible because the host could not load the required extension. Every configuration value, including the keys that protect the credentials of your connected social accounts, lived in one plain text file. None of this was an outage, but all of it was friction, and friction compounds.

We already run a production Kubernetes cluster on Talos Linux in Germany on Hetzner infrastructure, with the pieces a SaaS needs around it: managed databases through KubeBlocks, secrets through Infisical, object storage through MinIO, ingress through the Cilium Gateway API and certificates from cert-manager. Moving CrossPost onto that platform meant one place to operate, one way to back up, and one way to upgrade.

Diagram of the CrossPost production setup: clients reach a Cilium Gateway, which routes to the application pod running nginx, PHP-FPM, Reverb and Horizon; the pod talks to MySQL and Redis managed by KubeBlocks and to MinIO object storage; Infisical supplies secrets and Flux applies manifests
The shape of CrossPost after the move. One namespace, one application pod, managed data services around it.

What we built

  • The application runs from the vendor’s official container image, pinned by digest. Upgrades become a digest bump and a rolling restart, and database migrations run on boot. The image bundles the web server, PHP, the Reverb websocket server, the Horizon queue workers and the scheduler.
  • MySQL 8 and Redis 7 are KubeBlocks clusters. MySQL runs two replicas with semi-synchronous replication, scheduled backups and point-in-time recovery. Redis handles cache, queues and broadcasting.
  • Secrets live in Infisical and are synced into the namespace by its operator. Nothing sensitive is in Git or in a config map. The application key that encrypts your stored social credentials was carried over byte for byte, because a new key would have silently invalidated every connected account.
  • Media moved to a bucket on the cluster’s MinIO: 17,020 objects, just over one gigabyte, mirrored in under a minute and verified count for count against the source.
  • Ingress and TLS come from a shared Cilium Gateway with a dedicated HTTPS listener and a Let’s Encrypt certificate that was issued about two and a half minutes after DNS pointed at the new home.
  • Network policies allow the application to reach only DNS, its database, its cache, object storage and the public internet over HTTPS. Everything else is denied.

How the day went

We refused to do this as a single shot. The plan was a full rehearsal first: stand up the data plane, import a copy of the production database, deploy the application, point a test hostname at it and click through everything. The rehearsal took under an hour and found five defects, none of which we wanted to meet during a maintenance window. A missing network rule produced a 503 at the gateway. The health probe spoke HTTPS to a plain HTTP port. The certificate script expected a file name the old host did not use. All small, all fixed before anyone noticed.

The cutover itself was short. We put the old installation into maintenance mode, took a final database dump and streamed it straight into the new cluster, synced the last application files, restarted the pod and changed DNS. From maintenance mode to the first healthy public login page took eleven minutes. The old installation stayed untouched as a rollback path, which is the only reason an eleven minute window felt comfortable.

Most of the work, as always, was in the plumbing around the application rather than the application itself. The migration day involved several hundred individual commands and checks across the old host and the new cluster, executed by an AI engineering agent with one of our engineers reviewing every step and making the decisions that mattered: which database operator, whether to rehearse, when to flip DNS, and when a shortcut was not acceptable.

Three things that bit us

1. One path prefix, three owners

On the old host the dashboard lived under /app, and the web server sent everything to PHP. In the container image the bundled web server reserves /app as a prefix for the websocket server. The result was a dashboard that answered with the wrong service. We moved the dashboard to the root of the domain, which is why your login page now sits at the top level.

That fixed logins but hid a worse problem. Every social network, inbox and payment provider calls back to CrossPost on a URL under that same prefix, and those URLs are registered on other companies’ servers. They cannot move. For about fifty minutes after the DNS change those callbacks were reaching the websocket server instead of PHP. We caught it in the final verification pass, patched the web server configuration so that only the exact websocket path is proxied and everything else under the prefix falls through to PHP, and confirmed each callback type by hand.

Lesson: before a cutover, compare the application’s route table with the web server configuration, and test a callback URL, not only the login page.

2. The websocket that was never broken

Our first websocket check through the new gateway returned a 500. We spent a while on it before noticing that the test client had negotiated HTTP/2, which does not carry the upgrade header a websocket handshake needs. Forcing HTTP/1.1 produced a clean 101 switch, which is what browsers do anyway. Live updates had been working for users the whole time.

Lesson: test websockets with explicit HTTP/1.1, and write the conclusion down the moment you reach it. We found this one twice.

3. DNS is the least cloud-like step

The zone for the domain turned out to be served by one DNS daemon reading zone files owned by another control panel. The usual tooling refused to edit it. In the end the change was a zone file edit, a serial bump and a cluster sync, which worked but was not the plan. The record also had a four hour time to live that nobody had lowered in advance.

Lesson: find out who really owns your zone days before the window, lower the TTL early, and write the runbook before you need it.

What it means for you

  • Live updates in the dashboard now work reliably over websockets.
  • HEIC photos from iPhones are converted on upload.
  • The database has replicated storage, scheduled backups and point-in-time recovery.
  • Your login page moved from /app to the root of the domain. If you bookmarked the old address, update it to https://smm.uhl.agency/login.
  • Nothing changed about who can see your data. CrossPost is hosted in Germany on Hetzner infrastructure and operated from Switzerland. If your organisation needs its data in a specific country, we offer on-demand concierge deployments wherever we have customers.

If you are planning a similar move for your own Laravel application, the short version is: rehearse on real data, carry your encryption key, treat callback URLs as immovable, and test the boring paths. The glamorous parts of the platform were the easy ones.

Next step: see the features this platform now powers, check the plans, or log in and try the dashboard.


Previous post

Sign up today

Start managing your social media with ease and simplicity.

Leave behind overpriced products and embrace the only application you need to manage your online social presence. Questions? Call us on +41 44 500 10 12.