Skip to content

disable http route#3685

Open
sp98 wants to merge 1 commit intored-hat-storage:mainfrom
sp98:disable-http-routes
Open

disable http route#3685
sp98 wants to merge 1 commit intored-hat-storage:mainfrom
sp98:disable-http-routes

Conversation

@sp98
Copy link
Contributor

@sp98 sp98 commented Feb 9, 2026

This PR:

  • Adds a new API for ObjectStore - DisableHttp at Spec.ManagedResources.CephObjectStores.DisableHttp
  • If set to true, then
    • skip creating RGW http routes
    • delete any existing RGW http route that was created previously
    • set cephObjectstore spec.gateway.port (unsecure port) to 0.

PR is related to 4.22 Epic - https://issues.redhat.com/browse/RHSTOR-8168

Testing

Before disabling rgw http

oc get routes                                                                                                                                                                                                   ─╯
NAME                                        HOST/PORT                                                                                       PATH   SERVICES                                           PORT    TERMINATION          WILDCARD
ocs-storagecluster-cephobjectstore          ocs-storagecluster-cephobjectstore-openshift-storage.apps.sapillai-rgw-2.qe.rh-ocs.com                 rook-ceph-rgw-ocs-storagecluster-cephobjectstore   http    edge/Allow           None
ocs-storagecluster-cephobjectstore-secure   ocs-storagecluster-cephobjectstore-secure-openshift-storage.apps.sapillai-rgw-2.qe.rh-ocs.com          rook-ceph-rgw-ocs-storagecluster-cephobjectstore   https   reencrypt/Redirect   None

—————

oc get service | grep rgw                                                                                                                                                                                       ─╯
rook-ceph-rgw-ocs-storagecluster-cephobjectstore   ClusterIP   172.30.26.138    <none>        80/TCP,443/TCP      27m

After disabling Http route

oc get routes                                                                                                                                                                                                   ─╯
NAME                                        HOST/PORT                                                                                       PATH   SERVICES                                           PORT    TERMINATION          WILDCARD
ocs-storagecluster-cephobjectstore-secure   ocs-storagecluster-cephobjectstore-secure-openshift-storage.apps.sapillai-rgw-2.qe.rh-ocs.com          rook-ceph-rgw-ocs-storagecluster-cephobjectstore   https   reencrypt/Redirect   None


 oc get service | grep rgw                                                                                                                                                                                       ─╯
rook-ceph-rgw-ocs-storagecluster-cephobjectstore   ClusterIP   172.30.26.138    <none>        443/TCP             29m

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sp98
Once this PR has been reviewed and has the lgtm label, please assign iamniting for approval. For more information see the 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

@sp98 sp98 force-pushed the disable-http-routes branch 4 times, most recently from 2406192 to 5ace6fd Compare February 10, 2026 10:02
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2026
if storagecluster spec.ManagedResources.CephObjectStores.DisableHttp is
true, then skip creating RGW http routes, delete any existing RGW
http route that was created previously and set cephObjectstore
spec.gateway.port (unsecure port) to 0.

Signed-off-by: Santosh <sapillai@redhat.com>
@sp98 sp98 force-pushed the disable-http-routes branch from 5ace6fd to c037106 Compare February 10, 2026 10:04
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2026
Comment on lines +221 to +237
routeName := util.GenerateNameForCephObjectStore(sc)
foundRoute := &routev1.Route{}
err := r.Client.Get(context.TODO(), types.NamespacedName{Name: routeName, Namespace: sc.Namespace}, foundRoute)
if err != nil {
if errors.IsNotFound(err) {
r.Log.Info("Http Ceph RGW Route not found, nothing to delete.", "CephRGWRoute", klog.KRef(sc.Namespace, routeName))
return nil
}
return fmt.Errorf("failed to retrieve Http Ceph RGW Route %v: %v", routeName, err)
}

r.Log.Info("Deleting http Ceph RGW Route.", "CephRGWRoute", klog.KRef(sc.Namespace, routeName))
err = r.Client.Delete(context.TODO(), foundRoute)
if err != nil {
r.Log.Error(err, "Failed to delete http Ceph RGW Route.", "CephRGWRoute", klog.KRef(sc.Namespace, routeName))
return fmt.Errorf("failed to delete http Ceph RGW Route %v: %v", routeName, err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This could be a single delete call instead, which would save a cache lookup in the controller-runtime cahche. This point is pretty minor, however.

Copy link
Contributor

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

Looks good to me. I think the ocs-operator team has final approval, so I will just mark a comment for now. LMK if a full approval would be better.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants