dvlpr
dvlpr

Reputation: 371

Trigger Kubernetes job from AWS Lambda

I need to trigger a Kubernetes job when an object is put into S3 bucket. We can configure S3 event notification to send events to AWS Lambda as soon as the object is put into S3. But how to get AWS Lambda to manually trigger a Kubernetes Job?

S3 --> AWS Lambda ---> Kubernetes Job

Upvotes: 3

Views: 4668

Answers (1)

Chris Williams
Chris Williams

Reputation: 35188

Amazon have actually built an example layer for being able to use the kubectl command within your Lambda.

To allow interaction between the Lambda and your Kubernetes cluster you will need to have your Lambda reside within the same VPC that your cluster sits in so that they can communicate.

To do do this configure the Lambda for VPC configuration, adding it to at least 2 private subnets. Finally ensure the security groups for your control plane allow interaction from the Lambda (either referencing the security group attached to it, or by whitelisting the subnet)

Upvotes: 3

Related Questions