fresh-yak-35965
01/10/2025, 1:41 PMmicroscopic-river-74022
01/10/2025, 1:41 PMmicroscopic-river-74022
01/10/2025, 1:41 PMutilImageRegistryDomain
field on the Kubernetes provider.
According to the [Using a Registry Mirror]() guide, you can configure Garden to use a custom registry mirror instead of Docker Hub. This is done by setting the utilImageRegistryDomain
field in your project configuration file. For example:
yaml
kind: Project
name: my-project
#...
providers:
- name: kubernetes
utilImageRegistryDomain: <https://<my-private-registry-domain>>
While this example shows how to set it in the configuration file, you can also override this setting from the command line. Garden allows you to override provider configuration using command-line flags.
To set a different registry as the target for build outputs, you would use a command similar to this:
garden --env=<environment> --var=kubernetes.utilImageRegistryDomain=<https://<my-private-registry-domain>>
This command-line approach allows you to temporarily override the registry without modifying your project configuration files, which can be useful for testing or one-off scenarios.
It's important to note that if you're using this in combination with in-cluster building, you need to ensure that your imagePullSecrets
includes authentication with the specified deployment registry, with appropriate write privileges.microscopic-river-74022
01/10/2025, 1:41 PMmicroscopic-river-74022
01/10/2025, 1:41 PMfresh-yak-35965
01/10/2025, 1:51 PMmicroscopic-river-74022
01/10/2025, 1:51 PMmicroscopic-river-74022
01/10/2025, 1:52 PM--var
flag to dynamically define a namespace name, but encountered the same issue you're describing - the values didn't change as expected.
The community acknowledged this as a bug, and it has been reported as a GitHub issue: [Issue #6528]().
As a temporary workaround, the community suggested using environment variables instead. For example:
yaml
variables:
source-branch: ${local.env.SOURCE_BRANCH_OVERRIDE || lower(slice(camelCase(git.branch), 0, 32))}
environments:
- name: preview
defaultNamespace: pr-${var.source-branch}
Then you could run a command like this:
SOURCE_BRANCH_OVERRIDE=2215 garden deploy --env preview
microscopic-river-74022
01/10/2025, 1:52 PMmicroscopic-river-74022
01/10/2025, 1:52 PM