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
Copy file name to clipboardExpand all lines: docs/environment-api/introduction.md
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,25 +9,31 @@ The Red Hat product/project that this is attached to has had many names: AppStud
9
9
- For the purposes of this document, I will use 'Konflux', the latest name, as of this writing, February 2024.
10
10
- However, the code/API referenced in this document has been deprecated, will no longer be used, and will be removed from the Konflux project.
11
11
12
-
For more information on the Environment API, see this [long, detailed document I wrote](https://github.com/redhat-appstudio/managed-gitops/blob/main/docs/environment-api/environment-api-proposal-v3.md) which details the final cross-organization agreement on how this API would work within Konflux.
12
+
For more information on the Environment API, see the [detailed document I wrote](https://github.com/redhat-appstudio/managed-gitops/blob/main/docs/environment-api/environment-api-proposal-v3.md) which details the final cross-organization agreement on how this API would work within Konflux.
- You define an `Application`. (e.g. `bank-loan-app`)
17
18
- **NOTE**: ZERO relation to Argo CD's Application custom resource (CR)/concept, put this out of your mind here in this context. They just happen share a name 😀
18
19
- In this document, I'll use "Argo CD Application" when I specifically mean that.
19
20
- You define `Components`, which are the child components of that Application (e.g. `frontend` in Node, `backend` in Java, `database` in PSQL)
21
+
- A Component is a single version of a single container
20
22
- You define `Environment`s, which are the K8s clusters that you wish to deploy that Application to (only K8s clusters are supported)
21
23
- e.g. `test`, `staging`, `prod-eu`, `prod-us`
22
24
- A DAG, e.g. dev -> test -> staging -> prod. Can be single or multiple children (for example, see last deployment in this example.)
23
25
- 
24
-
26
+
- Automated/Manual promotion in this diagram refers to whether human intervention is required to promote from a parent Enviroment to a child Environment:
27
+
- Automated: Immediately promote to the next child on status of Healthy.
28
+
- Manual: Wait for a human to tell us to promote to the next child in the DAG.
25
29
- You define a `Snapshot`, which is a particular version of your Application (and specifically, of its constituent Components). (e.g. `bank-loan-app-v2-(commit id)`)
30
+
- Snapshot defines container image for each component.
26
31
- The actual deployment of a Snapshot (specific version of an Application) to an Environment (specific k8s cluster) is performed via a `SnapshotEnvironmentBinding`
- tuple: Application A, of version S, should be deployed to Environment E
29
-
- Finally, `SnapshotEnvironmentBinding` is translated (reconciled, via K8s controller) into 1 or more Argo CD Application
30
-
- Thus, all of these abstractions **ultimately boil down into Argo CD Application CRs** (custom resources) deploying to K8s clusters.
34
+
- Multiple SEBs can target a single environment
35
+
- Finally, `SnapshotEnvironmentBinding` is translated (reconciled, via K8s controller) into 1 or more Argo CD Applications
36
+
- Thus, all of these abstractions **ultimately boil down into 1 or more Argo CD Application CRs** (custom resources) deploying to K8s clusters.
31
37
32
38
33
39
@@ -92,13 +98,15 @@ All concepts mentioned have a corresponding CR of the same name. I use the two i
92
98
- A Snapshot is only useful in the context of the Application it references: a Snapshot is not shared between multiple Applications.
93
99
- A Snapshot is a set of container images, one for each component of an Application.
94
100
- If an Application has 3 components, the Snapshot will have 3 container images.
95
-
- Example Snapshot:
101
+
- Example Snapshot 'v2':
96
102
- Application: loan-app
97
-
- Component 'frontend': `quay.io/my-bank/loan-app-frontend:(version, git commit id, or date built, for example)`
103
+
- Component 'frontend': `quay.io/my-bank/loan-app-frontend:v2` (or tag could be, version, git commit id, or date built, for example)
98
104
- Component 'backend': `quay.io/my-bank/loan-app-backend:(version, git commit id or date built, for example)`
99
105
- Component 'database': `postgres:16.1`
100
106
- Snapshots can be annotated with additional information, for example, whether or not the Snapshot passed integration tests (thus making the Snapshot ready for promotion to next child in the DAG).
101
-
- This ensures a particular version of an Application has necessarily been tested with a particular set of constituent container images
107
+
- Why have the version be an independent concept from the Application/Component itself? Why not set the version in `.spec`` of Component?
108
+
- Well, Snapshot ensures a particular version of an Application has necessarily been tested with a particular set of constituent container images
109
+
- And thus, when deployed together as an Application, those specific Component versions have necessarily been tested together.
102
110
- Snapshots are not shared between different Applications. A Snapshot will have a single Application as a mandatory parent.
@@ -140,6 +148,7 @@ All concepts mentioned have a corresponding CR of the same name. I use the two i
140
148
#### PromotionRun
141
149
- A single use CR which will promote a particular Application/Snapshot to a particular Environment
142
150
- For example: I could use a `PromotionRun` to promote Snapshot 'loan-app-v2' from 'staging NA' to 'prod NA'
151
+
- This is the mechanism for manual promotion between Environments (versus 'automated promotion' which would trigger a new promotion once an Application between healthy in an Environment)
0 commit comments