I am using docker-API module for accessing service list and the replica information. It works better in swarm-mode and on manager node. But if the app goes on worker node, it gives me the following error "unexpected - This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again". following is my code,
const Docker = require('node-docker-api').Docker
const docker = new Docker({ socketPath: '/var/run/docker.sock' })
const services = await docker.service.list()
Is it possible to get the service list on both node by giving any options or permissions to worker node? Also Is it possible to get by running app using docker-compose or kubernetes?