LogoLogo
Bonsai (0.13) DocsGitHubDiscord CommunityGarden Enterprise
Acorn (0.12)
Acorn (0.12)
  • Welcome!
  • 🌳Basics
    • How Garden Works
    • Quickstart Guide
    • The Stack Graph (Terminology)
  • 🌻Tutorials
    • Your First Project
      • 1. Initialize a Project
      • 2. Connect to a Cluster
      • 3. Deploy and Test
      • 4. Configure Your Project
  • 💐Using Garden
    • Configuration Overview
    • Projects
    • Modules
    • Services
    • Tests
    • Tasks
    • Workflows
    • Variables and templating
    • Module Templates
    • Using the CLI
  • 🌿Kubernetes Plugins
    • About
    • Remote K8s Plugin Configuration
      • 1. Create a Cluster
        • AWS
        • GCP
        • Azure
      • 2. Configure Container Registry (Optional)
        • AWS
        • GCP
        • Azure
      • 3. Set Up Ingress, TLS and DNS
      • 4. Configure the Provider
    • Local K8s Plugin Configuration
      • 1. Install Local Kubernetes
      • 2. Configure the Provider
    • Module Configuration
      • Container
      • Kubernetes
      • Helm
      • PersistentVolumeClaim
      • ConfigMap
    • Advanced
      • In-Cluster Building
      • Minimal RBAC Configuration for Development Clusters
      • Deploying to Production
  • 🌺Terraform Plugin
    • About
    • Provider Configuration
    • Module Configuration
  • ☘️Pulumi Plugin
    • About
    • Provider Configuration
    • Module Configuration
  • 🌹Other Plugins
    • Container
    • Exec (local scripts)
  • 🌼Guides
    • Installing Garden
    • Adopting Garden
    • Code Synchronization (Dev Mode)
    • Connecting a local service to a K8s cluster (Local Mode)
    • Environments and namespaces
    • Hot Reload
    • Migrating from Docker Compose to Garden
    • Using Garden in CI
  • 🌷Advanced
    • cert-manager Integration
    • Using Remote Sources
    • Custom Commands
  • 🪷Reference
    • Providers
      • conftest-container
      • conftest-kubernetes
      • conftest
      • container
      • exec
      • hadolint
      • jib
      • kubernetes
      • local-kubernetes
      • maven-container
      • octant
      • openfaas
      • pulumi
      • terraform
    • Module Types
      • configmap
      • conftest
      • container
      • exec
      • hadolint
      • helm
      • jib-container
      • kubernetes
      • maven-container
      • openfaas
      • persistentvolumeclaim
      • pulumi
      • templated
      • terraform
    • Template Strings
      • Project configuration context
      • Environment configuration context
      • Provider configuration context
      • Module configuration context
      • Remote Source configuration context
      • Project Output configuration context
      • Custom Command configuration context
      • Workflow configuration context
      • Template Helper Functions
    • Glossary
    • Commands
    • Project Configuration
    • Module Template Configuration
    • Workflow Configuration
  • 🎋Misc
    • FAQ
    • Troubleshooting
    • Telemetry
Powered by GitBook
On this page
  • 1. Add initial config
  • 2. Select build mode
  • 3. Initialize the plugin

Was this helpful?

  1. Kubernetes Plugins
  2. Remote K8s Plugin Configuration

4. Configure the Provider

Previous3. Set Up Ingress, TLS and DNSNextLocal K8s Plugin Configuration

Last updated 1 year ago

Was this helpful?

Once you've completed steps 1-3 on the previous pages you should have all the values at hand to configure Garden's Kubernetes plugin.

In particular, you should have:

  • The context for your Kubernetes cluster ().

  • The name(s) and namespace(s) of the ImagePullSecret(s) used by your cluster ().

  • The hostname for your services ().

  • A TLS secret (optional) ().

Now we can finally add them to our Garden config.

1. Add initial config

First, add your values to the project level Garden configuration file at the root of your project:

kind: Project

environments:
  - name: remote
    variables:
      hostname: <THE HOSTNAME FROM STEP 3>

providers:
  - name: kubernetes
    environments: [remote]
    imagePullSecrets: # You can set multiple secrets here
      - name: <THE IMAGE PULL SECRET FROM STEP 2>
        namespace: <THE IMAGE PULL SECRET NAMESPACE FROM STEP 2>
    deploymentRegistry:
      hostname: <THE REGISTRY HOSTNAME CONFIGURED IN STEP 2>
      namespace: <THE REGISTRY NAMESPACE CONFIGURED IN STEP 2>
    context: <THE KUBE CONTEXT FROM STEP 1>
    defaultHostname: <THE HOSTNAME FROM STEP 3>

2. Select build mode

Next, select a "build mode".

You can choose between building your images locally with Docker using the local-docker build mode or remotely, in the cluster itself.

Note that even if you choose the local-docker build mode, you still need to configure a container registry that Garden can push to and set an ImagePullSecret so that Kubernetes can pull your images.

In general, we recommend doing remote building with the cluster-buildkit build mode.

This means you don't need Docker running on your laptop and you're able to share build caches with your team and across environments.

To use the cluster-buildkit build mode, add the following to your configuration:

providers:
  - name: kubernetes
    buildMode: "cluster-buildkit" # <--- Add this
    # ...

3. Initialize the plugin

Finally, initialize the plugin by running:

garden plugins kubernetes cluster-init

And that's it! Your Kubernetes plugin is now configured and you can proceed to deploying your project to Kubernetes with Garden.

We also recommend taking a look at our which explains the pros and cons of different modes and how to configure them.

Next we recommend learning more about configuring .

🌿
see step 1
see step 2
see step 3
see step 3
in-depth guide on build modes
Kubernetes modules