aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

(aws-eks): Apply folder k8s resources to existing cluster

Open shrivastavshubham34 opened this issue 5 years ago • 7 comments

It would be neat if we could add a folder filled with k8s resources to eks cluster.

kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller//crds?ref=master"

Use Case

I'm trying to add an ALB ingress controller to the EKS cluster. But right now cannot do that through CDK. I need to add custom resource definitions present online. Source: AWS_EKS_INGRESS_GUIDE

kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller//crds?ref=master"

Proposed Solution

I'm not sure how to proceed with this. Adding constructor props to select folder mode to KubernetesManifest class and similarly adding a prop to addManifest() function of @aws-cdk/aws-eks.Cluster class


This is a :rocket: Feature Request

shrivastavshubham34 avatar Nov 29 '20 04:11 shrivastavshubham34

@shrivastavshubham34 Just to make sure I understand, you are looking to apply a remote directory located in a GitHub repo correct? Not a local one that is present on your machine.

iliapolo avatar Nov 29 '20 11:11 iliapolo

Either way is fine.

shrivastavshubham34 avatar Nov 30 '20 22:11 shrivastavshubham34

Hi, do we have an ETA? If not I can switch to EKSCTL for the time being

shrivastavshubham34 avatar Dec 10 '20 04:12 shrivastavshubham34

@shrivastavshubham34 This is not currently planned so I cannot provide an ETA. Would you be interested in submitting a PR?

iliapolo avatar Dec 12 '20 20:12 iliapolo

KubernetesManifests are executed via a CustomResource defined here. That uses kubectl-handler and more specifically kubectl apply.

It seems it always expects a json manifest_text, which it then writes to a file and uses kubectl -f file to execute.
That means kubectl -k commands are not currently supported so we cannot install CRDs like instructed in some AWS docs e.g. https://github.com/aws/eks-charts/tree/master/stable/aws-load-balancer-controller https://github.com/aws/eks-charts/tree/master/stable/appmesh-controller

andcea avatar May 01 '22 21:05 andcea

Surprised its not implemented in kubectl-handler by default, whats the constraint?

zululee avatar Jun 23 '22 20:06 zululee

I believe it's still possible to be implemented with kubectl-handler.

pahud avatar Jan 25 '23 21:01 pahud