Runtime Extensions are defined by three interfaces: Fetch, Apply, GetInfo. These interfaces tell Prodvana how to interact with your infrastructure and execute as run-to-completion jobs on another Runtime, such as Kubernetes (support for AWS Lambda and GCP Cloud Functions coming soon).
|Fetch||Optional||Detect whether there is any work to get a service to its desired state. Exit 0 if there is no work to be done, 2 if there is work to be done.|
If there is work, Apply will execute. Fetch can also define the exact work to be done that will be passed to Apply (e.g. a Terraform plan).
If defined, Prodvana will automatically detect drift for your service by running Fetch periodically. When Fetch returns that there is work to be done, Apply will run (subject to approvals as configured).
If not defined, Apply will always execute once.
|Apply||Required||Make changes to the underlying infrastructure to get a service to its desired state.|
|GetInfo||Optional||Freeform, auxiliary output that should be displayed on the Prodvana UI to explain the current state of the service.|
GetInfo has no impact on the convergence status of the service nor on how the other interfaces (Fetch, Apply) are executed.
Let's walk through a couple of examples of how Runtime Extensions may be used to manage arbitrary, non-Kubernetes services on Prodvana.
Goal: Manage executions of a Terraform module on Prodvana. Detect drift.
This command checks if there is any drift between the Terraform module and the physical infrastructure.
Note that the builtin Terraform Runner Runtime does quite a bit more to handle lock and retries, as well as save the Terraform plan to be used on Apply.
This command makes any changes necessary to bring the physical infrastructure to what the Terraform module defines.
Goal: Copy static assets to a GCS bucket.
This command copies files locally to a GCS bucket.
|GetInfo||Return the GCP console link to the file being deployed so the developer can quickly inspect it.|
Goal: Run a Google Cloud Build that will handle the deployment logic.
For a full end-to-end example, see here.
This command starts a new Google Cloud Build. The Apply command can additionally be made to wait for the build to complete and stream logs (see full example above).
Updated 24 days ago