CONTAINER_INIT = True
MIN_PODMAN_VERSION = (2, 0, 2)
CGROUPS_SPLIT_PODMAN_VERSION = (2, 1, 0)
+PIDS_LIMIT_UNLIMITED_PODMAN_VERSION = (3, 4, 1)
CUSTOM_PS1 = r'[ceph: \u@\h \W]\$ '
DEFAULT_TIMEOUT = None # in seconds
DEFAULT_RETRY = 15
class Ceph(object):
daemons = ('mon', 'mgr', 'osd', 'mds', 'rgw', 'rbd-mirror',
'crash', 'cephfs-mirror', 'ceph-exporter')
+ gateways = ('iscsi', 'nfs')
##################################
# Useful for daemons like iscsi where the default pids-limit limits the number of luns
# per iscsi target or rgw where increasing the rgw_thread_pool_size to a value near
# the default pids-limit may cause the container to crash.
- if isinstance(ctx.container_engine, Podman):
+ if (
+ isinstance(ctx.container_engine, Podman)
+ and ctx.container_engine.version >= PIDS_LIMIT_UNLIMITED_PODMAN_VERSION
+ ):
container_args.append('--pids-limit=-1')
else:
container_args.append('--pids-limit=0')
envs.append('TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES=134217728')
if container_args is None:
container_args = []
+ if daemon_type in Ceph.daemons or daemon_type in Ceph.gateways:
+ set_pids_limit_unlimited(ctx, container_args)
if daemon_type in ['mon', 'osd']:
# mon and osd need privileged in order for libudev to query devices
privileged = True
if daemon_type == 'rgw':
entrypoint = '/usr/bin/radosgw'
name = 'client.rgw.%s' % daemon_id
- set_pids_limit_unlimited(ctx, container_args)
elif daemon_type == 'rbd-mirror':
entrypoint = '/usr/bin/rbd-mirror'
name = 'client.rbd-mirror.%s' % daemon_id
envs.extend(Keepalived.get_container_envs())
container_args.extend(['--cap-add=NET_ADMIN', '--cap-add=NET_RAW'])
elif daemon_type == CephIscsi.daemon_type:
- # Applies only on rbd-target-api as get_tcmu_runner_container()
- # removes all tcmu-runner arguments
entrypoint = CephIscsi.entrypoint
name = '%s.%s' % (daemon_type, daemon_id)
# So the container can modprobe iscsi_target_mod and have write perms
# to configfs we need to make this a privileged container.
privileged = True
- set_pids_limit_unlimited(ctx, container_args)
elif daemon_type == CustomContainer.daemon_type:
cc = CustomContainer.init(ctx, fsid, daemon_id)
entrypoint = cc.entrypoint