if there is no multisite config pass, it will still checks for
the zones and zones group and not able to query anything
Signed-off-by: parth-gr <paarora@redhat.com>
the check validate_rgw_multisite was always checking for realm
updated it to check the specific config
fixed validate_rgw_endpoint pool validation
added missing realm zonegroup and zone while interacting with user resources
Co-authored-by: Sergio Pérez Fernández <sergioperez794@gmail.com>
Signed-off-by: parth-gr <paarora@redhat.com>
Add --skip-monitoring-endpoint to create-external-cluster-resources.py
to allow the script to work with Ceph clusters without an enabled
prometheus module.
Document the new flag in external-cluster.md and add relevant unit tests
Signed-off-by: Angelos Kolaitis <neoaggelos@gmail.com>
if restricted permission was on the . was appended to k8s secret and
failed to create the secret so added a alias name is user wan't to suuport
pool with . in name
Signed-off-by: parth-gr <paarora@redhat.com>
if the rge endint is not reachable don't block the creation
of rbd and cephfs sc, just print the error instead of raising exception
Signed-off-by: parth-gr <paarora@redhat.com>
if a cluster won't use the deafult realm and try to
execute the python script it will fail to vaildate rgw
as the rgw-admin-user would be created on default realm
So creating user in specific realm if the realm name is passed
Signed-off-by: parth-gr <paarora@redhat.com>
Currently for external clustr multitenancy is only applicable for new
deployments, but adding doc change so multi-tenancy can be achieved for
upgraded cluster also
Closes: https://github.com/rook/rook/issues/10678
Signed-off-by: parth-gr <paarora@redhat.com>
remove duplicate import urllib.parse which is handled below
with try and except no need to import separately. Also, change
the way to get the python version.
Signed-off-by: subhamkrai <srai@redhat.com>
The rgw ip validation feature was needing to update the rgw user
cap to add info=read permission, but this permission is only backported
till ceph pacific, so we added a check that only add this cap
when ceph version support it,
But this cap was also adding with the other caps, so removed it from there
Now it will only add this cap if ceph version support it
Signed-off-by: parth-gr <paarora@redhat.com>
Using subvolume group and rados namespace for external deployment
was complicated and not documented,
Automating the process for the users, so they just need to pass
the respective names by cli flag for creation
Closes: rook#10427
Signed-off-by: parth-gr <paarora@redhat.com>
For using restricted auth users we need to update the
restricted users in the Storage class, so updating
it in the json output for external cluster
Signed-off-by: parth-gr <paarora@redhat.com>
remove the restriction of per rados namespace as
there can be multiple namespaces and the csi-users
can only have 1 type in a storage class
Signed-off-by: parth-gr <paarora@redhat.com>
`black` is python formatter tool which
automatically formats python files without
manual changing. just run `black <python-file>`
and done.
Signed-off-by: subhamkrai <srai@redhat.com>
During the recent addtions of rgw validation
changes there are too many places where we use
rgwendpoint, so making fqdn to ip conversion globally
Signed-off-by: parth-gr <paarora@redhat.com>
Currently cephfs caps are data=filesystemname,
which only have write access, but not the read access
changing it to *=filesystemname so we can read data also
Signed-off-by: parth-gr <paarora@redhat.com>
Now rgw can be pass by FQDN too,
to avoid problems where it is required
The format should be similar to
Ip(<IP>:<PORT> format), <FQDN>:<PORT> format
Signed-off-by: parth-gr <paarora@redhat.com>
Currently it was mention we are updating the csi-user
But more precisely we go and update the keyrings
which auto update users so replacing it
Signed-off-by: parth-gr <paarora@redhat.com>
The ceph-external-cluster-details-exporter.py
generates the json output even with
rgw-endpoint IP from different cluster
Added a check validate_rgw_endpoint which will validate
the above rgw_endpoint Ip by matching the cluster fsid
Signed-off-by: parth-gr <paarora@redhat.com>
Corrected RGW_ADMIN_OPS_USER_ACCESS_KEY and
RGW_ADMIN_OPS_USER_SECRET_KEY so it should be
output correctely when called script with
bash format output
Signed-off-by: parth-gr <paarora@redhat.com>
Corrected CSI_RBD_NODE_SECRET name so it should be
output correctely when called script with
bash format output
Signed-off-by: parth-gr <paarora@redhat.com>
pylint was failing with used-before-assignment error
fixed it by making the variables assignmet before it was used
Also backward compatibility is removed from the ModuleNotFoundError import,
as we auto installed python3 version on ceph standalone
Signed-off-by: parth-gr <paarora@redhat.com>
When using dry-run option with external script, out_map dictionary
doesn't contain keys ( ACCESS_KEY and SECRET_KEY ) which leads to KeyError.
This fix to avoid creating json_out incase of dry-run since we will not use
json_out for dry-run.
Signed-off-by: vavuthu <vavuthu@redhat.com>
When using dry-run option with external script, function create_rgw_admin_ops_user
is not returning expected values which leads to TypeError. This fix is to append
values to out_map dictionary only in case of actual run.
Signed-off-by: vavuthu <vavuthu@redhat.com>
The upgrade function doesn't seem to be that smart
for now so it can update the new auth caps listed
with the existing one, it only compares the value of
the current cap with the MIN_USER_CAP_PERMISSIONS,
Modified the upgrade flag functionality so we can use
this while upgrading the cluster clients
Closes: https://github.com/rook/rook/issues/9589
Signed-off-by: parth-gr <paarora@redhat.com>
The CSI users created by the external script(both for rbd and cephfs)
need the blocklist capability so the CSI pods can execute the
`osd blocklist` commands for metro DR
update the mon caps of csi users with `profile simple-rados-client-with-blocklist`
so they have privileges to run osd blocklist cmds
Closes: https://issues.redhat.com/browse/RHSTOR-2451
Signed-off-by: parth-gr <paarora@redhat.com>
Added a clusterName, poolName , filesystemName, radosNamespace
as a suffix on ceph auth principals for external cluster so
every csi authentication would be unique if
restricted_auth_permission flag is specified.
Closes: https://github.com/rook/rook/issues/9192
Signed-off-by: parth-gr <paarora@redhat.com>