Skip to content

Switch the ticketing routes to CoreAPI

The cutover points the public ticketing addresses at the new stack. The addresses stay the same (etiket, tiketadmin and tiketapi.johor.gov.my); only the APISIX routes behind them change. The switch was made in ticket-iac commit 4656c2c.

Route Before After
ticket-api-route ticketing:8080 coreapi-service:3000
ticket-admin-route old ticket-admin spatio-service:3001, with / redirected to /spatio/
etiket ticket-cms-service:3000 unchanged

Before you start

  • The migration has run and is verified, and its open settings are filled in or accepted.
  • spatio runs prod-v0.0.2 or later (Release on the ticketing cluster).
  • A rollback deadline is agreed: rollback is clean only until CoreAPI takes its first real order.
  • Push access to ticket-iac, branch update_queue, and shell access to ticket-node-1.

Switch the routes

  1. Freeze the old system: no new orders or edits.
  2. Catch up the data on ticket-node-1, in ~/schema-dump:

    RESET=1 ./run-all.sh dry
    

    Read the plan, then run RESET=1 ./run-all.sh apply and type apply. 3. In ticket-iac, copy overlays/prod/ticket-cms/etiket-johor-apisixroute.yaml to etiket-johor-apisixroute.yaml.bak (kustomize ignores it) for rollback. 4. In etiket-johor-apisixroute.yaml: - Set the ticket-api-route backend to coreapi-service, port 3000. - Set the ticket-admin-route backend to spatio-service, port 3001. - Add a rule for / with priority 10 and the redirect plugin (uri: /spatio/, ret_code: 302). 5. Commit and push to update_queue. Argo CD syncs within a few minutes. 6. Check:

    curl -sI https://tiketadmin.johor.gov.my/
    

    Expected: HTTP/2 302 with location: /spatio/. The admin and the public site load and show the migrated data. If routes look wrong, restart the ingress controller (APISIX routes look wrong). 7. Tell users that everyone has to log in once more. Customers keep their passwords. 8. Turn off the old backend's schedulers.

Roll back

Only before CoreAPI has taken real orders:

  1. Restore etiket-johor-apisixroute.yaml from the .bak copy.
  2. Commit and push to update_queue, and let Argo CD sync.
  3. If you already turned off the old schedulers (step 8), turn them back on.
  4. Lift the freeze on the old system.

After the first real order, rolling back would lose it: fix forward instead.