Skip to content

Commit

Permalink
Share resource requirements for examples (#806)
Browse files Browse the repository at this point in the history
Resolves #240
  • Loading branch information
waciumawanjohi authored Apr 14, 2022
1 parent 6d592c8 commit 68823ff
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 21 deletions.
52 changes: 31 additions & 21 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
# Examples

These examples demonstrate how common patterns can be implemented in Cartographer.
Each example demonstrates increasing assurance steps along the
path to production. The suggested order is:
These examples demonstrate how common patterns can be implemented in Cartographer. Each example demonstrates increasing
assurance steps along the path to production. The suggested order is:

- [Supply Chain: Source => Image => App](basic-sc/README.md): demonstrates how
one can set up a `ClusterSupplyChain` that monitors source code updates, creates
a new image for each update and deploys that image as a running application
- [Supply Chain: Source => Image => App](basic-sc/README.md): demonstrates how one can set up a `ClusterSupplyChain`
that monitors source code updates, creates a new image for each update and deploys that image as a running application
in the cluster.
- [Runnable: Updating a Tekton Task without triggers](runnable-tekton/README.md):
demonstrates how Cartographer's `Runnable` wraps immutable objects to provide
updatable behavior. The example uses a Tekton Task that tests source code and
demonstrates how to create [TaskRuns](https://tekton.dev/docs/pipelines/taskruns/)
demonstrates how Cartographer's `Runnable` wraps immutable objects to provide updatable behavior. The example uses a
Tekton Task that tests source code and demonstrates how to
create [TaskRuns](https://tekton.dev/docs/pipelines/taskruns/)
with objects that don't require triggers or events.
- [Supply Chain: Source => Test => Image => App](testing-sc/README.md): expands upon
the example above by adding testing, assuring that only commits with passing tests
result in deployed apps.
- [Supply Chain: Source => Image => Git](gitwriter-sc/README.md): whereas the first
example deploys an app, this example takes the app configuration and writes it to git. This
configuration can then be read by a Delivery in another cluster. This allows all
build processes to be isolated in a cluster completely separate from the
production cluster exposed to customers and end users.
- [Delivery: Git => App](basic-delivery/README.md): this example picks up app
configuration that has been written to git (it is written to work with the gitwriter
example above). The configuration is then applied to the cluster. This minimizes
processes occuring in the production cluster exposed to customers and end users.
- [Supply Chain: Source => Test => Image => App](testing-sc/README.md): expands upon the example above by adding
testing, assuring that only commits with passing tests result in deployed apps.
- [Supply Chain: Source => Image => Git](gitwriter-sc/README.md): whereas the first example deploys an app, this example
takes the app configuration and writes it to git. This configuration can then be read by a Delivery in another
cluster. This allows all build processes to be isolated in a cluster completely separate from the production cluster
exposed to customers and end users.
- [Delivery: Git => App](basic-delivery/README.md): this example picks up app configuration that has been written to
git (it is written to work with the gitwriter example above). The configuration is then applied to the cluster. This
minimizes processes occuring in the production cluster exposed to customers and end users.

## Resource Requirements

### Usage

When the examples are run, they generally consume 4 cpu cores and 4 GiB of memory.

### Requests

The examples rely on a number of controllers being installed. These controllers create deployments which request
resources from the kubernetes cluster at rest. All told, the controllers request 1.7 cpu cores and 1.6 GiB of memory
"at rest".

When Cartographer runs these examples in testing, we
use [this overlay](../hack/overlays/remove-resource-requests-from-deployments.yaml) to remove these requests.
3 changes: 3 additions & 0 deletions examples/basic-delivery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ To install `cartographer`, refer to [README.md](../../README.md).
5. [tree](https://github.com/ahmetb/kubectl-tree#installation) and
[yq](https://github.com/kislyuk/yq#installation) for observing objects in the cluster and their fields.

### Resource Requirements
Read [here](../README.md#resource-requirements)

## Running the example in this directory

### Location of files
Expand Down
3 changes: 3 additions & 0 deletions examples/basic-sc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ supplychain, forms something powerful.

5. [Tree](https://github.com/ahmetb/kubectl-tree), a tool that we will use to observe the objects created.

### Resource Requirements
Read [here](../README.md#resource-requirements)

## Running the example in this directory

### Location of files
Expand Down
3 changes: 3 additions & 0 deletions examples/gitwriter-sc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ TEKTON_VERSION=0.30.0 kubectl apply -f https://storage.googleapis.com/tekton-rel
kapp deploy --yes -a tekton-git-cli -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-cli/0.2/git-cli.yaml
```

### Resource Requirements
Read [here](../README.md#resource-requirements)

## Running the example in this directory

### Location of files
Expand Down
3 changes: 3 additions & 0 deletions examples/runnable-tekton/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ kind create cluster --image kindest/node:v1.21.1
3. Install [Tekton](https://tekton.dev/docs/getting-started/#installation), which provides a
mechanism to create pipelines and tasks for application testing, scanning, etc.

### Resource Requirements
Read [here](../README.md#resource-requirements)

## Running the example in this directory

In order to demonstrate updatable testing, the example has a Tekton Task that will run `go test` on a
Expand Down
3 changes: 3 additions & 0 deletions examples/testing-sc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ objects would be set by the different personas in the system:

2. Install [Tekton](https://tekton.dev/docs/getting-started/#installation)

### Resource Requirements
Read [here](../README.md#resource-requirements)

## Running the example in this directory

### Location of files
Expand Down

0 comments on commit 68823ff

Please sign in to comment.