Skip to content

Commit 4a3a1bf

Browse files
committed
Additional updates to Environment API intro doc
1 parent 5e90b7f commit 4a3a1bf

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docs/environment-api/introduction.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ The Red Hat product/project that this is attached to has had many names: AppStud
99
- For the purposes of this document, I will use 'Konflux', the latest name, as of this writing, February 2024.
1010
- However, the code/API referenced in this document has been deprecated, will no longer be used, and will be removed from the Konflux project.
1111

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.
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. (Be forewarned, parts of that document are very Konflux-jargon heavy.)
1313

1414
## Big Picture
15+
16+
Within Konflux project, the need was identified to define a set of custom resources/concepts, that would allow users to progressively build/test/deploy different versions of their Applications across a set of Kubernetes Environments, with the deployment handled by Argo CD.
17+
18+
Here's what those requirements became:
1519
- Konflux concepts (and K8s custom resources): `Application`, `Component`, `Environment`, `Snapshot`, `SnapshotEnvironmentBinding`
1620

1721
- You define an `Application`. (e.g. `bank-loan-app`)
@@ -67,7 +71,7 @@ All concepts mentioned have a corresponding CR (Kubernetes custom resource) of t
6771
- Example: a bank might have a 'loan-app' Application, whose job is to provide bank loans. The Components of that Application might be:
6872
- Application 'loan-app'
6973
- Component 'frontend': React frontend, served into the browser via a lightweight HTTP server
70-
- Component 'backend': Java backend application
74+
- Component 'backend': Java-based backend application, containing business logic
7175
- Component 'database': Postgresql image
7276
- Application and Component are both CRs.
7377
- [Component CR code](https://github.com/redhat-appstudio/application-api/blob/18f545e48a03cbc6df71fb0468dac9aa66209c4c/api/v1alpha1/component_types.go#L75)
@@ -89,7 +93,7 @@ All concepts mentioned have a corresponding CR of the same name. I use the two i
8993
- Once it passes some integration tests, Snapshot 'v2' would be promoted to run on Environment 'test NA'
9094
- Next, once successful, v2 would be promoted to 'staging NA' Environment.
9195
- And so on, dev -> test -> staging, along the DAG.
92-
- [API description](https://github.com/redhat-appstudio/managed-gitops/blob/main/docs/api.md#environment)
96+
- [API example/description](https://github.com/redhat-appstudio/managed-gitops/blob/main/docs/api.md#environment)
9397
- [Environment CR code](https://github.com/redhat-appstudio/application-api/blob/18f545e48a03cbc6df71fb0468dac9aa66209c4c/api/v1alpha1/environment_types.go#L24)
9498

9599
#### Snapshot
@@ -101,14 +105,15 @@ All concepts mentioned have a corresponding CR of the same name. I use the two i
101105
- Example Snapshot 'v2':
102106
- Application: loan-app
103107
- Component 'frontend': `quay.io/my-bank/loan-app-frontend:v2` (or tag could be, version, git commit id, or date built, for example)
104-
- Component 'backend': `quay.io/my-bank/loan-app-backend:(version, git commit id or date built, for example)`
108+
- Component 'backend': `quay.io/my-bank/loan-app-backend:v4`
105109
- Component 'database': `postgres:16.1`
106110
- 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).
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
111+
- You might be thinking: Why have the version be an independent concept from the Application/Component itself? Why not jjust set the version in `.spec` of Component?
112+
- Well, the `Snapshot` concept ensures a specific set of constituent container images have necessarily been tested together
113+
- You want to avoid the case where, for example, you deploy a version of your Application where the backend is incompatible with a newer version of the database software, because they were not tested together.
109114
- And thus, when deployed together as an Application, those specific Component versions have necessarily been tested together.
110115
- Snapshots are not shared between different Applications. A Snapshot will have a single Application as a mandatory parent.
111-
- [API description](https://github.com/redhat-appstudio/managed-gitops/blob/main/docs/api.md#snapshot)
116+
- [API example/description](https://github.com/redhat-appstudio/managed-gitops/blob/main/docs/api.md#snapshot)
112117
- [Snapshot CR code](https://github.com/redhat-appstudio/application-api/blob/18f545e48a03cbc6df71fb0468dac9aa66209c4c/api/v1alpha1/snapshot_types.go#L25)
113118

114119
#### SnapshotEnvironmentBinding
@@ -141,15 +146,15 @@ All concepts mentioned have a corresponding CR of the same name. I use the two i
141146
- Argo CD Application 'loan-app-prod-frontend': deploy v1 of 'frontend' component to prod
142147
- Argo CD Application 'loan-app-prod-backend': deploy v1 of 'backend' component to prod
143148
- Argo CD Application 'loan-app-prod-database': deploy v1 of 'database' component to prod
144-
- [API description](https://github.com/redhat-appstudio/managed-gitops/blob/main/docs/api.md#snapshotenvironmentbinding)
149+
- [API example/description](https://github.com/redhat-appstudio/managed-gitops/blob/main/docs/api.md#snapshotenvironmentbinding)
145150
- [SnapshotEnvironmentBinding CR code](https://github.com/redhat-appstudio/application-api/blob/18f545e48a03cbc6df71fb0468dac9aa66209c4c/api/v1alpha1/snapshotenvironmentbinding_types.go#L33)
146151

147152

148153
#### PromotionRun
149154
- A single use CR which will promote a particular Application/Snapshot to a particular Environment
150155
- For example: I could use a `PromotionRun` to promote Snapshot 'loan-app-v2' from 'staging NA' to 'prod NA'
151156
- 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)
152-
- [API description](https://github.com/redhat-appstudio/application-api/blob/18f545e48a03cbc6df71fb0468dac9aa66209c4c/api/v1alpha1/promotionrun_types.go#L24)
157+
- [API example/description](https://github.com/redhat-appstudio/application-api/blob/18f545e48a03cbc6df71fb0468dac9aa66209c4c/api/v1alpha1/promotionrun_types.go#L24)
153158
- [PromotionRun CR code](https://github.com/redhat-appstudio/application-api/blob/18f545e48a03cbc6df71fb0468dac9aa66209c4c/api/v1alpha1/promotionrun_types.go#L24)
154159

155160
## Similarity to others: Kargo

0 commit comments

Comments
 (0)