Ensure that you have deployed the Portainer agent in your cluster first. You can use execute the following command on any manager node to deploy it.
curl -L https://downloads.portainer.io/agent-stack.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack.yml portainer-agent
Copy