LogoLogo
Bonsai (0.13) DocsGitHubDiscord CommunityGarden Enterprise
Edge Release
Edge Release
  • Welcome to Garden!
  • Overview
    • What is Garden
    • Use Cases
      • Isolated On-Demand Preview Environments
      • Fast, Portable CI Pipelines that Run Anywhere
      • Shift Testing Left
      • Local Development With Remote Clusters
      • Jumpstart your Internal Developer Platform
    • Garden vs Other Tools
  • Getting Started
    • Quickstart
    • Garden Basics
    • Next Steps
  • Tutorials
    • Your First Project
      • 1. Create a Garden Project
      • 2. Pick a Kubernetes Plugin
      • 3. Add Actions
      • 4. Add Tests
      • 5. Code Syncing (Hot Reload)
      • 6. Next Steps
    • Setting up a Kubernetes cluster
      • 1. Create a Cluster
        • AWS
        • GCP
        • Azure
      • 2. Configure Container Registry
        • AWS
        • GCP
        • Azure
        • Docker Hub
      • 3. Set Up Ingress, TLS and DNS
      • 4. Configure the Provider
  • Using Garden With
    • Containers
      • Using Remote Container Builder
      • Building Containers
    • Kubernetes
      • Using Remote Kubernetes
      • Using Local Kubernetes
      • Deploying K8s Resources
      • Installing Helm charts
      • Running Tests and Tasks
    • Terraform
      • Using Terraform
      • Applying Terrform Stacks
    • Pulumi
      • Using Pulumi
      • Applying Pulumi Stacks
    • Local Scripts
  • Features
    • Remote Container Builder
    • Team Caching
    • Variables and Templating
    • Config Templates
    • Workflows
    • Code Synchronization
    • Custom Commands
    • Remote Sources
  • Guides
    • Connecting a Project
    • Environments and Namespaces
    • Installing Garden
    • Including/Excluding files
    • Installing Local Kubernetes
    • Migrating from Docker Compose to Garden
    • Using the CLI
    • Using Garden in CircleCI
    • Minimal RBAC Configuration for Development Clusters
    • Deploying to Production
    • Using a Registry Mirror
  • Reference
    • Providers
      • container
      • exec
      • jib
      • kubernetes
      • local-kubernetes
      • otel-collector
      • pulumi
      • terraform
    • Action Types
      • Build
        • container Build
        • exec Build
        • jib-container Build
      • Deploy
        • container Deploy
        • exec Deploy
        • helm Deploy
        • kubernetes Deploy
        • pulumi Deploy
        • terraform Deploy
      • Run
        • container Run
        • exec Run
        • helm-pod Run
        • kubernetes-exec Run
        • kubernetes-pod Run
      • Test
        • container Test
        • exec Test
        • helm-pod Test
        • kubernetes-exec Test
        • kubernetes-pod Test
    • Template Strings
      • Project template context
      • Environment template context
      • Provider template context
      • Action (all fields) template context
      • Action spec template context
      • Module template context
      • Remote Source template context
      • Project Output template context
      • Custom Command template context
      • Workflow template context
      • Template Helper Functions
    • Commands
    • Project Configuration
    • ConfigTemplate Reference
    • RenderTemplate Reference
    • Workflow Configuration
    • Garden Containers on Docker Hub
    • Glossary
    • Module Template Configuration
    • Module Types
      • container
      • exec
      • helm
      • jib-container
      • kubernetes
      • pulumi
      • templated
      • terraform
  • Misc
    • FAQ
    • Troubleshooting
    • Telemetry
    • How Organizations Adopt Garden
    • New Garden Cloud Version
    • Migrating to Cedar
    • Migrating to Bonsai
    • Ingress NGINX Vulnerability
    • Deprecations
  • Contributing to Garden
    • Contributor Covenant Code of Conduct
    • Contributing to the Docs
    • Setting up Your Developer Environment
    • Developing Garden
    • Config Resolution
    • Graph Execution
Powered by GitBook
On this page
  • Step 1 — Clone the example application
  • Step 2 — Create a project
  • Step 3 – Enable Remote Container Builder (optional)

Was this helpful?

  1. Tutorials
  2. Your First Project

1. Create a Garden Project

PreviousYour First ProjectNext2. Pick a Kubernetes Plugin

Last updated 11 days ago

Was this helpful?

The first thing we'll do is create a Garden project. Remember that you need to have the to follow along.

Step 1 — Clone the example application

Start by cloning the example repo and checkout to the tutorial-start branch:

git clone https://github.com/garden-io/web-app-example.git
cd web-app-example
git checkout tutorial-start

The example is a three-tier web app with web, API, and database components. Garden is typically used in projects with multiple microservices but we're keeping things simple here to make it easy to follow along.

Step 2 — Create a project

Next, we'll create a project config file in the root of the example with:

garden create project --name web-app-example

This will create a basic boilerplate project configuration in the current directory, making it our project root. It will look something like this:

apiVersion: garden.io/v2
kind: Project
name: web-app-example

defaultEnvironment: local

environments:
  - name: local
    defaultNamespace: web-app-example
    variables:
      hostname:
        "local.demo.garden"
  - name: remote-dev
    defaultNamespace: web-app-example-${kebabCase(local.username)}
  - name: ci
    defaultNamespace: web-app-example-${git.branch}-${git.commitHash}
  - name: preview
    defaultNamespace: web-app-example-${git.branch}

providers:
  - name: local-kubernetes
    environments: [local]
  - name: kubernetes
    environments: [remote-dev, ci, preview]

We have four environments (local, remote-dev, ci, and preview) and also two provider configurations (local-kubernetes and kubernetes).

Step 3 – Enable Remote Container Builder (optional)

We highly recommend using our Remote Container Builder which can significantly speed up container builds for your Garden projects.

To enable it, update your provider configuration like so:

# In project.garden.yml
providers:
  - name: container # <--- Add this!
    gardenContainerBuilder:
      enabled: true
  - name: local-kubernetes
    environments: [local]
  - name: kubernetes
    environments: [remote-dev, ci, testing]
Garden CLI installed