-
Notifications
You must be signed in to change notification settings - Fork 5
Added EnableIPTargetType feature gate to controller #9
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
Added EnableIPTargetType feature gate to controller #9
Conversation
403bdb1
to
53d630b
Compare
/assign @alebedev87 |
/retest |
pkg/config/feature_gates.go
Outdated
@@ -14,6 +14,7 @@ const ( | |||
WeightedTargetGroups Feature = "WeightedTargetGroups" | |||
ServiceTypeLoadBalancerOnly Feature = "ServiceTypeLoadBalancerOnly" | |||
EndpointsFailOpen Feature = "EndpointsFailOpen" | |||
DisableAWSVpcCNI Feature = "DisableAWSVpcCNI" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it sound a little misleading? Like if ALBC would have a power to disable the CNI.
Also, it mentions the CNI plugin name, I didn't see any other CNI plugins which would have the directly accessible POD IPs but maybe there are some in the wild (or will come).
How about EnableIPTargetType
similar the service controller feature gate from another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the name sounds misleading. Basically, we wanted to introduce a flag that toggles all features dependent on AWS VPC CNI, currently it's just ip
target-type. How about AWSVpcCNIAvailable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think EnableIPTargetType
is a more appropriate name. That fact that it is dependent on the VPC CNI being available is an internal detail.
pkg/ingress/model_builder.go
Outdated
@@ -40,7 +40,8 @@ func NewDefaultModelBuilder(k8sClient client.Client, eventRecorder record.EventR | |||
authConfigBuilder AuthConfigBuilder, enhancedBackendBuilder EnhancedBackendBuilder, | |||
trackingProvider tracking.Provider, elbv2TaggingManager elbv2deploy.TaggingManager, | |||
vpcID string, clusterName string, defaultTags map[string]string, externalManagedTags []string, defaultSSLPolicy string, | |||
backendSGProvider networkingpkg.BackendSGProvider, enableBackendSG bool, disableRestrictedSGRules bool, logger logr.Logger) *defaultModelBuilder { | |||
backendSGProvider networkingpkg.BackendSGProvider, enableBackendSG bool, disableRestrictedSGRules bool, disableAWSVpcCNIflag bool, | |||
logger logr.Logger) *defaultModelBuilder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the change in the ingress group reconcile which is supposed to pass the boolean from the feature gate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, had missed that commit.
@@ -214,6 +214,9 @@ func (t *defaultModelBuildTask) buildTargetGroupTargetType(_ context.Context, sv | |||
case string(elbv2model.TargetTypeInstance): | |||
return elbv2model.TargetTypeInstance, nil | |||
case string(elbv2model.TargetTypeIP): | |||
if t.disableAWSVpcCNIFlag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the feature gate is only applicable for Ingresses? The service type can also have IP target type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a miss from my side, fixed it.
9aa7f82
to
8cfec35
Compare
8c03fb8
to
8038108
Compare
pkg/ingress/model_builder_test.go
Outdated
}, | ||
}, | ||
}, | ||
wantErr: errors.New("ingress: ns-1/ing-1: unsupported targetType: ip when enableIPTargetType is false"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wantErr: errors.New("ingress: ns-1/ing-1: unsupported targetType: ip when enableIPTargetType is false"), | |
wantErr: errors.New("ingress: ns-1/ing-1: unsupported targetType: ip when EnableIPTargetType is false"), |
@@ -339,6 +339,9 @@ func (t *defaultModelBuildTask) buildTargetType(_ context.Context, port corev1.S | |||
var lbTargetType string | |||
lbTargetType = string(t.defaultTargetType) | |||
_ = t.annotationParser.ParseStringAnnotation(annotations.SvcLBSuffixTargetType, &lbTargetType, t.service.Annotations) | |||
if lbTargetType == LoadBalancerTargetTypeIP && !t.enableIPTargetType { | |||
return "", errors.Errorf("unsupported targetType: %v when enableIPTargetType is %v", lbTargetType, t.enableIPTargetType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "", errors.Errorf("unsupported targetType: %v when enableIPTargetType is %v", lbTargetType, t.enableIPTargetType) | |
return "", errors.Errorf("unsupported targetType: %v when EnableIPTargetType is %v", lbTargetType, t.enableIPTargetType) |
review changes and tests Signed-off-by: thejasn <[email protected]>
8038108
to
be3bcd3
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alebedev87, thejasn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/label docs-approved |
@thejasn: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Signed-off-by: thejasn [email protected]
Issue
Fixes: kubernetes-sigs#2559
Description
Added a controller flag to toggle AWS VPC CNI dependent features. Currently, can be used to enforce the correct
target-type
annotation onIngress
type resources.-->
Checklist
README.md
, or thedocs
directory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯