Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom fargate profile when creating an EKS cluster #984

Closed
dbouclier opened this issue Dec 6, 2023 · 2 comments
Closed
Assignees
Labels
kind/enhancement Improvements or new features resolution/no-repro This issue wasn't able to be reproduced

Comments

@dbouclier
Copy link

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

When creating an eks cluster with support for eks fargate, it's creating a fargate profile to the default namespace.

		eksCluster, err := eks.NewCluster(ctx, "MyCluster", &eks.ClusterArgs{
			Name:              "MyCluster",
			Fargate:            pulumi.Bool(true),
                       .....
               }

it's problematic when you need a custom fargate profile like that :


namespaceName := "customNamespace"

namespace, err := corev1.NewNamespace(ctx, namespaceName, &corev1.NamespaceArgs{
		Metadata: &metav1.ObjectMetaArgs{
			Name: pulumi.String("namespaceName"),
			Labels: pulumi.StringMap{
                                // custom pod labels for alb 
				"elbv2.k8s.aws/pod-readiness-gate-inject": pulumi.String("enabled"),
			},
		},
	}, pulumi.Provider(eksProvider))


customFargateProfile, err := fargate.NewFargateProfile(ctx, "MyCustomFargateProfile", &fargate.FargateProfileArgs{
		ClusterName:         eksCluster.EksCluster.Name(),
		FargateProfileName:  pulumi.String("MyCustomFargateProfile"),
		PodExecutionRoleArn: executionRole.Arn,  // custom execution role here
		SubnetIds:           subnets,   
		Selectors: fargate.FargateProfileSelectorArray{
                        // custom list of namespaces here
			&fargate.FargateProfileSelectorArgs{
				Namespace: pulumi.String("kube-system"),
			},
			&fargate.FargateProfileSelectorArgs{
				Namespace: pulumi.String("default"),
			},
			&fargate.FargateProfileSelectorArgs{
				Namespace: pulumi.String("newrelic"),
			},
			&fargate.FargateProfileSelectorArgs{
				Namespace: pulumi.String("amazon-cloudwatch"),
			},
			&fargate.FargateProfileSelectorArgs{
				Namespace: pulumi.String(namespaceName),
			},
		},
                // custom tags
		Tags: customTags,
	}, pulumi.Provider(eksProvider), pulumi.DependsOn([]pulumi.Resource{namespace}))

it's would be great to allow users to pass their custom fargate profile directly

		eksCluster, err := eks.NewCluster(ctx, "MyCluster", &eks.ClusterArgs{
			Name:              "MyCluster",
			Fargate:            pulumi.Bool(true),
                        FargateProfileArn:  customFargateProfile.Arn()
                       .....
               }

Or just a way to disable the creation of the default fargate profile

		eksCluster, err := eks.NewCluster(ctx, "MyCluster", &eks.ClusterArgs{
			Name:              "MyCluster",
			Fargate:            pulumi.Bool(true),
                        CreateFargateProfile: pulumi.Bool(false),
                       .....
               }
@dbouclier dbouclier added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Dec 6, 2023
@mjeffryes
Copy link
Contributor

Thanks for filing this issue @dbouclier; I'll add this to our backlog.

@mjeffryes mjeffryes removed the needs-triage Needs attention from the triage team label Dec 6, 2023
@flostadler flostadler added the resolution/no-repro This issue wasn't able to be reproduced label Jun 13, 2024
@flostadler
Copy link
Contributor

The cluster component supports providing a custom fargate profile: https://www.pulumi.com/registry/packages/eks/api-docs/cluster/#fargate_nodejs.

You can either pass a boolean - if it's true a default fargate profile will be created - or you pass a FargateProfile object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/no-repro This issue wasn't able to be reproduced
Projects
None yet
Development

No branches or pull requests

3 participants