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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS BYOK #312

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

AWS BYOK #312

wants to merge 5 commits into from

Conversation

davidspek
Copy link
Contributor

Summary

This PR expands the AWS provider so that it allows for people to bring existing cluster and use them with Plural. If a user wants to use an existing cluster they will be able to select a cluster from the region they have choses. Along with this, the max length for cluster names has been expanded to what the providers actually support and this is truncated for the bucket names.

Test Plan

Build CLI locally and test with new and existing clusters that are created by us as well as existing byok clusters.

Checklist

  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • I have added relevant labels to this PR to help with categorization for release notes.

Signed-off-by: David van der Spek <[email protected]>
@davidspek davidspek added the enhancement New feature or request label Jan 17, 2023
Signed-off-by: David van der Spek <[email protected]>
Signed-off-by: David van der Spek <[email protected]>
Signed-off-by: David van der Spek <[email protected]>
Signed-off-by: David van der Spek <[email protected]>
}

input := &eks.ListClustersInput{}
clusters, err3 := eksClient.ListClusters(ctx, input)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should factor this into a separate method probably to keep this one less sprawling

@@ -213,6 +271,16 @@ func (aws *AWSProvider) Context() map[string]interface{} {
return map[string]interface{}{}
}

func (aws *AWSProvider) Byok() map[string]interface{} {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason we can't just use the struct as the return val here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what I was trying to do first which also didn't need this function, but for some reason only the values were being returned during templating. But this is indeed something that I think should be cleaned up.

@@ -14,3 +14,13 @@ func Pluralize(one, many string, count int) string {
func ToString(val interface{}) string {
return fmt.Sprintf("%v", val)
}

func TruncString(s string, c int) string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be nice to move these to the polly lib at some point, but not crucial

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually wanting something more advanced than a simple truncate but couldn't find something better.

}

var createCluster bool
if err = survey.AskOne(&survey.Confirm{Message: "Do you want to create a new cluster?", Default: true}, &createCluster); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add to this note that if they don't create a cluster, they should only chose a newly created, fresh cluster

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add the note, but I'm not sure how strictly necessary this is since clashing applications can be disabled. I didn't add it in the artifact (yet), but I think the only one left is cert-manager. External DNS is limited to the subdomain set in the workspace so might not clash, but potentially could so we can add a way to disable that as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking more if you have the zalando postgres operator or nginx ingress controller already installed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same w/ cert manager tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants