OpenShift Container Storage is now OpenShift Data Foundation starting with version 4.9.
Chapter 11. Accessing the RADOS Object Gateway S3 endpoint
Users can access the RADOS Object Gateway (RGW) endpoint directly.
Prerequisites
- A running OpenShift Container Storage Platform
Procedure
Run
oc get servicecommand to get the RGW service name.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run
oc exposecommand to expose the RGW service.oc expose svc/<RGW service name> --hostname=<route name>
$ oc expose svc/<RGW service name> --hostname=<route name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<RGW-service name>with the RGW service name from the previous step.Replace
<route name>with a route you want to create for the RGW service.For example:
oc expose svc/rook-ceph-rgw-ocs-storagecluster-cephobjectstore --hostname=rook-ceph-rgw-ocs.ocp.host.example.com
$ oc expose svc/rook-ceph-rgw-ocs-storagecluster-cephobjectstore --hostname=rook-ceph-rgw-ocs.ocp.host.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run
oc get routecommand to confirmoc exposeis successful and there is an RGW route.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verify
To verify the
ENDPOINT, run the following command:aws s3 --no-verify-ssl --endpoint <ENDPOINT> ls
aws s3 --no-verify-ssl --endpoint <ENDPOINT> lsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<ENDPOINT>with the route that you get from the command in the above step 3.For example:
aws s3 --no-verify-ssl --endpoint http://rook-ceph-rgw-ocs.ocp.host.example.com ls
$ aws s3 --no-verify-ssl --endpoint http://rook-ceph-rgw-ocs.ocp.host.example.com lsCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To get the access key and secret of the default user ocs-storagecluster-cephobjectstoreuser, run the following commands:
Access key:
oc get secret rook-ceph-object-user-ocs-storagecluster-cephobjectstore-ocs-storagecluster-cephobjectstoreuser -o yaml | grep -w "AccessKey:" | head -n1 | awk '{print $2}' | base64 --decode$ oc get secret rook-ceph-object-user-ocs-storagecluster-cephobjectstore-ocs-storagecluster-cephobjectstoreuser -o yaml | grep -w "AccessKey:" | head -n1 | awk '{print $2}' | base64 --decodeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Secret key:
oc get secret rook-ceph-object-user-ocs-storagecluster-cephobjectstore-ocs-storagecluster-cephobjectstoreuser -o yaml | grep -w "SecretKey:" | head -n1 | awk '{print $2}' | base64 --decode$ oc get secret rook-ceph-object-user-ocs-storagecluster-cephobjectstore-ocs-storagecluster-cephobjectstoreuser -o yaml | grep -w "SecretKey:" | head -n1 | awk '{print $2}' | base64 --decodeCopy to Clipboard Copied! Toggle word wrap Toggle overflow