https://garden.io logo
#🌱|help-and-getting-started
What is the recommended way of enabling different build modes for different cases?
# 🌱|help-and-getting-started
s

silly-accountant-45583

08/11/2023, 11:17 AM
We have garden setup for local development purposes and we use cluster-buildkit mode for building docker images. But we want to configure kaniko build mode with the same Garden project for running Garden in CI/CD. Currently, I do not see any possibility to define both build modes in one project and choose one for either of cases. Is it even possible? If yes, how can I do it?
s

swift-garage-61180

08/11/2023, 11:59 AM
Hi @silly-accountant-45583! This is indeed possible—to do this, simply specify the
kubernetes
provider twice, and use it for different environments. Here's an example:
Copy code
providers:
  ...
  - name: kubernetes
    environments: [dev]
    ...
    buildMode: cluster-buildkit
  - name: kubernetes
    environments: [ci, preview, staging]
    ...
    buildMode: kaniko
Here, we're using
cluster-buildkit
for the
dev
environment, and
kaniko
for the
ci
,
preview
and
staging
environments (each of those would have been defined under
environments
in the project config). Does that answer your question?
s

silly-accountant-45583

08/12/2023, 12:30 PM
Ohhhh, this is indeed clean and convenient solution! Thank you so much for help 👍 I am glad I asked question here, otherwise I would come up with some crappy spaghetti workaround 😄 😆