Closed jwntrs closed 2 years ago
Sad paths for observedCompletion
on the ClusterDeploymentTemplate
:
apiVersion: carto.run/v1alpha1
kind: Deliverable
status:
conditions:
- type: ResourcesSubmitted
status: "False"
reason: "TemplateStampFailure"
message: "Resource 'deployer' cannot satisfy observedCompletion without observedGeneration in object status"
apiVersion: carto.run/v1alpha1
kind: Deliverable
status:
conditions:
- type: ResourcesSubmitted
status: Unknown
reason: ConditionNotMet
message: "Resource 'deployer' is waiting for the specified condition of observedCompletion."
spec:
observedCompletion: # uses observedGeneration
failed: {key: 'status.conditions.#(type=="ReconcileSucceeded").status', value: "False"}
Failure overrides success:
spec:
observedCompletion: # uses observedGeneration
succeeded: {key: 'status.conditions.#(type=="ReconcileSucceeded").status', value: "True"}
failed: {key: 'status.conditions.#(type=="ReconcileSucceeded").status', value: "True"}
This should fail.
When there is only a failed condition and it cannot be read, it is treated in the same manner as succeeded condition cannot be read. We are currently taking the position that it should not be possible to specify only a failing condition.
When there is a failed condition, we do not report that we could not read the condition or that it was not met.
Is it required to have observedCompletion or observedMatches? Can they coexist? (Is this an OR, NAND, or XOR relationship?)
This is a list. Given any match that is not fulfilled, observedMatches should be false.
Description of problem
As an operator, I want to be able to promote an environment after a deployment has succeeded. In order to do so, I need a way to indicate that my deployment has succeeded.
[config] ========> [kapp] =======> [promote]
Proposed solution
observedCompletion
andobservedMatches
in theClusterDeploymentTemplate
as per https://github.com/sclevine/cartographer/blob/patch-1/rfc/rfc-0013-delivery.mdClusterDeploymentTemplate
to be used as asource
to downstream resourcesExample
Fetches Kubernetes configuration from a git repository Deploys to a staging cluster using kapp controller Promotes to production via pull request if integration tests pass
Deliverable
ClusterDelivery
ClusterSourceTemplate
ClusterDeploymentTemplate
ClusterTemplate - Git Merge
PipelineRun - Tests