clever-policeman-58407
12/06/2023, 7:55 PMCould not find secret 'ecr-config' in namespace 'default'. Have you correctly configured your secrets?
But querying directly shows it is present:
Ξ» k get secret/ecr-config -n default
NAME TYPE DATA AGE
ecr-config kubernetes.io/dockerconfigjson 1 19m
Is there some RBAC related issue here? Or is this a Garden bug?quaint-dress-831
12/07/2023, 11:43 AMeksctl
to test and can't reproduce. Are you able to create a new test cluster, create your registry credential secret with kubectl create secret docker-registry regcred --docker-server=$ECR_REGISTRY_SERVER --docker-username=AWS --docker-password=$ECR_PASSWORD
, and ensure your project.garden.yml
file looks similar to the below?
providers:
- name: kubernetes
environments: [remote]
context: tao@garden.io@fargate-cluster.eu-north-1.eksctl.io
ingressClass: "nginx"
buildMode: cluster-buildkit
clusterBuildkit:
rootless: true
imagePullSecrets:
- name: regcred
namespace: default
deploymentRegistry:
hostname: 000000000.dkr.ecr.eu-central-1.amazonaws.com
namespace: aws-repository-231954e9
namespace: ${environment.namespace}
clever-policeman-58407
12/07/2023, 4:53 PMclever-policeman-58407
12/07/2023, 4:54 PMclever-policeman-58407
12/07/2023, 11:01 PMfreezing-pharmacist-34446
12/08/2023, 8:33 AMclever-policeman-58407
12/08/2023, 5:56 PMproject.garden.yaml
config:
apiVersion: garden.io/v1
kind: Project
name: foobaz-cloud
defaultEnvironment: local
dotIgnoreFile: .gitignore
variables:
namespace: ${local.env.CLUSTER_NAMESPACE || kebabCase(local.username)}
environments:
- name: local
defaultNamespace: ${var.namespace}
variables:
base-hostname: localhost
deploy-target: local
- name: remote
defaultNamespace: ${var.namespace}
variables:
base-hostname: "${var.namespace}.foobaz.dev"
deploy-target: remote
providers:
- name: local-kubernetes
environments: [local]
namespace: ${environment.namespace}
defaultHostname: ${var.base-hostname}
context: k3d-foobaz
setupIngressController: nginx
deploymentRegistry:
hostname: k3d-foobazregistry
port: 12345
insecure: true
namespace: ${kebabCase(local.username)}
sync:
defaults:
exclude:
- "**/node_modules"
- "**/.next"
- name: kubernetes
environments: [remote]
ingressClass: nginx
buildMode: cluster-buildkit
clusterBuildkit:
rootless: true
imagePullSecrets:
- name: ecr-config
namespace: ${environment.namespace}
deploymentRegistry:
hostname: # < ... >.dkr.ecr.us-west-2.amazonaws.com
namespace: garden
namespace: ${environment.namespace}
defaultHostname: ${var.base-hostname}
context: # < ... >
- name: terraform
initRoot: ./terraform/environments/dev
autoApply: false
allowDestroy: false
clever-policeman-58407
12/08/2023, 5:57 PM{
"credHelpers": {
"< ... >.dkr.ecr.us-west-2.amazonaws.com": "ecr-login"
}
}
clever-policeman-58407
12/08/2023, 5:58 PMkubectl create secret generic ecr-config --from-file=.dockerconfigjson=registry-config.json --type=kubernetes.io/dockerconfigjson --namespace foobaz
clever-policeman-58407
12/08/2023, 5:59 PMdeploymentRegistry.namespace
are the same, as verifiable by kubectlclever-policeman-58407
12/08/2023, 6:12 PMβ build.ui β Failed resolving status for Build type=container name=ui (took 0.47 sec). This is what happened:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Could not find secret 'ecr-config' in namespace 'foobaz'. Have you correctly configured your secrets?
The full error message, from `-l5`:
Error: Could not find secret 'ecr-config' in namespace 'foobaz'. Have you correctly configured your secrets?
at readSecret (file:///Users/foobaz/Library/Application%20Support/io.garden.garden/1701117661-33XyWur.r/rollup/garden.mjs:747039:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///Users/foobaz/Library/Application%20Support/io.garden.garden/1701117661-33XyWur.r/rollup/kind-I-cxA2pC.mjs:1950:24
at async Promise.all (index 0)
at async buildDockerAuthConfig (file:///Users/foobaz/Library/Application%20Support/io.garden.garden/1701117661-33XyWur.r/rollup/kind-I-cxA2pC.mjs:1949:28)
at async prepareDockerAuth (file:///Users/foobaz/Library/Application%20Support/io.garden.garden/1701117661-33XyWur.r/rollup/kind-I-cxA2pC.mjs:2004:20)
at async ensureBuilderSecret (file:///Users/foobaz/Library/Application%20Support/io.garden.garden/1701117661-33XyWur.r/rollup/kubernetes-exec-pWB0gJIk.mjs:749:24)
at async file:///Users/foobaz/Library/Application%20Support/io.garden.garden/1701117661-33XyWur.r/rollup/kubernetes-exec-pWB0gJIk.mjs:1380:56
Error type: configuration
clever-policeman-58407
12/12/2023, 5:12 PMclever-policeman-58407
12/12/2023, 5:14 PMclever-policeman-58407
12/12/2023, 5:15 PM