Skip to content

Access a node without ssh #1019

Answered by till
till asked this question in Q&A
May 10, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

OK, for whoever comes next:

  1. I deployed a service (mode: global) so it gets deployed to each node. Had to make sure the docker.sock is mounted (:ro)
  2. Then I exec into the task to start a shell on the node:
docker run --privileged --pid=host -it alpine:3.8 nsenter -t 1 -m -u -n -i bash

And now I can run commands:

node-001 / # systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (8;;file://node-001.xxx/run/systemd/system/docker.service^G/run/systemd/system/docker.servic>
     Active: active (running) since Mon 2022-03-21 20:54:11 UTC; 1 year 1 month ago
TriggeredBy: ● docker.socket
       Docs: 8;;http://docs.docker.com^Ghttp://docs.docker.com8;;

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@pothos
Comment options

@till
Comment options

@till
Comment options

Answer selected by till
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants