-
Notifications
You must be signed in to change notification settings - Fork 515
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
operator/ingress: Add load balancer type #312
operator/ingress: Add load balancer type #312
Conversation
b2df9d2
to
3acb36d
Compare
operator/v1/types_ingress.go
Outdated
type LoadBalancerStrategy struct { | ||
// type indicates the type of load balancer. Possible values are | ||
// "External" and "Internal". The default is "External". | ||
Type LoadBalancerType `json:"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.
I'm trying to think of any other possible future types which might be in conflict with this. For example, is there some other "type" of load balancer that must also be internal? If so, would that indicate type is too broad a term? Compared to say, "scope" or "visibility"?
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.
We went with a string type instead of a Boolean value because we don't know what possible future types there may be. GCP uses the annotation cloud.google.com/load-balancer-type=Internal
, AWS uses service.beta.kubernetes.io/aws-load-balancer-internal=0.0.0.0/0
, and the other clouds use variations on somethingsomething-internal-somethingsomething=true
.
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 was probably unclear. I wasn't suggesting a boolean type for Type
, I was wondering if Type
should be Scope
or Visibility
or something to that effect.
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.
For compatibiliy with https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190325-unions.md, you need structs for each discriminator value:
Type LoadBalancerType `json:"type"`
External *External `json:"external,omitempty"`
Internal *Internal `json:"internal,omitempty"`
I don't think discriminator only (or partial sub-structs) will work.
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.
Is Internal/External a type of LoadBalancerStrategy as opposed to (for example) a property of or a policy applied to a LoadBalancerStrategy? Seems to me more property-like (hence Scope or Visibility as alternatives to Type).
I don't know that we actually need a union type here. If not, my only proposed change is: type LoadBalancerStrategy struct {
// scope indicates the visibility scope of the load balancer. Possible values are
// "External" and "Internal". The default is "External".
Scope LoadBalancerScope `json:"scope"`
} The PR currently proposes "Type" instead of "Scope", which 1. by the existing naming conventions seems to imply a union type (which this PR does not propose), and 2. by extension of the union type implication, implies a taxonomy of kinds of load balancers rather than one of many properties of load balancers (I currently think the latter is more accurate). I hope I described that in a way that makes sense... |
3acb36d
to
87bd24e
Compare
Latest push makes the following changes:
|
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.
87bd24e
to
26ab74e
Compare
/hold |
/hold cancel |
26ab74e
to
b8110ef
Compare
Rebased. |
b8110ef
to
1401d95
Compare
Latest push marks union fields with |
/lgtm |
// scope indicates the scope at which the load balancer is exposed. | ||
// Possible values are "External" and "Internal". The default is | ||
// "External". | ||
Scope LoadBalancerScope `json:"scope"` |
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.
An empty config should work. I think this needs to be tagged optional
Just the comment about the optionalness of a field. lgtm otherwise. |
Add fields to ingress controllers' endpoint publishing strategy to allow specifying parameters for each strategy. Define a "scope" parameter for the LoadBalancerStrategy strategy to allow choosing between an internal or an external load balancer. This commit resolves NE-186. https://jira.coreos.com/browse/NE-186 * operator/v1/types_ingress.go (LoadBalancerScope): New type. (InternalLoadBalancer, ExternalLoadBalancer): New values. (LoadBalancerStrategy): New type for load balancer parameters. Define the "scope" parameter. (HostNetworkStrategy, PrivateStrategyType): New types. Empty for now. (EndpointPublishingStrategy): Add loadBalancer, hostNetwork, and private fields. * operator/v1/zz_generated.deepcopy.go: * operator/v1/zz_generated.swagger_doc_generated.go: Regenerate.
1401d95
to
2024105
Compare
Latest push marks |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, ironcladlou, Miciah 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 |
Add a field to ingress controllers' endpoint publishing strategy to allow specifying parameters for load balancers. Define a parameter to allow choosing between an internal or an external load balancer.
This PR resolves NE-186.
operator/v1/types_ingress.go
(LoadBalancerType
): New type.(
InternalLoadBalancer
,ExternalLoadBalancer
): New values.(
LoadBalancerStrategy
): New type for load balancer parameters.(
EndpointPublishingStrategy
): AddloadBalancer
field.operator/v1/zz_generated.deepcopy.go
:operator/v1/zz_generated.swagger_doc_generated.go
: Regenerate.