Localstack try to run Lambda function with ECR Image Pull from a Kubernetes Cluster


I’m trying to run a Lambda function inside a kubernetes cluster with LocalStack Pro installed. I have used helm to install en configure everything.

When I created the ECR repository with the awslocal cli tool and pushed my docker image into it I can create a lambda function.

But when I try to run the lambda function as a kubernetes pod the pod can’t pull the image from the ECR repo. I receive the error 1.localhost.localstack.cloud:4566/v2/repo1/manifests/latest": dial tcp connect: connection refused

I have already tried several things, but nothing solved the problem.
Can someone help me with this error?

Hi @DKuijs,

Would you be able to elaborate on what you’ve attempted?
Additionally, please provide an example of how you are operating LocalStack, the steps you use to upload an image, and the actions you take to create and invoke a Lambda function.

Please read through our documentation Kubernetes | Docs (localstack.cloud) and Configuration | Docs (localstack.cloud) for specific Kubernetes setup.

First of all, I receive the following error when trying to execute the lambda function as a kubernetes pod.

exception while calling lambda with unknown operation: Could not start new environment: Missing the required parameter namespace when calling `create_namespaced_pod

This is my pod.yaml

apiVersion: v1
kind: Pod
name: localstack
namespace: localstack

  • name: localstack-container
    image: localstack/localstack-pro
      value: EXAMPLE!!!
      value: kubernetes