mirror of
https://github.com/ceph/ceph
synced 2025-01-01 00:22:25 +00:00
Merge pull request #23702 from Rubab-Syed/rgw-orchestrator-rook
mgr/orchestrator: Add RGW service support Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
commit
86f3bcffa6
@ -174,6 +174,20 @@ class OrchestratorCli(MgrModule):
|
||||
)
|
||||
self._wait([completion])
|
||||
|
||||
return 0, "", "Success."
|
||||
elif svc_type == "rgw":
|
||||
store_name = cmd['svc_arg']
|
||||
|
||||
spec = orchestrator.StatelessServiceSpec()
|
||||
spec.name = store_name
|
||||
|
||||
completion = self._oremote(
|
||||
"add_stateless_service",
|
||||
svc_type,
|
||||
spec
|
||||
)
|
||||
self._wait([completion])
|
||||
|
||||
return 0, "", "Success."
|
||||
else:
|
||||
raise NotImplementedError(svc_type)
|
||||
|
@ -359,6 +359,10 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
|
||||
return RookWriteCompletion(
|
||||
lambda: self.rook_cluster.add_filesystem(spec), None,
|
||||
"Creating Filesystem services for {0}".format(spec.name))
|
||||
elif service_type == "rgw" :
|
||||
return RookWriteCompletion(
|
||||
lambda: self.rook_cluster.add_objectstore(spec), None,
|
||||
"Creating RGW services for {0}".format(spec.name))
|
||||
else:
|
||||
# TODO: RGW, NFS
|
||||
raise NotImplementedError(service_type)
|
||||
|
@ -218,6 +218,49 @@ class RookCluster(object):
|
||||
else:
|
||||
raise
|
||||
|
||||
def add_objectstore(self, spec):
|
||||
|
||||
rook_os = {
|
||||
"apiVersion": ROOK_API_NAME,
|
||||
"kind": "ObjectStore",
|
||||
"metadata": {
|
||||
"name": spec.name,
|
||||
"namespace": self.rook_namespace
|
||||
},
|
||||
"spec": {
|
||||
"metaDataPool": {
|
||||
"failureDomain": "host",
|
||||
"replicated": {
|
||||
"size": 1
|
||||
}
|
||||
},
|
||||
"dataPool": {
|
||||
"failureDomain": "osd",
|
||||
"replicated": {
|
||||
"size": 1
|
||||
}
|
||||
},
|
||||
"gateway": {
|
||||
"type": "s3",
|
||||
"port": 80,
|
||||
"instances": 1,
|
||||
"allNodes": False
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try:
|
||||
self.rook_api_post(
|
||||
"objectstores/",
|
||||
body=rook_os
|
||||
)
|
||||
except ApiException as e:
|
||||
if e.status == 409:
|
||||
log.info("ObjectStore '{0}' already exists".format(spec.name))
|
||||
# Idempotent, succeed.
|
||||
else:
|
||||
raise
|
||||
|
||||
def can_create_osd(self):
|
||||
current_cluster = self.rook_api_get(
|
||||
"clusters/{0}".format(self.cluster_name))
|
||||
|
Loading…
Reference in New Issue
Block a user