uselagoon / remote-controller

A group of controllers for handling Lagoon builds and tasks in Kubernetes or Openshift
5 stars 1 forks source link

Handle active/standby entirely in Lagoon #115

Closed shreddedbacon closed 1 year ago

shreddedbacon commented 2 years ago

It would be good to have one less external system to maintain. Initial thoughts are to deprecate dioscuri (https://github.com/amazeeio/dioscuri) and handle the full route handling inside of the task image

Initially it would be simply having the controller inspect the ingress migration payload to extract the source and destination namespaces and then add the source namespace lagoon-deployer service account to the destination namespace lagoon-deployer-admin rolebinding, this would grant permission to do the required changes in both namespaces, this could be handled here (https://github.com/uselagoon/remote-controller/blob/main/handlers/misctask_handler.go#L126)

All the existing code from dioscuri for handling the migrations can be bundled into the activestandby task image (https://github.com/uselagoon/lagoon/tree/main/taskimages/activestandby)

shreddedbacon commented 2 years ago

@tobybellwood I think after https://github.com/amazeeio/dioscuri/pull/20 is merged and released, that should be the last release of dioscuri.

We can move all the ingress migration logic out of dioscuri and into the taskimage and handle it entirely in Lagoon with a few modifications to the core task creation code (https://github.com/uselagoon/lagoon/blob/main/node-packages/commons/src/tasks.ts#L1147)