According to the wiki, it's the chancellor in wartime (https://en.m.wikipedia.org/wiki/Bundeswehr). Either way, it's a civilian position that's temporarily filled by the ruling government which was democratically elected.
What counts as "war" though? Technically every President since Roosevelt has used military force without a formal declaration of war by Congress. And modern Germany is not a military power projecting hegemon. I can't imagine a civilian defense minister (who in a coalition government maybe isn't even the party of the chancellor) is ordering politically important drone strikes like the US President. If Germany was in similar role the system would quickly evolve that the Chancellor would order the military.
It's traditionally the head of state, so King makes sense. In Bulgaria the president is mostly a figurehead with very limited power (basically easily repeatable veto, appoint ambassadors and temporary cabinets when there's no active government pending elections), but is still the commander in chief of the armed forces.
The UK - as usual - is a patchwork of conflicting traditions.
There is no Royal Army. But all members of the armed forces, police, and certain prominent political appointments, swear an Oath of Allegiance to the monarch.
Note this is not to the country. And certainly not to the people. Not even to the Crown, which is a kind of abstract superclass of British monarchs in general.
The Royal Navy does not have to swear this oath. It exists by direct Royal Prerogative which means it's assumed to be loyal, pretty much by definition.
Indeed, my understanding is that the British Army was created by and legally answerable to Parliament, unlike the other armed forces. As you mentioned, a remain of mistrust after the monarch was restored to the throne after the civil war (though the navy did remain under the monarch's control). Also, there are royal units within the Army, but the whole of the army is not regimented in this way.
(Though I think that role might go to the chancellor in times of war. Not sure.)