From b6c3d8dd51dc80beb9efde87a9e6aa07c3c8a1df Mon Sep 17 00:00:00 2001 From: parth-gr Date: Mon, 22 May 2023 18:23:32 +0530 Subject: [PATCH] external: fqdn should be persisted 1) donot change rgw fqdn to ip if provided, As now the bucket class supports the entry of fqdn 2) update crds with new description in EndpointAddress Signed-off-by: parth-gr (cherry picked from commit f66de7b9df94bdf02b6d38b1a9cb1e4e63fdda81) Signed-off-by: parth-gr --- Documentation/CRDs/Object-Storage/ceph-object-store-crd.md | 1 + .../Object-Storage-RGW/object-storage.md | 1 + deploy/charts/rook-ceph/templates/resources.yaml | 4 ++-- deploy/examples/crds.yaml | 4 ++-- deploy/examples/create-external-cluster-resources.py | 5 ----- deploy/examples/object-external.yaml | 1 + pkg/apis/ceph.rook.io/v1/types.go | 5 +++-- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md b/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md index 894d2365151b..cc4e97623945 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/Storage-Configuration/Object-Storage-RGW/object-storage.md b/Documentation/Storage-Configuration/Object-Storage-RGW/object-storage.md index 55f491099741..a4ba1691d238 100644 --- a/Documentation/Storage-Configuration/Object-Storage-RGW/object-storage.md +++ b/Documentation/Storage-Configuration/Object-Storage-RGW/object-storage.md @@ -84,6 +84,7 @@ spec: port: 8080 externalRgwEndpoints: - ip: 192.168.39.182 + # hostname: example.com healthCheck: bucket: enabled: true diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml index f44acd66985c..9bfd206830e6 100644 --- a/deploy/charts/rook-ceph/templates/resources.yaml +++ b/deploy/charts/rook-ceph/templates/resources.yaml @@ -11489,10 +11489,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 nullable: true diff --git a/deploy/examples/crds.yaml b/deploy/examples/crds.yaml index 86130d19ab4b..5d8680881068 100644 --- a/deploy/examples/crds.yaml +++ b/deploy/examples/crds.yaml @@ -11481,10 +11481,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 nullable: true diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index 7b431f168122..0470b9d742d9 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -1358,7 +1358,6 @@ def validate_rgw_endpoint(self, info_cap_supported): # 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 @@ -1423,10 +1422,6 @@ def _gen_output_map(self): 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 172b52e7c331..a4206cff93aa 100644 --- a/deploy/examples/object-external.yaml +++ b/deploy/examples/object-external.yaml @@ -16,6 +16,7 @@ spec: port: 80 externalRgwEndpoints: - ip: 192.168.39.182 + # hostname: example.com healthCheck: bucket: disabled: false diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index 2a371a04122e..d6b633375a75 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -1442,10 +1442,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"` }