Race Condition Issue: Assign Order of Execution to Certain Components. #5820
Labels
needs-kind
Indicates a PR lacks a `kind/foo` label and requires one.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
Summary
There are occations where the order of deployment of components (of kind such as Job, CloudFunctionsFunction, etc.) matters. Find a way to indicate in the
kustomize.yaml
file in which order certain components should be deployed.Description
Lets assume you're trying to deploy a Cloud Function using the CRD
CloudFunctionsFunction
of apiVersioncloudfunctions.cnrm.cloud.google.com/v1beta1
.This component requires that either:
Regredably, the repository where the code resides isn't accessable by
CloudFunctionsFunctions
; therefore, you can only follow the "Zip file" approach. This increases the complexity because we want to have everything in one place.We tried a solution by:
ConfigMap
of apiVersionv1
Job
of apiVersionbatch/v1
to (1) copy the code inside a zip file and (2) save the zip file into a storage bucket.CloudFunctionFunction
uses the zip file from the storage bucketThe Problem
The problem is the order of execution. Kustomize sometimes deployes the
CloudFunctionsFunctions
prior theJob
zippnig and storing the code from theConfigMap
. TheCloudFunctionsFunction
will deploy "succesfully" but fail to run due the ZIP file been missing, then it doesn't try again to get it. This is a race condition issue.Proposed Solutions
The following are some solutions to this issue:
dependsOn
.job.yaml: Order: "1"
Definition of Done
Provide a mechanism that allows to indicate the order of deployment of all or certain components. Ensuring that some components will be deployed prior to other components.
The text was updated successfully, but these errors were encountered: