Windows worker connection steps for Azure (#5279)

This commit is contained in:
Deep Debroy 2017-11-10 13:40:20 -08:00 committed by Misty Stanley-Jones
parent a24372ddde
commit 8f87edefb3
1 changed files with 27 additions and 36 deletions

View File

@ -4,11 +4,10 @@ keywords: azure, microsoft, iaas, deploy
title: Deploy your app on Docker for Azure
---
## Connecting to your manager nodes
## Connecting to your manager nodes using SSH
This section will walk you through connecting to your installation and deploying
applications. Instructions are included for both AWS and Azure, so be sure to
follow the instructions for the cloud provider of your choice in each section.
applications.
First, you will obtain the public IP address for a manager node. Any manager
node can be used for administrating the swarm.
@ -26,10 +25,6 @@ node) that you can use to log in to each manager node.
![](img/managers.png)
## Connecting via SSH
#### Manager nodes
Obtain the public IP and/or port for the manager node as instructed above and
use the provided SSH key to begin administrating your swarm and the unique port associated with a manager:
@ -48,40 +43,16 @@ You can also tunnel the Docker socket over SSH to remotely run commands on the c
If you don't want to pass `-H` when using the tunnel, you can set the `DOCKER_HOST` environment variable to point to the localhost tunnel opening.
### Worker nodes
## Connecting to your Linux worker nodes using SSH
As of Beta 13, the worker nodes also have SSH enabled when connecting from
manager nodes. SSH access is not possible to the worker nodes from the public
Internet. To access the worker nodes, you will need to first connect to a
manager node (see above).
On the manager node you can then `ssh` to the worker node, over the private
The Linux worker nodes have SSH enabled. SSH access is not possible to the worker nodes from the public
Internet directly. To access the worker nodes, you will need to first connect to a
manager node (see above) and then `ssh` to the worker node, over the private
network. Make sure you have SSH agent forwarding enabled (see below). If you run
the `docker node ls` command you can see the full list of nodes in your swarm.
You can then `ssh docker@<worker-host>` to get access to that node.
##### Azure
Prepend the domain from `/etc/resolv.conf` to the returned `HOSTNAME` in
`docker node ls`.
```
$ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
e5grdng229oazh79252fpbgcc swarm-worker000000 Ready Active
...
$ cat /etc/resolv.conf
# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
domain 2ct34bzag3fejkndbh0ypx4nnb.gx.internal.cloudapp.net
nameserver 168.63.129.16
# /etc/resolv.conf.tail can replace this line
$ ssh docker@swarm-worker000000.2ct34bzag3fejkndbh0ypx4nnb.gx.internal.cloudapp.net
```
##### Using SSH agent forwarding
##### Configuring SSH agent forwarding
SSH agent forwarding allows you to forward along your ssh keys when connecting from one node to another. This eliminates the need for installing your private key on all nodes you might want to connect from.
@ -132,6 +103,26 @@ To SSH in to the manager with the above settings:
$ ssh docker@manager0
```
## Connecting to your Windows worker nodes using RDP
The Windows worker nodes have RDP enabled. RDP access is not possible to the worker nodes from the public
Internet. To access the worker nodes using RDP, you will need to first connect to a
manager node (see above) over `ssh`, establish a SSH tunnel and then use RDP to connect to the worker node over the SSH tunnel.
To get started, first login to a manager node and determine the private IP address of the Windows worker VM:
```
$ docker node inspect <windows-worker-node-id> | jq -r ".[0].Status.Addr"
```
Next, in your local machine, establish the SSH tunnel to the manager for the RDP connection to the worker. The local port can be any free port and typically a high value e.g. 9001.
```
$ ssh -L <local-port>:<windows-worker-ip>:3389 -p <manager-ssh-port> docker@<manager-ip>
```
Finally you can use a RDP client on your local machine to connect to `local-host`:`local-port` and the connection will be forwarded to the RDP server running in the Windows worker node over the SSH tunnel created above.
## Running apps
You can now start creating containers and services.