-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a follow up to the work we started of splitting up the previous 'Use Cases' page into several top level pages. This adds the remaining use cases and tweaks the format a bit.
- Loading branch information
Showing
6 changed files
with
160 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: Isolated On-Demand Preview Environments | ||
order: 1 | ||
--- | ||
|
||
## Why isolated on-demand preview environments? | ||
|
||
Most teams using Garden use Kubernetes for production. This means they already have their Dockerfiles, manifests and/or Helm charts. | ||
|
||
Garden allows them to re-use these resources to create isolated preview environments on-demand so that they can: | ||
|
||
- Review changes for every pull request in a production-like environment | ||
- Easily share work in progress, even before pushing their code | ||
- Test out their changes as they develop | ||
|
||
**If your staging environment is a bottleneck where changes get queued up, isolated preview environments might be the solution.** | ||
|
||
Check out [how Slite](https://garden.io/blog/garden-is-the-best-companion-for-a-kubernetes-dev-from-local-envs-to-cd) uses Garden to clear the congestion from their staging environment. | ||
|
||
## How does it work? | ||
|
||
![Deploy project, deploy again in preview env](https://github.com/garden-io/garden/assets/5373776/bdac24a9-4e77-47f4-87dd-c68730fb601a) | ||
|
||
Developers run the `garden deploy` command from their laptops to create a preview environment in their own namespace in the team's remote Kubernetes cluster. | ||
|
||
Similarly, Garden can be run from CI pipelines to create isolated preview environments with each pull request, using e.g. the pull request number to isolate the environment. For example, you may have a CI job that runs `garden deploy --env preview`. | ||
|
||
Garden's powerful templating engine allows teams to easily ensure that namespaces and hostnames are unique across users and CI runs—and Garden's smart caching ensures creating these environments is blazing fast. | ||
|
||
## Key features | ||
|
||
- **View URLs**, logs, and command history with the [Garden dashboard](https://app.garden.io) | ||
- **Accelerate build times** with [remote image builds](../k8s-plugins/guides/in-cluster-building.md) and smart caching | ||
- **Isolate environments** with [Garden's template syntax](../using-garden/variables-and-templating.md) | ||
|
||
## How can my team get on-demand preview environments? | ||
|
||
Teams typically [adopt Garden in a few phases](../overview/adopting-garden.md) and setting up on-demand preview environments tends to be the first one. | ||
|
||
So with that in mind, these are the recommended next steps: | ||
|
||
- Go through our [Quickstart guide](../getting-started/quickstart.md) | ||
- Check out the [First Project tutorial](../tutorials/README.md) and/or [accompanying video](https://youtu.be/0y5E8K-8kr4) | ||
- [Set up your remote cluster](../k8s-plugins/remote-k8s/README.md) | ||
- [Add actions](../k8s-plugins/actions/README.md) to build and deploy your project | ||
- Follow our guide on [environments and namespaces](../guides/namespaces.md) to ensure each preview environment is isolated | ||
|
||
{% hint style="info" %} | ||
Join our [Discord community](https://go.garden.io/discord) 🌸 for access to Garden's dedicated Community Engineers and our AI chatbot 🤖 trained on our docs. | ||
{% endhint %} | ||
|
||
## Further Reading | ||
|
||
- [How Garden Works](../overview/how-garden-works.md) | ||
- [Adopting Garden](../overview/adopting-garden.md) | ||
- [Configuration Overview](../using-garden/configuration-overview.md) | ||
- [Variables and Templating](../using-garden/variables-and-templating.md) | ||
|
||
## Examples | ||
|
||
- [Kubernetes Deploy action example project](https://github.com/garden-io/garden/tree/main/examples/k8s-deploy-patch-resources) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
title: Shift Testing Left | ||
order: 3 | ||
--- | ||
|
||
## Why shift testing left? | ||
|
||
Most teams using Garden use Kubernetes for production. This means they already have their Dockerfiles, manifests and/or Helm charts. | ||
|
||
Garden allows them to re-use these resources so that developers can test in remote production-like environments _as they code_. This means: | ||
|
||
- No more waiting for CI to see if integration tests pass | ||
- Run and debug any test suite from your laptop _as you code_ | ||
- Easily write and maintain load tests, integration, and end-to-end tests with fast feedback loops | ||
- Speed up your delivery cycle by shifting DAST and similar testing methodologies left | ||
|
||
**If your team is stuck in a commit, push, pray cycle, shifting tests all the way left can help break it.** | ||
|
||
Check out [how Podium](https://garden.io/blog/testing-microservices) uses Garden end-to-end test 130 services, hundreds of times per day. | ||
|
||
## How does it work? | ||
|
||
![Run a test that passes, run it again and see that it's cached](https://github.com/garden-io/garden/assets/5373776/978db934-6728-430d-aa24-56b1b5b6fd4a) | ||
|
||
Testing is a first class primitive in Garden and teams use the Test action to define the tests for their project. These tests are typically run as a Kubernetes Pod in a production-like environment but there are several different options, depending on how the project is set up. | ||
|
||
Developers use the `garden test` command to run all or specific tests from their laptop in a remote Kubernetes cluster as they code. They can also enable live code syncing to ensure a blazing feedback loop as they iterate on tests. | ||
|
||
Similarly, tests can be run from a CI pipelines using the same commands. | ||
|
||
Garden's smart caching ensures that only the tests belonging to the parts of your system that changed are executed which can dramatically speed up your pipelines. | ||
|
||
## Key features | ||
|
||
- **Visualize your dependency graph**, streams logs, and view command history with the [Garden dashboard](https://app.garden.io) | ||
- **Hot reload** your changes for a fast feedback loop while writing and debugging tests with [Code Synchronization](https://docs.garden.io/guides/code-synchronization) | ||
- **Never run the same test twice** thanks to Garden's [smart caching](../overview/how-garden-works.md#caching) | ||
|
||
## How can my team shift testing left? | ||
|
||
Teams typically [adopt Garden in a few phases](../overview/adopting-garden.md) and shifting tests left is one of the main milestones. | ||
|
||
So with that in mind, these are the recommended next steps: | ||
|
||
- Go through our [Quickstart guide](../getting-started/quickstart.md) | ||
- Check out the [First Project tutorial](../tutorials/README.md) and/or [accompanying video](https://youtu.be/0y5E8K-8kr4) | ||
- [Set up your remote cluster](../k8s-plugins/remote-k8s/README.md) | ||
- [Add actions](../k8s-plugins/actions/README.md) to build, deploy, _and test_ your project | ||
|
||
{% hint style="info" %} | ||
Join our [Discord community](https://go.garden.io/discord) 🌸 for access to Garden's dedicated Community Engineers and our AI chatbot 🤖 trained on our docs. | ||
{% endhint %} | ||
|
||
## Further Reading | ||
|
||
- [How Garden Works](../overview/how-garden-works.md) | ||
- [Adopting Garden](../overview/adopting-garden.md) | ||
- [Configuration Overview](../using-garden/configuration-overview.md) | ||
- [Variables and Templating](../using-garden/variables-and-templating.md) | ||
|