Skip to content

[SPLAT-594] vSphere: add zonal spec to infrastructure object#1199

Closed
jcpowermac wants to merge 5 commits intoopenshift:masterfrom
jcpowermac:vsphere-zoning
Closed

[SPLAT-594] vSphere: add zonal spec to infrastructure object#1199
jcpowermac wants to merge 5 commits intoopenshift:masterfrom
jcpowermac:vsphere-zoning

Conversation

@jcpowermac
Copy link
Copy Markdown
Contributor

No description provided.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 19, 2022
@jcpowermac
Copy link
Copy Markdown
Contributor Author

See enhancement: openshift/enhancements#918

@openshift-ci openshift-ci Bot requested review from derekwaynecarr and sjenning May 19, 2022 18:22
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go
Comment thread config/v1/types_infrastructure.go
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Aug 2, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jcpowermac
Once this PR has been reviewed and has the lgtm label, please assign sjenning for approval by writing /assign @sjenning in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jcpowermac jcpowermac force-pushed the vsphere-zoning branch 2 times, most recently from b1d51ae to cfbf5bd Compare August 5, 2022 13:32
@jcpowermac
Copy link
Copy Markdown
Contributor Author

/test verify

@jcpowermac jcpowermac changed the title [WIP] Add additional properties required for vSphere zoning Add additional properties required for vSphere zoning Aug 5, 2022
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2022
Comment thread config/v1/types_infrastructure.go Outdated
Comment on lines +633 to +703
// networks is the list of port group network names within this failure domain.
// Currently, we only support a single interface per RHCOS virtual machine.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is an expected value here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

port group name

@rvanderp3 @bostrt do you think this should be a path?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think a path is required here. the network is looked up relative to the associated datacenter and cluster.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example of an expected value is useful for godocs

Comment thread config/v1/types_infrastructure.go Outdated
Comment on lines +13 to +24
- op: add
path: /spec/versions/name=v1/schema/openAPIV3Schema/properties/spec/properties/platformSpec/properties/vsphere/properties/nodeNetworking/properties/external/properties/excludeNetworkSubnetCidr/items/format
value: cidr
- op: add
path: /spec/versions/name=v1/schema/openAPIV3Schema/properties/spec/properties/platformSpec/properties/vsphere/properties/nodeNetworking/properties/external/properties/networkSubnetCidr/items/format
value: cidr
- op: add
path: /spec/versions/name=v1/schema/openAPIV3Schema/properties/spec/properties/platformSpec/properties/vsphere/properties/nodeNetworking/properties/internal/properties/excludeNetworkSubnetCidr/items/format
value: cidr
- op: add
path: /spec/versions/name=v1/schema/openAPIV3Schema/properties/spec/properties/platformSpec/properties/vsphere/properties/nodeNetworking/properties/internal/properties/networkSubnetCidr/items/format
value: cidr
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you only have one format, can this not be kubebuilder:validation:Format:=cidr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason kubebuilder adds the format not under items.
Unsure its a bug or a me problem.

Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 9, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 9, 2022
@jcpowermac jcpowermac changed the title Add additional properties required for vSphere zoning vSphere: add zonal spec to infrastructure object Aug 25, 2022
@jcpowermac jcpowermac changed the title vSphere: add zonal spec to infrastructure object [SPLAT-594] vSphere: add zonal spec to infrastructure object Aug 25, 2022
@jcpowermac
Copy link
Copy Markdown
Contributor Author

/test verify

This PR adds additional fields for the vSphere spec
to provide zonal information for operators such
as storage, machine and cloud controller.
Comment thread config/v1/types_infrastructure.go Outdated
// +kubebuilder:validation:MaxLength=80
Datacenter string `json:"datacenter"`

// computeCluster as the failure domain
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean?

Is this option only valid when type is ComputeCluster?

Does this need to be a discrminated unionhttps://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md#discriminated-unions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed text since we removed HostGroup as a topology option.

Comment thread config/v1/types_infrastructure.go Outdated

// Topology describes a given failure domain using vSphere constructs
// +kubebuilder:validation:Required
Topology VSpherePlatformTopology `json:"topology"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting the impression that the topology should be a discrminated union

topology:
  type: Datacenter
  datacenter:
    name: ...

Why is the type in the region/zone failure domain rather than the topology?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the removal of HostGroup as a zone not sure this still applies.

Topology defines the vCenter-based objects that a region-zone pair includes.

Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
Comment thread config/v1/types_infrastructure.go Outdated
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern=`^/.*?/host/.*?/Resources.*`
// +optional
ResourcePool string `json:"resourcePool,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this was something that is not configurable before and now it is. Can the values here conflict with folder optional below? If unspecified - the system picks a default ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread config/v1/types_infrastructure.go Outdated
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=80
TagCategory string `json:"tagCategory"`
Copy link
Copy Markdown
Member

@gnufied gnufied Aug 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the concerns @jsafrane raised was - since we are not enforcing anything on these tag category names, what happens if customers names them inconsistently? Such as say:

  1. FailureDomain A - tag is "regionA", category is" k8s-region", for zone - tag is "zoneA", category is "k8s-zone"
  2. FailureDomain B - for region (tag is regionB and category is "k8s-region"), for zone (tag is "zoneB" and category is "locationZone")

In this case, categories of zones isn't matching and could create problems in determining topology of storage/nodes. I have not tested the behavior of CSI driver if categories are named inconsistently. In a ideal case, for failureDomain B - a reasonable person would name category of the zone to be k8s-zone (basically same as category name in failureDomainA).

So question is - should we enforce some kind of restriction on these names? Is allowing any random string for a domain is too broad and will cause problems?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically I think that - if user is using tag category - "k8s-region" for region, then they should use same tag category for all the regions in the cluster. Values can be different but category names should be the same. Allowing different "ways" of naming tag categories opens us up for various kind of corner cases.

I was also thinking of picking a convention for these categories and sticking with it. So basically, you can't call your region category anything other than k8s-region, so on and so forth. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated removing the ability to set the tag category.
The Region and Zone are now just strings for the tag name.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the category name now openshift-zone and openshift-region hardcoded values? Any other values are not accepted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to create a PR for the installer now to hardset the cloud-config labels to openshift-region, openshift-zone.
Will also update the enhancement

It won't be definable so not sure how other values would be accepted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. much neater. If need be we can relax this later.

@jcpowermac
Copy link
Copy Markdown
Contributor Author

Here is an example of the yaml:
https://gist.github.com/jcpowermac/49eaaadfacd2afcc4e93418a7ffc6fa4

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Aug 29, 2022

@jcpowermac: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

@jcpowermac
Copy link
Copy Markdown
Contributor Author

/close
in favor of #1278

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 6, 2022
@openshift-merge-robot
Copy link
Copy Markdown
Contributor

@jcpowermac: PR needs rebase.

Details

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.

@openshift-ci openshift-ci Bot closed this Sep 6, 2022
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Sep 6, 2022

@jcpowermac: Closed this PR.

Details

In response to this:

/close
in favor of #1278

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants