del self._drive_group_map[service_id]
self._save_drive_groups()
return f'Removed {service_name}'
+ elif service_type == 'ingress':
+ self.log.info("{0} service '{1}' does not exist".format('ingress', service_id))
+ return 'The Rook orchestrator does not currently support ingress'
else:
raise orchestrator.OrchestratorError(f'Service type {service_type} not supported')
@handle_orch_error
def apply_nfs(self, spec):
# type: (NFSServiceSpec) -> str
- return self.rook_cluster.apply_nfsgw(spec)
+ return self.rook_cluster.apply_nfsgw(spec, self)
@handle_orch_error
def remove_daemons(self, names: List[str]) -> List[str]:
from ceph.deployment.service_spec import ServiceSpec, NFSServiceSpec, RGWSpec, PlacementSpec, HostPlacementSpec
from ceph.utils import datetime_now
from ceph.deployment.drive_selection.matchers import SizeMatcher
+from nfs.cluster import create_ganesha_pool
+from nfs.module import Module
+from nfs.export import NFSRados
from mgr_module import NFS_POOL_NAME
from mgr_util import merge_dicts
import orchestrator
try:
- from rook.module import RookEnv
+ from rook.module import RookEnv, RookOrchestrator
except ImportError:
pass # just used for type checking.
cos.CephObjectStore, 'cephobjectstores', name,
_update_zone, _create_zone)
- def apply_nfsgw(self, spec: NFSServiceSpec) -> str:
+ def apply_nfsgw(self, spec: NFSServiceSpec, mgr: 'RookOrchestrator') -> str:
# TODO use spec.placement
# TODO warn if spec.extended has entries we don't kow how
# to action.
# TODO Number of pods should be based on the list of hosts in the
# PlacementSpec.
+ assert spec.service_id, "service id in NFS service spec cannot be an empty string or None " # for mypy typing
+ service_id = spec.service_id
+ mgr_module = cast(Module, mgr)
count = spec.placement.count or 1
def _update_nfs(new: cnfs.CephNFS) -> cnfs.CephNFS:
new.spec.server.active = count
),
spec=cnfs.Spec(
rados=cnfs.Rados(
- namespace=self.rook_env.namespace,
+ namespace=service_id,
pool=NFS_POOL_NAME,
),
server=cnfs.Server(
)
)
- rook_nfsgw.spec.rados.namespace = cast(str, spec.service_id)
return rook_nfsgw
- assert spec.service_id is not None
- return self._create_or_patch(cnfs.CephNFS, 'cephnfses', spec.service_id,
+ create_ganesha_pool(mgr)
+ NFSRados(mgr_module, service_id).write_obj('', f'conf-nfs.{spec.service_id}')
+ return self._create_or_patch(cnfs.CephNFS, 'cephnfses', service_id,
_update_nfs, _create_nfs)
def rm_service(self, rooktype: str, service_id: str) -> str: