ceph-salt icon indicating copy to clipboard operation
ceph-salt copied to clipboard

Remove check for admin_minion in cephadm_minions

Open tserong opened this issue 4 years ago • 13 comments

Currently, all minions with the 'admin' role are also required to have the 'cephadm' role. This means you can't have a node which has the ceph.conf file and admin keyring, which isn't also managed by the orchestrator. Can we change this? Because I want my salt master to have the 'admin' role (so I can run ceph commands from it), but I don't want the salt master to end up running ceph services (so it needs to not have the 'cephadm' role).

tserong avatar May 27 '20 05:05 tserong

If we make this change, we probably also need to add a separate check to ensure bootstrap_minion has the cephadm role. That's really the only requirement, right? The bootstrap minion must have both admin and cephadm roles. Any other node you want to run cluster services must have the cephadm role, and any node you want to be able to run ceph commands on must have the admin role, but the two are otherwise independent.

tserong avatar May 27 '20 06:05 tserong

The only issue I see with this change is that your ceph.conf will be outdated when you move monitors.

Note that we have a cephadm issue [1] to automatically update /etc/ceph/ceph.conf on all hosts, but if your admin minion is not managed by cephadm, then your ceph.conf will not be updated by cephadm.

Is this a problem? Perhaps ceph-salt should only distribute/copy the keyring file, not the ceph.conf. Or we need an explicit ceph-salt command to update /etc/ceph/ceph.conf on all admin minions (e.g. ceph-salt sync).

[1] https://tracker.ceph.com/issues/45378

ricardoasmarques avatar May 27 '20 12:05 ricardoasmarques

Dammit, I'd forgotten about that :-/

I guess this is really a variant on #217. The underlying issue is that I want to be able to have some node that will never host ceph services (so ceph orch apply mon won't randomly start a mon, or whatever), but that can still be an admin node.

I'm not sure what a good solution is here..

tserong avatar May 27 '20 12:05 tserong

ceph orch drain <host> add a flag to disable the scheduling for a specific host. See https://github.com/ceph/ceph/pull/34617

maybe we need to make this somehow explicit?

sebastian-philipp avatar May 27 '20 13:05 sebastian-philipp

Once that goes in, we could possibly revert the cephadm role (sorry!) then just rely on the user setting ceph orch drain on any host they don't want services scheduled on... Although using the term "drain" for this purpose, when your intent is to exclude a node from the outset strikes me as a bit odd :-)

tserong avatar May 28 '20 03:05 tserong

What about something like:

if minion has role 'admin' or 'cephadm':
  - then do "ceph orch host add $minion"
if minion has role 'admin' and not has role 'cephadm':
  - then do "ceph orch drain $minion"

ricardoasmarques avatar May 28 '20 08:05 ricardoasmarques

Although using the term "drain" for this purpose, when your intent is to exclude a node from the outset strikes me as a bit odd :-)

That might be the reason that Kubernetes uses three terms for this: "drain" for initiating a thing called "eviction". Plus a node key called "NoSchedule"

sebastian-philipp avatar May 28 '20 08:05 sebastian-philipp

What about something like:

if minion has role 'admin' or 'cephadm':
  - then do "ceph orch host add $minion"
if minion has role 'admin' and not has role 'cephadm':
  - then do "ceph orch drain $minion"

LGTM!

tserong avatar May 28 '20 09:05 tserong

note that drain isn't implemented yet

sebastian-philipp avatar May 28 '20 09:05 sebastian-philipp

ack

tserong avatar May 28 '20 09:05 tserong

The "drain" PR was closed https://github.com/ceph/ceph/pull/34617 so we need to find a different solution

ricardoasmarques avatar Sep 09 '20 15:09 ricardoasmarques

indeed

sebastian-philipp avatar Sep 10 '20 14:09 sebastian-philipp

right now, there is no way to mark a host as "unschedulable" for new daemons. That might be enough for. Like a drain-light feature

sebastian-philipp avatar Sep 10 '20 14:09 sebastian-philipp