Skip to content
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

object: virtulhostnames is not required in the endpoint for rgw #14034

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions pkg/operator/ceph/object/rgw.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ func getDomainName(s *cephv1.CephObjectStore, returnRandomDomainIfMultiple bool)
for _, e := range s.Spec.Gateway.ExternalRgwEndpoints {
endpoints = append(endpoints, e.String())
}
} else if s.Spec.Hosting != nil && len(s.Spec.Hosting.DNSNames) > 0 {
// if the store is internal and has DNS names, pick a random DNS name to use
endpoints = s.Spec.Hosting.DNSNames
} else {
return domainNameOfService(s)
Copy link
Member

Choose a reason for hiding this comment

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

Are you saying the dns host name is already added to this service name that would be returned here?

What was the bug? Were we returning an invalid domain name with line 353?

Copy link
Member

Choose a reason for hiding this comment

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

I'm also somewhat confused. Please update the commit description and PR description text to be clear about what problem exists and how this resolves it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@travis and @BlaineEXE it is not because invalid DNS name.
The endpoint of cephobjectstore is populated with help of BuildDNSEndpoint which combines domain name from getDomainName and port in the objectstore.spec.gateway . This approach is used in most of the Rook code base and even for adminsops api for Rook to communicate with RGW.
In case of host feature is enabled it returns the domain from rgw DNS name list, but the domain picked may not have the same port as the rgw internal port which is failing for adminsops use case. So the populated endpoint in this case is wrong.
Even if the feature is enabled by default rgw service endpoint will be part of the rgw DNS names so we can pick RGW service endpoint for all the internal communications. As I mentioned earlier by default rgw service endpoint is part of there is no specific need to pick the domain name from the rgw DNS list

I have added this change in the first version based on the assumption that by default rgw service endpoint would not be added to rgw DNS names, when vhost feature is enabled. But later we decided to include the rook-service-endpoint to rgw DNS names if not it will break the existing clusters access

Copy link
Member

Choose a reason for hiding this comment

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

I'm still struggling to understand this.

However, I do understand this statement, and I don't think the logic makes sense to me:

rgw service endpoint will be part of the rgw DNS names so we can pick RGW service endpoint for all the internal communications. As I mentioned earlier by default rgw service endpoint is part of there is no specific need to pick the domain name from the rgw DNS list

If the RGW service endpoint exists, I don't think that necessarily means that we should pick it when reporting/selecting the endpoint. From what I understand, the point of adding rgw dns names is to allow users to use wildcard addressing, which is not possible for default service endpoints. Only the endpoints added by the user in .spec.hosting.dnsNames are wildcard-addressable, and those endpoints should be preferred selections for OBCs and CephObjectStoreUsers. This is especially true because the wildcard-addressability is actually supposed to be the S3 default (the older path-style addressing is deprecated).

}
Expand Down