What is the recommended way of enabling different ...
# 🌱|help-and-getting-started
s
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
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
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 😄 😆