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

Implements provider fields for subnets, securitygroups, launchtemplate, and instanceprofile. #681

Merged
merged 4 commits into from
Sep 19, 2021

Conversation

ellistarn
Copy link
Contributor

1. Issue, if available:
#661

2. Description of changes:
Implements provider fields for subnets, securitygroups, launchtemplate, and instanceprofile.

Currently none of these are overridable at the pod level. This is done intentionally to maintain separation of concerns between cluster operators and application developers. This may change if we get feature requests for this in the future.

3. Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: link to issue
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@netlify
Copy link

netlify bot commented Sep 16, 2021

✔️ Deploy Preview for karpenter-docs-prod canceled.

🔨 Explore the source changes: 6064555

🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/61468105be7db1000890b55e

@bwagner5
Copy link
Contributor

I took a first pass on the WIP, looking good!

@ellistarn ellistarn force-pushed the ltsubnetsecgrp branch 5 times, most recently from 14a790d to c5db8d7 Compare September 17, 2021 22:46
@ellistarn ellistarn changed the title [wip] Ltsubnetsecgrp Implements provider fields for subnets, securitygroups, launchtemplate, and instanceprofile. Sep 17, 2021
Copy link
Contributor

@JacobGabrielson JacobGabrielson left a comment

Choose a reason for hiding this comment

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

Just some preliminary comments after about ~20% ... looking good overall so far.

charts/karpenter/templates/karpenter.sh_provisioners.yaml Outdated Show resolved Hide resolved
charts/karpenter/templates/karpenter.sh_provisioners.yaml Outdated Show resolved Hide resolved
pkg/apis/provisioning/v1alpha4/doc.go Outdated Show resolved Hide resolved
errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s not a valid URL", c.Endpoint), "endpoint"))
for _, restricted := range RestrictedLabels {
if strings.Contains(key, restricted) {
errs = errs.Also(apis.ErrInvalidKeyName(key, "labels"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if this error should be more descriptive? (Will it be obvious it's a restricted label?) Don't need to change, realize it was already like that.

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'm relying on the knative concept for invalid key name. This error message looks like invalid key name "kubernetes.io/arch": spec.labels. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

it would be nice if it said "restricted" but that can wait until later

if err != nil || !endpoint.IsAbs() || endpoint.Hostname() == "" {
errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s not a valid URL", c.Endpoint), "endpoint"))
for _, restricted := range RestrictedLabels {
if strings.Contains(key, restricted) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious what the intent is here? Just want to make sure we don't rather want something like startswith or something?

Copy link
Contributor Author

@ellistarn ellistarn Sep 18, 2021

Choose a reason for hiding this comment

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

Oh this is a really good catch! Moving to HasPrefix

Copy link
Contributor

@JacobGabrielson JacobGabrielson left a comment

Choose a reason for hiding this comment

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

Overall looks good, have some minor comments but in general the changes look pretty mechanical in nature.

pkg/cloudprovider/aws/apis/v1alpha1/doc.go Outdated Show resolved Hide resolved
pkg/cloudprovider/aws/instance.go Show resolved Hide resolved
pkg/cloudprovider/aws/instance.go Outdated Show resolved Hide resolved
pkg/cloudprovider/aws/securitygroups.go Outdated Show resolved Hide resolved
pkg/cloudprovider/aws/suite_test.go Show resolved Hide resolved
pkg/cloudprovider/types.go Show resolved Hide resolved
@ellistarn ellistarn force-pushed the ltsubnetsecgrp branch 3 times, most recently from f9175f6 to 40b2e82 Compare September 19, 2021 00:14
errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s not a valid URL", c.Endpoint), "endpoint"))
for _, restricted := range RestrictedLabels {
if strings.Contains(key, restricted) {
errs = errs.Also(apis.ErrInvalidKeyName(key, "labels"))
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be nice if it said "restricted" but that can wait until later

@ellistarn ellistarn merged commit 832f411 into aws:main Sep 19, 2021
@ellistarn ellistarn deleted the ltsubnetsecgrp branch September 19, 2021 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants