-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,8 +85,76 @@ type IngressSpec struct { | |
| // Note that if there are no RequiredHSTSPolicies, any HSTS Policy annotation on the route is valid. | ||
| // +optional | ||
| RequiredHSTSPolicies []RequiredHSTSPolicy `json:"requiredHSTSPolicies,omitempty"` | ||
|
|
||
| // loadBalancer contains the load balancer details in general which are not only specific to the underlying infrastructure | ||
| // provider of the current cluster and are required for Ingress Controller to work on OpenShift. | ||
| // +optional | ||
| LoadBalancer LoadBalancer `json:"loadbalancer,omitempty"` | ||
| } | ||
|
|
||
| // IngressPlatformSpec holds the desired state of Ingress specific to the underlying infrastructure provider | ||
| // of the current cluster. Since these are used at spec-level for the underlying cluster, it | ||
| // is supposed that only one of the spec structs is set. | ||
| // +union | ||
| type IngressPlatformSpec struct { | ||
| // type is the underlying infrastructure provider for the cluster. | ||
| // Allowed values are "AWS", "Azure", "BareMetal", "GCP", "Libvirt", | ||
| // "OpenStack", "VSphere", "oVirt", "KubeVirt", "EquinixMetal", "PowerVS", | ||
| // "AlibabaCloud", "Nutanix" and "None". Individual components may not support all platforms, | ||
| // and must handle unrecognized platforms as None if they do not support that platform. | ||
| // | ||
| // +unionDiscriminator | ||
| Type PlatformType `json:"type"` | ||
deads2k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // aws contains settings specific to the Amazon Web Services infrastructure provider. | ||
| // +optional | ||
| AWS *AWSIngressSpec `json:"aws,omitempty"` | ||
| } | ||
|
|
||
| type LoadBalancer struct { | ||
| // platform holds configuration specific to the underlying | ||
| // infrastructure provider for the ingress load balancers. | ||
| // When omitted, this means the user has no opinion and the platform is left | ||
| // to choose reasonable defaults. These defaults are subject to change over time. | ||
| // +optional | ||
| Platform IngressPlatformSpec `json:"platform,omitempty"` | ||
| } | ||
|
|
||
| // AWSIngressSpec holds the desired state of the Ingress for Amazon Web Services infrastructure provider. | ||
| // This only includes fields that can be modified in the cluster. | ||
| // +union | ||
| type AWSIngressSpec struct { | ||
| // type 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. | ||
| // Valid values are: | ||
| // | ||
| // * "Classic": A Classic Load Balancer that makes routing decisions at either | ||
| // the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS). See | ||
| // the following for additional details: | ||
| // | ||
| // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#clb | ||
| // | ||
| // * "NLB": A Network Load Balancer that makes routing decisions at the | ||
| // transport layer (TCP/SSL). See the following for additional details: | ||
| // | ||
| // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb | ||
| // +unionDiscriminator | ||
| // +kubebuilder:validation:Enum:=NLB;Classic | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this allow ""?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No we wont't allow "" as if someone is mentioning which is optional then they shall mention the load balancer type of AWS.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required fields in optional structs that are pointers should be able to be omitted completely, so this should work. But please test the serialization and validation manually before we merge this |
||
| // +kubebuilder:validation:Required | ||
| Type AWSLBType `json:"type,omitempty"` | ||
| } | ||
|
|
||
| type AWSLBType string | ||
|
|
||
| const ( | ||
| // NLB is the Network Load Balancer Type of AWS. Using NLB one can set NLB load balancer type for the default ingress controller. | ||
| NLB AWSLBType = "NLB" | ||
|
|
||
| // Classic is the Classic Load Balancer Type of AWS. Using CLassic one can set Classic load balancer type for the default ingress controller. | ||
| Classic AWSLBType = "Classic" | ||
| ) | ||
|
|
||
| // ConsumingUser is an alias for string which we add validation to. Currently only service accounts are supported. | ||
| // +kubebuilder:validation:Pattern="^system:serviceaccount:[a-z0-9]([-a-z0-9]*[a-z0-9])?:[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" | ||
| // +kubebuilder:validation:MinLength=1 | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 is a union so needs a union tag, please also add some description of the struct
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.
Please make sure to include a description of the expect use of the union in the godoc