I'm deploying Azure K8s cluster with Terraform, and the image is hosted in Amazon ECR. The deployment fails at the image pull from the ECR with the following error:
Failed to pull image "tooot.eu-west-1.amazonaws.com/app-t:latest": rpc error: code = Unknown desc = Error response from daemon: Get https://tooot.eu-west-1.amazonaws.com/v2/app-t/manifests/latest: no basic auth credentials
the following is my kuberentes resource in the terraform template
metadata {
name = "terraform-app-deployment-example"
labels {
test = "app-deployment"
}
}
spec {
replicas = 6
selector {
match_labels {
test = "app-deployment"
}
}
template {
metadata {
labels {
test = "app-deployment"
}
}
spec {
container {
image = "toot.eu-west-1.amazonaws.com/app-t:latest"
name = "app"
}
}
}
}
}`