diff --git a/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md b/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md
index 989ef96e7..69c45428b 100644
--- a/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md
+++ b/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md
@@ -135,6 +135,7 @@ gateway:
port: 80
externalRgwEndpoints:
- ip: 192.168.39.182
+ # hostname: example.com
```
This will create a service with the endpoint `192.168.39.182` on port `80`, pointing to the Ceph object external gateway.
diff --git a/Documentation/CRDs/specification.md b/Documentation/CRDs/specification.md
index f9d232b15..66c239809 100644
--- a/Documentation/CRDs/specification.md
+++ b/Documentation/CRDs/specification.md
@@ -4850,7 +4850,7 @@ string
(Optional)
- The IP of this endpoint.
+The IP of this endpoint. As a legacy behavior, this supports being given a DNS-adressable hostname as well.
|
@@ -4862,7 +4862,7 @@ string
|
(Optional)
- The Hostname of this endpoint
+The DNS-addressable Hostname of this endpoint. This field will be preferred over IP if both are given.
|
diff --git a/Documentation/Storage-Configuration/Object-Storage-RGW/object-storage.md b/Documentation/Storage-Configuration/Object-Storage-RGW/object-storage.md
index 8992e5d6d..113537597 100644
--- a/Documentation/Storage-Configuration/Object-Storage-RGW/object-storage.md
+++ b/Documentation/Storage-Configuration/Object-Storage-RGW/object-storage.md
@@ -93,6 +93,7 @@ spec:
port: 8080
externalRgwEndpoints:
- ip: 192.168.39.182
+ # hostname: example.com
```
Use the existing `object-external.yaml` file. Even though multiple endpoints can be specified, it is recommend to use only one endpoint. This endpoint is randomly added to `configmap` of OBC and secret of the `cephobjectstoreuser`. Rook never guarantees the randomly picked endpoint is a working one or not.
diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml
index 6c09a0ce1..b4bc15865 100644
--- a/deploy/charts/rook-ceph/templates/resources.yaml
+++ b/deploy/charts/rook-ceph/templates/resources.yaml
@@ -9160,10 +9160,10 @@ spec:
description: EndpointAddress is a tuple that describes a single IP address or host name. This is a subset of Kubernetes's v1.EndpointAddress.
properties:
hostname:
- description: The Hostname of this endpoint
+ description: The DNS-addressable Hostname of this endpoint. This field will be preferred over IP if both are given.
type: string
ip:
- description: The IP of this endpoint.
+ description: The IP of this endpoint. As a legacy behavior, this supports being given a DNS-adressable hostname as well.
type: string
type: object
x-kubernetes-map-type: atomic
diff --git a/deploy/examples/crds.yaml b/deploy/examples/crds.yaml
index 0edae70fb..21828e2df 100644
--- a/deploy/examples/crds.yaml
+++ b/deploy/examples/crds.yaml
@@ -9152,10 +9152,10 @@ spec:
description: EndpointAddress is a tuple that describes a single IP address or host name. This is a subset of Kubernetes's v1.EndpointAddress.
properties:
hostname:
- description: The Hostname of this endpoint
+ description: The DNS-addressable Hostname of this endpoint. This field will be preferred over IP if both are given.
type: string
ip:
- description: The IP of this endpoint.
+ description: The IP of this endpoint. As a legacy behavior, this supports being given a DNS-adressable hostname as well.
type: string
type: object
x-kubernetes-map-type: atomic
diff --git a/deploy/examples/create-external-cluster-resources-tests.py b/deploy/examples/create-external-cluster-resources-tests.py
index bc35e0f4c..98fe7ecf9 100644
--- a/deploy/examples/create-external-cluster-resources-tests.py
+++ b/deploy/examples/create-external-cluster-resources-tests.py
@@ -187,15 +187,6 @@ class TestRadosJSON(unittest.TestCase):
except ext.ExecutionFailureException as err:
print(f"Successfully thrown error: {err}")
- def test_convert_fqdn_rgw_endpoint_to_ip(self):
- try:
- rgw_endpoint_ip = self.rjObj.convert_fqdn_rgw_endpoint_to_ip(
- "www.redhat.com:80"
- )
- print(f"Successfully Converted www.redhat.com to it's IP {rgw_endpoint_ip}")
- except ext.ExecutionFailureException as err:
- print(f"Successfully thrown error: {err}")
-
def test_upgrade_user_permissions(self):
self.rjObj = ext.RadosJSON(
[
diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py
index 0c36f5547..62e4b1d1d 100644
--- a/deploy/examples/create-external-cluster-resources.py
+++ b/deploy/examples/create-external-cluster-resources.py
@@ -1229,19 +1229,6 @@ class RadosJSON:
"",
)
- def convert_fqdn_rgw_endpoint_to_ip(self, fqdn_rgw_endpoint):
- try:
- fqdn, port = fqdn_rgw_endpoint.split(":")
- except ValueError:
- raise ExecutionFailureException(
- f"Not a proper endpoint: {fqdn_rgw_endpoint}, "
- ":, format is expected"
- )
- rgw_endpoint_ip = self._convert_hostname_to_ip(fqdn)
- rgw_endpoint_port = port
- rgw_endpoint = self._join_host_port(rgw_endpoint_ip, rgw_endpoint_port)
- return rgw_endpoint
-
def validate_rbd_pool(self):
if not self.cluster.pool_exists(self._arg_parser.rbd_data_pool_name):
raise ExecutionFailureException(
@@ -1325,7 +1312,6 @@ class RadosJSON:
# check if the rgw endpoint is reachable
rgw_endpoint = self._arg_parser.rgw_endpoint
- self._invalid_endpoint(rgw_endpoint)
cert = None
if not self._arg_parser.rgw_skip_tls and self.validate_rgw_endpoint_tls_cert():
cert = self._arg_parser.rgw_tls_cert_path
@@ -1390,10 +1376,6 @@ class RadosJSON:
self._arg_parser.cluster_name = (
self._arg_parser.cluster_name.lower()
) # always convert cluster name to lowercase characters
- if self._arg_parser.rgw_endpoint:
- self._arg_parser.rgw_endpoint = self.convert_fqdn_rgw_endpoint_to_ip(
- self._arg_parser.rgw_endpoint
- )
self.validate_rbd_pool()
self.validate_rados_namespace()
self.validate_subvolume_group()
diff --git a/deploy/examples/object-external.yaml b/deploy/examples/object-external.yaml
index f7bd55558..d42e410af 100644
--- a/deploy/examples/object-external.yaml
+++ b/deploy/examples/object-external.yaml
@@ -16,3 +16,4 @@ spec:
port: 80
externalRgwEndpoints:
- ip: 192.168.39.182
+ # hostname: example.com
diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go
index cf2a5e95f..f6e176d60 100755
--- a/pkg/apis/ceph.rook.io/v1/types.go
+++ b/pkg/apis/ceph.rook.io/v1/types.go
@@ -1484,10 +1484,11 @@ type GatewaySpec struct {
// Kubernetes's v1.EndpointAddress.
// +structType=atomic
type EndpointAddress struct {
- // The IP of this endpoint.
+ // The IP of this endpoint. As a legacy behavior, this supports being given a DNS-adressable hostname as well.
// +optional
IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"`
- // The Hostname of this endpoint
+
+ // The DNS-addressable Hostname of this endpoint. This field will be preferred over IP if both are given.
// +optional
Hostname string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"`
}