Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa Próxima revisiónAmbos lados, revisión siguiente | ||
docs:virtualizacion:docker:swarm [2019/06/03 16:36] – [Docker Swarm Cheat-Sheet] rodolfo | docs:virtualizacion:docker:swarm [2020/04/02 14:05] – [Docker Swarm Cheat-Sheet] rodolfo | ||
---|---|---|---|
Línea 8: | Línea 8: | ||
Read all docker or containerization [[https:// | Read all docker or containerization [[https:// | ||
- | ===== Docker swarm commands for swarm management ===== | + | |
+ | [[https:// | ||
+ | |||
+ | ===== Swarm management ===== | ||
This set of command is used mainly to start, manage swarm cluster as a whole. For node management within cluster we have different set of commands following this section. | This set of command is used mainly to start, manage swarm cluster as a whole. For node management within cluster we have different set of commands following this section. | ||
- | docker swarm init : Initiate swam cluster | + | '' |
- | –advertise-addr : Advertised address on which swarm lives | + | * //–advertise-addr// : Advertised address on which swarm lives |
- | –autolock : Locks manager and display key which will be needed to unlock stopped manager | + | * //–autolock// : Locks manager and display key which will be needed to unlock stopped manager |
- | –force-new-cluster : Create new cluster from backup and dont attempt to connect to old known nodes | + | * //–force-new-cluster// : Create new cluster from backup and dont attempt to connect to old known nodes |
- | docker swarm join-token : Lists join security token to join another node in swarm as worker or manager | + | |
- | –quite : Only display token. By default it displays complete command to be used along with token. | + | |
- | –rotate : Rotate (change) token for security reasons. | + | |
- | docker swarm join : Join already running swarm as a worker or manager | + | |
- | –token : Security token to join swarm | + | |
- | –availability : Mark node’s status as active/ | + | |
- | docker swarm leave : Leave swarm. To be run from node itself | + | |
- | -f : Leave forcefully ignoring all warnings. | + | |
- | docker swarm unlock : Unlocks swarm by providing key after manager restarts | + | |
- | docker swarm unlock-key : Display swarm unlock key | + | |
- | -q : Only display token. | + | |
- | –rotate : Rotate (change) token for security reasons. | + | |
- | docker swarm update : Updates swarm configurations | + | |
- | –autolock : true/false. Turns on or off locking if not done while initiating. | + | |
- | ===== Docker | + | '' |
+ | * –quite : Only display token. By default it displays complete command to be used along with token. | ||
+ | * –rotate : Rotate (change) token for security reasons. | ||
+ | |||
+ | '' | ||
+ | * // | ||
+ | * // | ||
+ | |||
+ | '' | ||
+ | * //-f// : Leave forcefully ignoring all warnings. | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | * //-q// : Only display token. | ||
+ | * // | ||
+ | |||
+ | '' | ||
+ | * // | ||
+ | |||
+ | ===== Node management ===== | ||
Node is a server participating in Docker swarm. Node can either be worker or manager in swarm. Manager node has ability to manage swarm nodes and services along with serving workloads. Worker nodes can only serve workloads. | Node is a server participating in Docker swarm. Node can either be worker or manager in swarm. Manager node has ability to manage swarm nodes and services along with serving workloads. Worker nodes can only serve workloads. | ||
- | docker node ls : Lists nodes in swarm | + | '' |
- | -q : Only display node Ids | + | * //-q// : Only display node Ids |
- | –format : Format output using GO format | + | * //–format// : Format output using GO format |
- | –filter : Apply filters to output | + | * //–filter// : Apply filters to output |
- | docker node ps : Display tasks running on nodes | + | |
+ | '' | ||
Above all switches applies here too. | Above all switches applies here too. | ||
- | docker node promote : Promote node to manager role | ||
- | docker node demote : Demote node from manager to worker role | ||
- | docker node rm : Remove node from swarm. Run from manager node. | ||
- | -f : Force remove | ||
- | docker node inspect : Detailed information about node | ||
- | –format :Format output using GO format | ||
- | –pretty : Print in human readable friendly format | ||
- | docker node update : Update node configs | ||
- | –role : worker/ | ||
- | –availability : active/ | ||
- | ===== Docker swarm service commands for swarm service | + | '' |
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | * //-f// : Force remove | ||
+ | |||
+ | '' | ||
+ | * // | ||
+ | * // | ||
+ | |||
+ | '' | ||
+ | * //–role// : worker/ | ||
+ | * // | ||
+ | |||
+ | ===== Service | ||
Docker service is used to create and spawn workloads to swarm nodes. | Docker service is used to create and spawn workloads to swarm nodes. | ||
- | docker service create : Start new service in Docker swarm | + | '' |
- | Switches of docker container run command like -i (interactive), | + | |
- | docker service ls : List services | + | Switches of docker container run command like //-i// (interactive), |
- | –filter, –format and -q (quiet) switches which we saw above are supported with this command. | + | |
- | docker service ps : Lists tasks of services | + | '' |
- | –filter, –format and -q (quiet) switches which we saw above are supported with this command. | + | * //–filter//, //–format// and //-q// (quiet) switches which we saw above are supported with this command. |
- | docker service logs : Display logs of service or tasks | + | |
- | docker service rm : Remove service | + | '' |
- | -f : Force remove | + | * //–filter//, //–format// and //-q// (quiet) switches which we saw above are supported with this command. |
- | docker service update : Update service config | + | |
+ | '' | ||
+ | |||
+ | '' | ||
+ | * //-f// : Force remove | ||
+ | |||
+ | '' | ||
Most of the parameters defined in service create command can be updated here. | Most of the parameters defined in service create command can be updated here. | ||
- | docker service rollback : Revert back changes done in service config. | + | |
- | docker service scale : Scale one or more replicated services. | + | '' |
+ | |||
+ | '' | ||
servicename=number format | servicename=number format | ||
- | docker service inspect : Detailed in formation about service. | + | |
+ | '' | ||