diff --git a/Documentation/CRDs/Cluster/external-cluster.md b/Documentation/CRDs/Cluster/external-cluster.md index aadf5314d..46a14aa70 100644 --- a/Documentation/CRDs/Cluster/external-cluster.md +++ b/Documentation/CRDs/Cluster/external-cluster.md @@ -44,6 +44,7 @@ python3 create-external-cluster-resources.py --rbd-data-pool-name -- - `--monitoring-endpoint-port`: (optional) Ceph Manager prometheus exporter port - `--skip-monitoring-endpoint`: (optional) Skip prometheus exporter endpoints, even if they are available. Useful if the prometheus module is not enabled - `--ceph-conf`: (optional) Provide a Ceph conf file +- `--keyring`: (optional) Path to Ceph keyring file, to be used with `--ceph-conf` - `--cluster-name`: (optional) Ceph cluster name - `--output`: (optional) Output will be stored into the provided file - `--dry-run`: (optional) Prints the executed commands without running them diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index 8380c1596..760533377 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -308,6 +308,9 @@ class RadosJSON: common_group.add_argument( "--ceph-conf", "-c", help="Provide a ceph conf file.", type=str ) + common_group.add_argument( + "--keyring", "-k", help="Path to ceph keyring file.", type=str + ) common_group.add_argument( "--run-as-user", "-u", @@ -617,6 +620,7 @@ class RadosJSON: self.run_as_user = self._arg_parser.run_as_user self.output_file = self._arg_parser.output self.ceph_conf = self._arg_parser.ceph_conf + self.ceph_keyring = self._arg_parser.keyring self.MIN_USER_CAP_PERMISSIONS = { "mgr": "allow command config", "mon": "allow r, allow command quorum_status, allow command version", @@ -632,7 +636,10 @@ class RadosJSON: if not self._arg_parser.rgw_pool_prefix and not self._arg_parser.upgrade: self._arg_parser.rgw_pool_prefix = self.DEFAULT_RGW_POOL_PREFIX if self.ceph_conf: - self.cluster = rados.Rados(conffile=self.ceph_conf) + kwargs = {} + if self.ceph_keyring: + kwargs["conf"] = {"keyring": self.ceph_keyring} + self.cluster = rados.Rados(conffile=self.ceph_conf, **kwargs) else: self.cluster = rados.Rados() self.cluster.conf_read_file()