2.9.2. 既存のリモートマシンの設定
CDK を持つ既存のマシンを使用するには、以下のように設定する必要があります。
ホストから既存のリモートマシンへのパスワードなしの SSH を確立します。
Host$ ssh-copy-id <user>@<remote_IP_address> # Ensure that the user has sudo access without a password or use root Host$ ssh <user>@<remote_IP_address> # Ensure that this login works without a password
Host$ ssh-copy-id <user>@<remote_IP_address> # Ensure that the user has sudo access without a password or use root Host$ ssh <user>@<remote_IP_address> # Ensure that this login works without a passwordCopy to Clipboard Copied! Toggle word wrap Toggle overflow
CentOS 7、Red Hat Enterprise Linux 7、または Fedora (27 以降のバージョン) を使用している場合は、以下の手順を省略します。
既存のリモートマシンを設定します。
Remote_Machine$ yum install -y docker net-tools firewalld Remote_Machine$ systemctl start docker Remote_Machine$ systemctl enable docker Remote_Machine$ systemctl start firewalld Remote_Machine$ systemctl enable firewalld
Remote_Machine$ yum install -y docker net-tools firewalld Remote_Machine$ systemctl start docker Remote_Machine$ systemctl enable docker Remote_Machine$ systemctl start firewalld Remote_Machine$ systemctl enable firewalldCopy to Clipboard Copied! Toggle word wrap Toggle overflow TCP ポートの
2376、8443、および80が、リモートマシンのファイアウォールを通過するように許可して、ホストから通信できるようにします。Remote_Machine$ firewall-cmd --permanent --add-port 2376/tcp --add-port 8443/tcp --add-port 80/tcp
Remote_Machine$ firewall-cmd --permanent --add-port 2376/tcp --add-port 8443/tcp --add-port 80/tcpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Docker ブリッジネットワークのコンテナーサブネットを確認します。
Remote_Machine$ docker network inspect -f "{{range .IPAM.Config }}{{ .Subnet }}{{end}}" bridgeRemote_Machine$ docker network inspect -f "{{range .IPAM.Config }}{{ .Subnet }}{{end}}" bridgeCopy to Clipboard Copied! Toggle word wrap Toggle overflow このコマンドは、サブネット (例:
172.17.0.0/16) を表示します。Docker ブリッジネットワークのコンテナーサブネットを使用して、サブネットをソースとして使用してファイアウォールの minishift ゾーンを作成します。
Remote_Machine$ firewall-cmd --permanent --new-zone minishift Remote_Machine$ firewall-cmd --permanent --zone minishift --add-source <subnet>
Remote_Machine$ firewall-cmd --permanent --new-zone minishift Remote_Machine$ firewall-cmd --permanent --zone minishift --add-source <subnet>Copy to Clipboard Copied! Toggle word wrap Toggle overflow リモートマシンのファイアウォールを通過する UDP ポート
53および8053を許可し、コンテナーが OpenShift マスター API および DNS エンドポイントにアクセスできるようにします。Remote_Machine$ firewall-cmd --permanent --zone minishift --add-port 53/udp --add-port 8053/udp
Remote_Machine$ firewall-cmd --permanent --zone minishift --add-port 53/udp --add-port 8053/udpCopy to Clipboard Copied! Toggle word wrap Toggle overflow リモートマシンでファイアウォールを再読み込みします。
Remote_Machine$ firewall-cmd --reload
Remote_Machine$ firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow