]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: support for regex based host patterns
authorAdam King <adking@redhat.com>
Tue, 3 Oct 2023 23:06:10 +0000 (19:06 -0400)
committerAdam King <adking@redhat.com>
Fri, 15 Mar 2024 14:14:05 +0000 (10:14 -0400)
commit9bda3dec8b63c68a62b3c82a73211c70b567990b
tree4a4151814f6c0a098069a563dbab26ec350d3c6f
parent1df27247a676373423b9b5769ede23dff6dccf8f
mgr/cephadm: support for regex based host patterns

For example, with hosts vm-00, vm-01, and vm-02
I was able to provide the placement

service_type: node-exporter
service_name: node-exporter
placement:
  host_pattern:
    pattern: vm-00|vm-02
    pattern_type: regex

and it placed the node-exporter daemons on vm-00
and vm-02 but not vm-01. Obviously there are more
advanced scenarios that justify this than listing
two hosts, but using "|" as an OR like that is an
example of something you can't do with the fnmatch
version of the host pattern

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit f27790b057db667c48b1840472046db3d6d9c5f1)
src/pybind/mgr/cephadm/tests/test_scheduling.py
src/pybind/mgr/rook/rook_cluster.py
src/python-common/ceph/deployment/service_spec.py
src/python-common/ceph/tests/test_service_spec.py