<commit_before>include::variables.adoc[]

= Run Against An Existing Machine
:icons:
:toc: macro
:toc-title:
:toclevels: 1

toc::[]

[[run-against-an-existing-machine-overview]]
== Overview

{project} can be run against an existing remote machine using `vm-driver` as `generic`.

[NOTE]
====
CentOS 7, Red Hat Enterprise Linux 7, and Fedora > 26 are the suggested Linux distributions for this feature.
====

[[configuring-existing-remote-machine]]
== Configuring an Existing Remote Machine

To use an existing machine with {project}, it needs to be configured as follows:

. Establish password-less SSH from the host to the existing remote machine:
+
----
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
----

. Configure the existing remote machine:
+
----
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
----

. Allow the `2376`, `8443`, and `80` TCP ports through the firewall on the remote machine to have communication from the host:
+
----
Remote_Machine$ firewall-cmd --permanent --add-port 2376/tcp --add-port 8443/tcp --add-port 80/tcp
----

. Determine the Docker bridge network container subnet:
+
----
Remote_Machine$ docker network inspect -f "{{range .IPAM.Config }}{{ .Subnet }}{{end}}" bridge
----
+
This command displays a subnet, such as `172.17.0.0/16`.

. Using the Docker bridge network container subnet, create a *minishift* zone for the firewall with the subnet as its source:
+
----
Remote_Machine$ firewall-cmd --permanent --new-zone minishift
Remote_Machine$ firewall-cmd --permanent --zone minishift --add-source <subnet>
----

. Allow the `53` and `8053` UDP ports through the firewall on the remote machine to allow containers to access the OpenShift master API and DNS endpoints:
+
----
Remote_Machine$ firewall-cmd --permanent --zone minishift --add-port 53/udp --add-port 8053/udp
----

. Reload the firewall on the remote machine:
+
----
Remote_Machine$ firewall-cmd --reload
----

[[running-against-existing-remote-machine]]
== Running Against an Existing Remote Machine

Use the following command on the host to run {project} against a remote machine:

----
$ minishift start --vm-driver generic --remote-ipaddress 10.1.1.1 --remote-ssh-user <username> --remote-ssh-key <private_ssh_key>
----

[NOTE]
====
The value of the `--remote-ssh-key` flag must be the location of a private SSH key on the host machine.
====<commit_msg>Issue #2602 amend explicit IP address reference<commit_after>include::variables.adoc[]

= Run Against An Existing Machine
:icons:
:toc: macro
:toc-title:
:toclevels: 1

toc::[]

[[run-against-an-existing-machine-overview]]
== Overview

{project} can be run against an existing remote machine using `vm-driver` as `generic`.

[NOTE]
====
CentOS 7, Red Hat Enterprise Linux 7, and Fedora > 26 are the suggested Linux distributions for this feature.
====

[[configuring-existing-remote-machine]]
== Configuring an Existing Remote Machine

To use an existing machine with {project}, it needs to be configured as follows:

. Establish password-less SSH from the host to the existing remote machine:
+
----
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
----

. Configure the existing remote machine:
+
----
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
----

. Allow the `2376`, `8443`, and `80` TCP ports through the firewall on the remote machine to have communication from the host:
+
----
Remote_Machine$ firewall-cmd --permanent --add-port 2376/tcp --add-port 8443/tcp --add-port 80/tcp
----

. Determine the Docker bridge network container subnet:
+
----
Remote_Machine$ docker network inspect -f "{{range .IPAM.Config }}{{ .Subnet }}{{end}}" bridge
----
+
This command displays a subnet, such as `172.17.0.0/16`.

. Using the Docker bridge network container subnet, create a *minishift* zone for the firewall with the subnet as its source:
+
----
Remote_Machine$ firewall-cmd --permanent --new-zone minishift
Remote_Machine$ firewall-cmd --permanent --zone minishift --add-source <subnet>
----

. Allow the `53` and `8053` UDP ports through the firewall on the remote machine to allow containers to access the OpenShift master API and DNS endpoints:
+
----
Remote_Machine$ firewall-cmd --permanent --zone minishift --add-port 53/udp --add-port 8053/udp
----

. Reload the firewall on the remote machine:
+
----
Remote_Machine$ firewall-cmd --reload
----

[[running-against-existing-remote-machine]]
== Running Against an Existing Remote Machine

Use the following command on the host to run {project} against a remote machine:

----
$ minishift start --vm-driver generic --remote-ipaddress <remote_IP_address> --remote-ssh-user <username> --remote-ssh-key <private_ssh_key>
----

[NOTE]
====
The value of the `--remote-ssh-key` flag must be the location of a private SSH key on the host machine.
====
{'fraction_non_alphanumeric': 0.11918337318374103, 'fraction_numerical': 0.018576420820305316, 'mean_word_length': 3.8902877697841727, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2887276', 'n_tokens_mistral': 1707, 'n_tokens_neox': 1568, 'n_words': 638}