[Question] Is there a way to use a aws cloud provider and hook that up to localstack #1012
-
Hello, I am running Localstack and I would like my k3d cluster to create nodes, load balancers, etc. in my "local" aws which implements the APIs to create EC2 instances, Load balancers etc. Currently, using Localstack, I am able to create a EKS cluster using the same Terraform I use to create my production EKS instance. This actually launches a k3d cluster (details here). However, some of the terraform just does not work, like creating installing the aws-load-balancer-controller because I think it cannot connect with aws. I believe this is usually handled by using a cloud provider such as the aws one. Is there a way to setup a K3d cluster with a aws cloud provider? And then I could configure it to connect to my local aws environment setup by Localstack. I am very new to K8s so sorry if this is a very naive question. Thank you for your consideration. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @munali , thanks for starting this discussion! FWIW: I don't know if that will give you what you want to achieve there, as I'd expect Localstack to work purely offline and thus not require an AWS connection, right? 🤷♂️ BTW: I didn't know about Localstack yet and especially that it uses k3d.. that's pretty cool :) |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response @iwilltry42 I will try it out. Regarding the AWS connection, I somehow have to setup the "node" in k3d to hit the localstack endpoint-url (http://localhost:4566) when talking to AWS...I think. Hopefully I can configure this somehow. |
Beta Was this translation helpful? Give feedback.
Hi @munali , thanks for starting this discussion!
k3d uses K3s under the hood which strips out in-tree cloud providers (and other stuff) to trim down on size.
It looks like the AWS Cloud Provider is also moving out-of-tree and you should be able to install it in a k3d/K3s cluster as per https://cloud-provider-aws.sigs.k8s.io/getting_started/
For k3d, use the
--k3s-arg
flag to pass in the required api-server, etc. flags.FWIW: I don't know if that will give you what you want to achieve there, as I'd expect Localstack to work purely offline and thus not require an AWS connection, right? 🤷♂️
BTW: I didn't know about Localstack yet and especially that it uses k3d.. that's pretty cool :)