https://pulumi.com logo
#typescript
Title
# typescript
t

thankful-optician-22583

08/05/2019, 4:21 PM
Hi if anyone does have insight on how to pass in aws credentials to a ‘’'@pulumi/kubernetes’‘' object, please help. I have succesfully uploaded an image to ecr using ‘’'pulumi/docker.Images’’'
Copy code
const image = new docker.Image(applicationName, {
    imageName: config.require("ecr-server"),
    build: "./app",
    registry: {
        server: config.require("ecr-server"),
        username: config.require("ecr-username"),
        password: config.require("ecr-password")
    }
});
But when I want to use it for deployment of Kubernetes I notice there is a
Copy code
ImagePullBackOff
error.
Copy code
const deployment = new k8s.apps.v1.Deployment(applicationName, {
    apiVersion: "apps/v1",
    kind: "Deployment",
            metadata: {
            name: applicationName
        },
    spec: {
        selector: { matchLabels: appLabels },
        template: {
            metadata: { labels: appLabels },
            spec: {
                containers: [
                    {
                        name: applicationName,
                        image: image.imageName
                    }
                ]
            }
        }
    }
});
When I investigated further using
Copy code
kubectl describe po
I see this error
Copy code
Failed to pull image "IMAGE": rpc error: code = Unknown desc = Error response from daemon: Get https//IMAGE: no basic auth credentials
How do i pass in the aws credentials to the “pulumi/kubernetes” object so that the deployment has access to the ecr?
@handsome-actor-1155 I wanted to ask you how did you manage to pass in the aws credentials to the Deployment class for kubernetes. Somewhat like the
Copy code
registry
for the Deployment class
h

handsome-actor-1155

08/05/2019, 5:18 PM
@thankful-optician-22583 I did not pass the credentials explicitly. I believe your issue may be that your k8s cluster is not authorized to pull from ECR as verification usually happens at the cluster level.
👍 1
t

thankful-optician-22583

08/05/2019, 5:20 PM
Alright. Thank you. I appreciate your help. I will investigate further. @handsome-actor-1155
👍 1