You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by GregoireW October 5, 2023
In case we push multiple object in kubernetes to deploy one application it may be interesting to compute a status from all the object.
Example: your repository is a mono repo with a front app, an api, a worker. You deploy all of them when you put your application in production, you want to check all them to be deployed to declare a deployment succesful.
The CRD could be modified to something like this:
apiVersion: github.decathlon.com/v1beta1kind: GitHubDeploymentmetadata:
name: examplespec:
sourceRef:
apiVersion: apps/v1kind: Deploymentname: podinfo-primarynamespace: testadditionnalRef:
- apiVersion: apps/v1kind: Deploymentname: front-appnamespace: test
- apiVersion: apps/v1kind: Deploymentname: workernamespace: testextract: # Extract the ref on which to GitHub will create the deployment ( commit sha1, tag, etc... )containerName: podinfod # get the tag of the image of this container. If it is not set, a `jsonPath` option has to be given.# jsonPath: $.metadata.annotations.source-ref # a jsonPath to extract a value. Mandatory is `containerName` is not set regexp: main-.*-(.*) # optional. If present, extract a substring from the tag. Capture a single group (can be named "ref")# template: "{}" # optional. If present, use this template to build the GitHub ref from the extracted string. "{}" will be replaced by the extract string. # For instance if you capture "1.2.3", a template like 'tag-{}' will send to GitHub a ref "tag-123" repository:
name: my-repo # your repo name (no need to set the org/user, you can just set the repo name)environment: staging # the environment name. It can be anything like production, staging, ..
Extract / template to get the commit point in git would be extracted from the sourceRef object, but the overall status would be the minimum status from all the objects from additionalRef + sourceRef.
If one object is in error, the global status is in error
else if one object is in pending, the global status is pending
else if ALL object are current, the result is current.
The text was updated successfully, but these errors were encountered:
Extract / template to get the commit point in git would be extracted from the sourceRef object, but the overall status would be the minimum status from all the objects from additionalRef + sourceRef.
Extracting the git ref only from the sourceRef object can lead to the wrong status. If all objects do not have the same git ref, the status computed is not reliable.
If we have a sourceRef A and additionnalRef B and C with v1 git ref, compute status from all objects makes sense because they are with the same git ref.
But I see two other cases:
If only B git ref changes to v2, this will result to any update into github because sourceRef doesn't change.
If only A git ref changes to v2, this will result to an update into github with v2 ref, but status will be computed on A in v2, B and C are still in v1. This case doesn't mean that B and C will not be updated to v2 in near future. Flux can check the image registry when only one of the 3 images has its tag pushed. If B and C update to v2 after A is in its final state, their states in v2 will never be taken into account, and if one of them fail, the deployment will be success instead of failure in GitHub.
So I don't think this proposal can manage multi-object deployments properly at this stage.
Discussed in #3
Originally posted by GregoireW October 5, 2023
In case we push multiple object in kubernetes to deploy one application it may be interesting to compute a status from all the object.
Example: your repository is a mono repo with a front app, an api, a worker. You deploy all of them when you put your application in production, you want to check all them to be deployed to declare a deployment succesful.
The CRD could be modified to something like this:
Extract / template to get the commit point in git would be extracted from the
sourceRef
object, but the overall status would be the minimum status from all the objects from additionalRef + sourceRef.The text was updated successfully, but these errors were encountered: