-
Notifications
You must be signed in to change notification settings - Fork 559
CORS-4136, CORS-4157: Add Feature gates and update Infrastructure API for AWS, Azure and GCP Dual Stack support #2430
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
base: master
Are you sure you want to change the base?
Conversation
Hello @sadasu! Some important instructions when contributing to openshift/api: |
@sadasu: This pull request references CORS-4136 which is a valid jira issue. This pull request references CORS-4157 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. In response to this: 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 openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sadasu The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ed2ad9d
to
64aaf90
Compare
config/v1/types_infrastructure.go
Outdated
// +kubebuilder:validation:Enum="IPFamiliesIPv4";"IPFamiliesDualStack" | ||
// +openshift:enable:FeatureGate=AWSDualStackInstall | ||
// +optional | ||
IpFamily IPFamiliesType `json:"ipFamily,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 think based on go naming conventions this should be
IpFamily IPFamiliesType `json:"ipFamily,omitempty"` | |
IPFamily IPFamiliesType `json:"ipFamily,omitempty"` |
64aaf90
to
bf0c0db
Compare
config/v1/types_infrastructure.go
Outdated
// +default="IPFamiliesIPv4" | ||
// +kubebuilder:default:="IPFamiliesIPv4" |
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.
Are we sure we want to default this? Are there existing clusters where this could default to an incorrect value?
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.
All currently installed AWS,Azure and GCP clusters are ipv4 only so this seemed like the correct default. So, when we upgrade to a version with this API change, the address family would be unambiguous.
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 there some way in the cluster that we could tell that the cluster is IPv4 and therefore set it based on something that already exists, rather than defaulting within the API based off of an assumption?
While all clusters today are ipv4, in theory in the future we could end up defaulting a cluster that is not ipv4 and this would then send the wrong message
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 are adding an install-config field for customers to set the IPFamily for the cluster for new installs. There too we are defaulting to IPV4. And as part of the support for dualstack, the Installer will always be explicitly setting this field in the Infra CR when the manifest is generated.
For existing clusters, we know that they are all IPv4 and hence added this defaulting behavior. Its value should be immutable.
config/v1/types_infrastructure.go
Outdated
// ipFamily indicates the IP Address family supported by cluster nodes. | ||
// +default="IPFamiliesIPv4" | ||
// +kubebuilder:default:="IPFamiliesIPv4" | ||
// +kubebuilder:validation:Enum="IPFamiliesIPv4";"IPFamiliesDualStack" |
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 should be the string value, not the constant name
@@ -536,6 +536,14 @@ type AWSPlatformStatus struct { | |||
// +optional | |||
// +nullable | |||
CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"` | |||
|
|||
// ipFamily indicates the IP Address family supported by cluster nodes. |
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.
Explain the valid values and what they mean as part of the 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.
Done.
@@ -1130,7 +1130,6 @@ spec: | |||
- HighlyAvailable | |||
- HighlyAvailableArbiter | |||
- SingleReplica | |||
- DualReplica |
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.
Not sure why this has been removed?
machineconfiguration/v1/types.go
Outdated
@@ -148,7 +148,7 @@ type ControllerConfigSpec struct { | |||
|
|||
// ipFamilies indicates the IP families in use by the cluster network | |||
// +required | |||
IPFamilies IPFamiliesType `json:"ipFamilies"` | |||
IPFamilies configv1.IPFamiliesType `json:"ipFamilies"` |
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.
Do we need to do this? We tend to prefer local types over importing from other packages
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.
IPFamiliesType was originally defined here : https://github.com/openshift/api/blob/master/machineconfiguration/v1/types.go#L177-L185.
Instead of redefining IPFamilies for use within types_infrastructure.go, i moved it to a common location in config/v1/types.go
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.
Are we confident that their use cases will not diverge? It's generally safer to have the two as separate APIs and not to share a common place like this
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 do not envision IP family types to diverge. But, let me try again by separating the APIs.
@@ -669,7 +669,7 @@ spec: | |||
when type is Name, and forbidden otherwise | |||
rule: 'has(self.type) && self.type == ''Name'' | |||
? has(self.name) : !has(self.name)' | |||
maxItems: 32 | |||
maxItems: 1 |
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 seems to be unrelated?
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 and the deletion of DualReplica
keeps showing up every time I run make update
.
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.
Make sure you rebase onto the latest main before you run the update command
6652e10
to
e7a5704
Compare
7c13a6c
to
0bcd978
Compare
0bcd978
to
628d0cf
Compare
// infrastructure and all cluster resources are expected to have both IPv4 and IPv6 addresses. | ||
// +default="IPv4" | ||
// +kubebuilder:default:="IPv4" | ||
// +kubebuilder:validation:Enum="IPv4";"DualStack" |
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.
Generally prefer to have this on the type alias itself, rather than at the field level
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.
There was a question within the team regarding this field in the PlatformStatus. Could the same functionality be achieved using an existing API such as cloud provider config? My reasoning has been that we need a source of truth for the cluster that is easily available even on day-2 and within an API that we manage. Thoughts?
@@ -429,3 +429,11 @@ const ( | |||
// IBMCloudServiceVPC is the name for IBM Cloud VPC. | |||
IBMCloudServiceVPC IBMCloudServiceName = "VPC" | |||
) | |||
|
|||
// IPFamilyType indicates whether the different IP address configurations supported like IPv4-only, dual-stack | |||
type IPFamilyType string |
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.
Add // +enum
to allow the correct generation of openapi spec
This config is being added to be explicit about the IP address family for the Cluster so that we don't have to infer that from other configs that may not always be present. Updating PlatformStatus for AWS, Azure and GCP to enable dual stack installs on these platforms (initially in tech preview).
628d0cf
to
fb36988
Compare
@sadasu: The following tests failed, say
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-sigs/prow repository. I understand the commands that are listed here. |
// +kubebuilder:default:="IPv4" | ||
// +kubebuilder:validation:Enum="IPv4";"DualStack" | ||
// +openshift:enable:FeatureGate=AWSDualStackInstall | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ipFamily is immutable once 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.
Do you have a test to show that if the value is DualStack
, and then someone tries to remove it, that it doesn't default to IPv4?
@@ -775,6 +801,19 @@ type GCPPlatformStatus struct { | |||
// +optional | |||
// +openshift:enable:FeatureGate=GCPCustomAPIEndpointsInstall | |||
ServiceEndpoints []GCPServiceEndpoint `json:"serviceEndpoints,omitempty"` | |||
|
|||
// ipFamily indicates the IP Address family supported by cluster nodes. |
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.
Explain in the godoc that the value is set at installation time and it cannot be changed
No description provided.