-
Notifications
You must be signed in to change notification settings - Fork 582
LBType field for AWS in infra cluster object. #1209
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
Conversation
|
Hello @miheer! Some important instructions when contributing to openshift/api: For merging purposes, this repository follows the no-Feature-Freeze process which means that in addition to the standard
OR
Who should apply these qe/docs/px labels?
|
|
/assign @rfredette |
|
@rfredette PTAL. I need to get this merged ASAP as the epic has high priority. Thanks in advance! |
|
/lgtm |
config/v1/types_infrastructure.go
Outdated
| ServiceEndpoints []AWSServiceEndpoint `json:"serviceEndpoints,omitempty"` | ||
|
|
||
| // LBType allows user to set a load balancer type. | ||
| // Allowed values are nlb or elb |
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.
Allowed values must be PascalCase to follow conventions, NLB and ELB
config/v1/types_infrastructure.go
Outdated
| // LBType allows user to set a load balancer type. | ||
| // Allowed values are nlb or elb | ||
| // +optional | ||
| LBType string `json:"lbType,omitempty"` |
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.
You should create an enum rather than a plain string, ie a typed string, which has some exported constants with the possible values,
Given you're adding some load balancer configuration, is there any change the user may want to be able to configure any of the load balancer options, ELB or NLB at some point in the future?
I think this probably wants to end up as a discriminated union with configuration for both types of load balancer
config/v1/types_infrastructure.go
Outdated
| // LBType allows user to set a load balancer type. | ||
| // Allowed values are nlb or elb | ||
| // +optional | ||
| LBType string `json:"lbType,omitempty"` |
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 do you need this in the status as well as the spec?
|
@JoelSpeed PTAL. I have made the changes you asked for. |
config/v1/types_infrastructure.go
Outdated
|
|
||
| // LBType allows user to set a load balancer type. | ||
| // Allowed values are NLB or Classic | ||
| // +kubebuilder:validation:Enum:=NLB;Classic |
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 backwards compatibility you need to allow an empty value too
| // +kubebuilder:validation:Enum:=NLB;Classic | |
| // +kubebuilder:validation:Enum:=NLB;Classic;"" |
config/v1/types_infrastructure.go
Outdated
| // +optional | ||
| ServiceEndpoints []AWSServiceEndpoint `json:"serviceEndpoints,omitempty"` | ||
|
|
||
| // LBType allows user to set a load balancer 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.
You need to explain what happens when this field isn't set. You also need to explain what would happen if the field is changed (if that is allowed) while the cluster is running.
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.
Reading the enhancement, this seems it's the default but can be overriden right? That will need to be explained in this godoc
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.
Hi @JoelSpeed ! I have added the description for what happens when this value is set and not set.
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.
@JoelSpeed PTAL. I have added the description as to what will happen when the value is set and not set.
// When this field is set the default ingresscontroller will get created using the specified LBType.
// If this field is not set then the default ingress controller of LBType Classic will be created.
config/v1/types_infrastructure.go
Outdated
|
|
||
| // LBType allows user to set a load balancer type. | ||
| // When this field is set the default ingresscontroller will get created using the specified LBType. | ||
| // If this field is not set then the default ingress controller of LBType Classic will be created. |
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 we need to make a note that if this is changed while the cluster is running that the existing default ingress controller will not be updated
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.
The ingress operator will check this value at certain interval.
config/v1/types_infrastructure.go
Outdated
| // Allowed values are NLB or Classic | ||
| // +kubebuilder:validation:Enum:=NLB;Classic;"" | ||
| // +optional | ||
| LBType AWSLBType `json:"lbType,omitempty"` |
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 think we should abbreviate the field name here, I also wonder if we want to make a struct of options rather than just adding an individual field.
Perhaps instead we want it to look something like
ingress:
loadBalancer:
defaultType: NLB
Then we have the option to group other relevant options we might need in the future
|
@JoelSpeed based on our discussions it looks like the right place is ingress cluster object and not the infrastructure cluster object. The default ingresscontroller can have either an internal or external LB. However, The API uses a separate load balancer. I think ingress cluster object seems to be the right place. I have made the necessary changes. PTAL. Copying @sadasu from the installler team as she had voted for this field to be added in the infrastructure object. |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, JoelSpeed, miheer, rfredette 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 |
|
/hold cancel |
|
@ahardin-rh can you please docs-approved this PR ? |
|
/label qe-approved |
|
/label px-approved |
|
/label docs-approved |
|
@miheer: 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. |
In the ingress config cluster object we need to add api for AWS LBType which will store and persist the information of the desired LB type mentioned by the installer config API so that the ingress operator will refer the LB type from this object whenever someone accidentally deletes the ingress controller. Currently, the default LB type i.e CLB/ELB gets set if you delete the ingress controller object even when the desired the LB type for default ingress controller was set to NLB as ingress operator does not have a way to check the LB type as we don't store it. This commit adds LB Type for AWS mentioned in the install-config.yaml in the ingress cluster object. `data/data/install.openshift.io_installconfigs.yaml` A generated new field called lbType will be available to add load balancer type in the install-config.yaml for AWS `pkg/asset/manifests/ingress.go` The ingress cluster object will be patched with this lbType provided by user so that we have the information related to the lbType persistent which can be referred by ingress operator when the default ingress controller is deleted. `pkg/asset/manifests/ingress_test.go` Unit test to test setting of lbType in the ingress cluster object's spec and status as per the value specified in the install-config.yaml `pkg/explain/printer_test.go` A new field to test called lbType which will be available to add the load balancer type in the install-config.yaml for AWS `pkg/types/aws/platform.go` A new field called lbType will be available to add the load balancer type in the install-config.yaml for AWS Enhacement proposal - openshift/enhancements#1148 OpenShift API - openshift/api#1209 Fixes Jira ticket - https://issues.redhat.com/browse/NE-942
In the ingress config cluster object we need to add api for AWS LBType which will store and persist the information of the desired LB type mentioned by the installer config API so that the ingress operator will refer the LB type from this object whenever someone accidentally deletes the ingress controller. Currently, the default LB type i.e CLB/ELB gets set if you delete the ingress controller object even when the desired the LB type for default ingress controller was set to NLB as ingress operator does not have a way to check the LB type as we don't store it. This commit adds LB Type for AWS mentioned in the install-config.yaml in the ingress cluster object. `data/data/install.openshift.io_installconfigs.yaml` A generated new field called lbType will be available to add load balancer type in the install-config.yaml for AWS `pkg/asset/manifests/ingress.go` The ingress cluster object will be patched with this lbType provided by user so that we have the information related to the lbType persistent which can be referred by ingress operator when the default ingress controller is deleted. `pkg/asset/manifests/ingress_test.go` Unit test to test setting of lbType in the ingress cluster object's spec and status as per the value specified in the install-config.yaml `pkg/explain/printer_test.go` A new field to test called lbType which will be available to add the load balancer type in the install-config.yaml for AWS `pkg/types/aws/platform.go` A new field called lbType will be available to add the load balancer type in the install-config.yaml for AWS Enhacement proposal - openshift/enhancements#1148 OpenShift API - openshift/api#1209 Fixes Jira ticket - https://issues.redhat.com/browse/NE-942 Modified-by: Grant Spence <gspence@redhat.com>
In the ingress config cluster object we will need to add api for LBType for AWS which will store and persist the information of the desired LB type mentioned by the installer config API so that the ingress operator will refer the LB type from this object whenever someone accidentally deletes the ingress controller. Currently, the default LB type i.e CLB/ELB gets set if you delete the ingress controller object even when the desired the LB type for default ingress controller was set to NLB as ingress operator does not have a way to check the LB type as we don't store it.
Enhancement Proposal - openshift/enhancements#1148