diff --git a/app/portainer/views/endpoints/edit/endpoint.html b/app/portainer/views/endpoints/edit/endpoint.html index b2a1d400a..c8792066e 100644 --- a/app/portainer/views/endpoints/edit/endpoint.html +++ b/app/portainer/views/endpoints/edit/endpoint.html @@ -28,7 +28,10 @@

- Deploy the Edge agent on your remote Docker environment using the following command + Deploy the Edge agent on your remote Docker environment using the following command(s) +

+

+ The agent will communicate with Portainer via {{ edgeKeyDetails.instanceURL }} and tcp://{{ edgeKeyDetails.tunnelServerAddr }}

@@ -40,6 +43,7 @@ --restart always \ -e EDGE=1 \ -e EDGE_ID={{ randomEdgeID }} \ + -e EDGE_KEY={{ endpoint.EdgeKey }} \ -e CAP_HOST_MANAGEMENT=1 \ -p 8000:80 \ -v portainer_agent_data:/data \ @@ -59,6 +63,7 @@ -e AGENT_CLUSTER_ADDR=tasks.portainer_edge_agent \ -e EDGE=1 \ -e EDGE_ID={{ randomEdgeID }} \ + -e EDGE_KEY={{ endpoint.EdgeKey }} \ -e CAP_HOST_MANAGEMENT=1 \ --mode global \ --publish mode=host,published=8000,target=80 \ @@ -83,10 +88,10 @@

- Use the following join token to associate the Edge agent with this endpoint + For those prestaging the edge agent, use the following join token to associate the Edge agent with this endpoint.

- The agent will communicate with Portainer via {{ edgeKeyDetails.instanceURL }} and tcp://{{ edgeKeyDetails.tunnelServerAddr }} + You can read more about pre-staging in the userguide available here.

diff --git a/app/portainer/views/endpoints/edit/endpointController.js b/app/portainer/views/endpoints/edit/endpointController.js index 9447d66b4..0309c197f 100644 --- a/app/portainer/views/endpoints/edit/endpointController.js +++ b/app/portainer/views/endpoints/edit/endpointController.js @@ -22,9 +22,9 @@ function ($q, $scope, $state, $transition$, $filter, clipboard, EndpointService, $scope.copyEdgeAgentDeploymentCommand = function() { if ($scope.state.deploymentTab === 0) { - clipboard.copyText('docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes -v /:/host --restart always -e EDGE=1 -e EDGE_ID=' + $scope.randomEdgeID +' -e CAP_HOST_MANAGEMENT=1 -p 8000:80 -v portainer_agent_data:/data --name portainer_edge_agent portainer/agent'); + clipboard.copyText('docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes -v /:/host --restart always -e EDGE=1 -e EDGE_ID=' + $scope.randomEdgeID + ' -e EDGE_KEY=' + $scope.endpoint.EdgeKey +' -e CAP_HOST_MANAGEMENT=1 -p 8000:80 -v portainer_agent_data:/data --name portainer_edge_agent portainer/agent'); } else { - clipboard.copyText('docker network create --driver overlay portainer_agent_network; docker service create --name portainer_edge_agent --network portainer_agent_network -e AGENT_CLUSTER_ADDR=tasks.portainer_edge_agent -e EDGE=1 -e EDGE_ID=' + $scope.randomEdgeID +' -e CAP_HOST_MANAGEMENT=1 --mode global --publish mode=host,published=8000,target=80 --constraint \'node.platform.os == linux\' --mount type=bind,src=//var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src=//var/lib/docker/volumes,dst=/var/lib/docker/volume --mount type=bind,src=//,dst=/host --mount type=volume,src=portainer_agent_data,dst=/data portainer/agent'); + clipboard.copyText('docker network create --driver overlay portainer_agent_network; docker service create --name portainer_edge_agent --network portainer_agent_network -e AGENT_CLUSTER_ADDR=tasks.portainer_edge_agent -e EDGE=1 -e EDGE_ID=' + $scope.randomEdgeID + ' -e EDGE_KEY=' + $scope.endpoint.EdgeKey +' -e CAP_HOST_MANAGEMENT=1 --mode global --publish mode=host,published=8000,target=80 --constraint \'node.platform.os == linux\' --mount type=bind,src=//var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src=//var/lib/docker/volumes,dst=/var/lib/docker/volume --mount type=bind,src=//,dst=/host --mount type=volume,src=portainer_agent_data,dst=/data portainer/agent'); } $('#copyNotificationDeploymentCommand').show().fadeOut(2500); };