Skip to content

Commit

Permalink
docs: add more uses cases
Browse files Browse the repository at this point in the history
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
eysi09 committed Dec 20, 2023
1 parent f60cde7 commit bff9ea3
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 23 deletions.
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

## 🌳 Use Cases

* [Isolated On-Demand Preview Environments](./use-cases/on-demand-preview-envs.md)
* [Fast, Portable CI Pipelines that Run Anywhere](./use-cases/portable-ci-pipelines.md)
* [Shift Testing Left](./use-cases/shift-testing-left.md)
* [Local Development With Remote Clusters](./use-cases/local-development-remote-clusters.md)
* [Portable CI Pipelines that Run Anywhere](./use-cases/portable-ci-pipelines.md)
* [Jumpstart your Internal Developer Platform](./use-cases/jumpstart-idp.md)

## 🌻 Getting Started
Expand Down
2 changes: 1 addition & 1 deletion docs/use-cases/jumpstart-idp.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Jumpstart your Internal Developer Platform
order: 3
order: 5
---

## Why use Garden to build your Internal Developer Platform (IDP)?
Expand Down
54 changes: 34 additions & 20 deletions docs/use-cases/local-development-remote-clusters.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,50 @@
---
title: Local Development With Remote Clusters
order: 1
order: 4
---

## Why develop with remote clusters?

With other tools the complexity of replicating a production-like environment on your local machine is a developer experience that suffers from compromise. Setting up a remote Kubernetes cluster has meant a tangle of scripts, tools, and proxies that mock out the pains of running a remote cluster to make it feel like home.
Most teams using Garden use Kubernetes for production. This means they already have their Dockerfiles, manifests and/or Helm charts.

Garden's first-class support for remote clusters eliminates the setup cost of manually setting up remote image builders, developer namespaces, and hot reload with short stanzas of YAML you can reuse and share among teammates. Garden supports complex topologies across any number of local or remote Kubernetes clusters or environments.
Garden allows them to shift these resources left, without introducing friction or cognitive overload to developers, so that they can:

Garden creates a developer namespace inside a remote Kubernetes cluster that looks and feels just as if it was a local cluster. This means you can develop and test your applications in an environment that closely mimics your production environment, leading to fewer surprises when you deploy your application.
- Run their entire project in the cloud _as they develop_, irrespective of its size
- Share build caches with their team so that no two developers have to wait for the same build
- Easily write and maintain integration and end-to-end tests
- Developers barely need any dependencies on their local machines and new developers can be on-boarded in minutes
- Catch "production" bugs before they end up in production

**If you worry your laptop may catch fire next time you run docker compose up, remote environments might be for you.**

Check out [how Open Energy Market](https://garden.io/blog/kubernetes-automation) uses Garden to empower developers on K8s and reduce onboarding time by 500%(!).

## How does it work?

![Start dev console, deploy in sync mode, view progress in dashboard](https://github.com/garden-io/garden/assets/5373776/914a7695-6453-4b34-becf-eab387e478a0)

Developers start their day by running `garden dev` and deploy their project into an isolated namespace in the team's Kubernetes development cluster, re-using existing config and manifests but overwriting values as needed with Garden’s template syntax.

Teams then use Garden’s sync functionality to live reload changes into running Pods in the remote cluster, without needing a full re-build or re-deploy on every code change. There’s typically a trade of between how realistic your environment is and the speed of the feedback but with Garden you can get both.

## Key features

- **Visualize your dependency graph**, centralize logs, and view command history with the [Garden dashboard](https://app.garden.io)
- **Proxy local services** with [Local Mode](../guides/running-service-in-local-mode.md)
- **Visualize your dependency graph**, streams logs, and view 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
- **Hot reload** your code to containers running in your local and remote Kubernetes clusters for a smooth inner loop with [Code Synchronization](https://docs.garden.io/guides/code-synchronization).
- **Run tests as you develop**. Stop waiting for CI/CD to tell you what's broken: run your integration and end-to-end tests as you develop, at any time, with `garden test` or, if you're inside the Garden dashboard, with `test`.
- **Accelerate build times** with [remote image builds](../k8s-plugins/guides/in-cluster-building.md) to accelerate your image build times
- **Spin up powerful [ephemeral clusters](../k8s-plugins/ephemeral-k8s/configure-provider.md)** in seconds
- **Proxy local services** with [Local Mode](../guides/running-service-in-local-mode.md)

If you're already familiar with Garden and just want to get going, click any of the links above to set up your features.
## How can my team develop against remote clusters?

Navigate to [Examples](#examples) for a selection of pre-configured stacks you can use to quickly explore relevant features.
Teams typically [adopt Garden in a few phases](../overview/adopting-garden.md) and using remote clusters for inner loop development tends to be one of the last ones. Each phase solves a unique problem though so its well worth the journey.

## Resources
So with that in mind, here are the recommended next steps:

- Build inside a powerful Kubernetes cluster with [In-Cluster Building](../k8s-plugins/guides/in-cluster-building.md)
- Set up hot reloading for a frustration-free inner loop with [Code Synchronization](../guides/code-synchronization.md)
- If you're coming from Docker Compose, visit our [Migrating From Docker Compose](../guides/migrating-from-docker-compose.md) guide
- 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
- [Configure code syncing](../guides/code-synchronization.md) so you can live reload changes to the remote cluster

{% 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.
Expand All @@ -37,13 +53,11 @@ Join our [Discord community](https://go.garden.io/discord) 🌸 for access to Ga
## Further Reading

- [How Garden Works](../overview/how-garden-works.md)
- [Adopting Garden](../overview/adopting-garden.md)
- [Configuration Overview](../using-garden/configuration-overview.md)
- [Using the CLI](../using-garden/using-the-cli.md)
- [Variables and Templating](../using-garden/variables-and-templating.md)
- [Adopting Garden](../overview/adopting-garden.md)

## Examples

- [Code Synchronization example project](https://github.com/garden-io/garden/tree/0.13.22/examples/code-synchronization)
- [Simple demo project using Ephemeral Cluster](https://github.com/garden-io/garden/tree/0.13.22/examples/ephemeral-cluster-demo)
- [Local mode for kubernetes action type](https://github.com/garden-io/garden/tree/0.13.22/examples/local-mode-k8s)
- [Kubernetes Deploy action example project](https://github.com/garden-io/garden/tree/main/examples/k8s-deploy-patch-resources)
- [Local mode for `kubernetes` action type](https://github.com/garden-io/garden/tree/main/examples/local-mode-k8s)
61 changes: 61 additions & 0 deletions docs/use-cases/on-demand-preview-envs.md
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)
2 changes: 1 addition & 1 deletion docs/use-cases/portable-ci-pipelines.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Portable CI Pipelines that Run Anywhere
title: Fast, Portable CI Pipelines that Run Anywhere
order: 2
---

Expand Down
60 changes: 60 additions & 0 deletions docs/use-cases/shift-testing-left.md
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)

0 comments on commit bff9ea3

Please sign in to comment.