Sequencing install operations

I could like to sequence install operations in the install hook such as

  1. Install localpath provisioner or OpenEBS (On this note, when is Gravity 7.x being released?)
  2. Install infrastructure components - databases, redis etc
  3. Install my application

Can we write these steps as install scripts and run them in sequence ? And abort if it fails an earlier step and have the capability to resume after manual fix ?

Thanks
Peter

Yes, the install hook is a regular kubernetes job and since install operation is already a state machine running the install hook is one of its steps. Although the plan for the install operation cannot be customized (i.e. you cannot add extra steps), it should be possible to implement the install hook as a series of steps with the semantics you want.

If the install hook step fails, the operation is effectively paused. Once the culprit has been fixed, it can be resumed.

You might want to configure various bits of the install hook job (i.e. job.spec.backoffLimit(defaults to 6) and/or job.spec.activeDeadlineSeconds (defaults to 20min) in align with your semantics).

One thing to watch out for is since the install script will be re-run from scratch every time the install step is retried, it will have to be implemented to be re-entrant - i.e. to be able to tolerate resource already existing etc.

I wrote an example script as a demo last year, that shows how to create the install hook job to run an arbitrary script: https://github.com/gravitational/quickstart/tree/master/examples/multi-helm-install

As long as the install script itself is re-entrant when re-created, the entire job can run and skip what’s already been completed (or just re-apply the resources unchanged). Resuming a failed install phase is part of the installer.

As Dmitry pointed out, the limitation is we don’t support subdividing the installation into multiple hooks or jobs, so that doesn’t allow for an individual portion of the job to be completed or not.