Run Against An Existing Machine

Overview

Minishift can be run against an existing remote machine using vm-driver as generic.

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

Configuring an Existing Remote Machine

To use an existing machine with Minishift, it needs to be configured as follows:

Establish password-less SSH from the host to the existing remote machine:

  1. Host$ ssh-copy-id <user>@<remote_IP_address> # Ensure that the user has sudo access without a password or use root
  2. Host$ ssh <user>@<remote_IP_address> # Ensure that this login works without a password

Skip the following steps if you are using CentOS 7, Red Hat Enterprise Linux 7 or Fedora (version > 26).

  1. Configure the existing remote machine:

    1. Remote_Machine$ yum install -y docker net-tools firewalld
    2. Remote_Machine$ systemctl start docker
    3. Remote_Machine$ systemctl enable docker
    4. Remote_Machine$ systemctl start firewalld
    5. Remote_Machine$ systemctl enable firewalld
  2. Allow the 2376, 8443, and 80 TCP ports through the firewall on the remote machine to have communication from the host:

    1. Remote_Machine$ firewall-cmd --permanent --add-port 2376/tcp --add-port 8443/tcp --add-port 80/tcp
  3. Determine the Docker bridge network container subnet:

    1. Remote_Machine$ docker network inspect -f "{{range .IPAM.Config }}{{ .Subnet }}{{end}}" bridge

    This command displays a subnet, such as 172.17.0.0/16.

  4. Using the Docker bridge network container subnet, create a minishift zone for the firewall with the subnet as its source:

    1. Remote_Machine$ firewall-cmd --permanent --new-zone minishift
    2. Remote_Machine$ firewall-cmd --permanent --zone minishift --add-source <subnet>
  5. 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:

    1. Remote_Machine$ firewall-cmd --permanent --zone minishift --add-port 53/udp --add-port 8053/udp
  6. Reload the firewall on the remote machine:

    1. Remote_Machine$ firewall-cmd --reload

Running Against an Existing Remote Machine

Use the following command on the host to run Minishift against a remote machine:

  1. $ minishift start --vm-driver generic --remote-ipaddress <remote_IP_address> --remote-ssh-user <username> --remote-ssh-key <private_ssh_key>
  2. $ minishift addon apply htpasswd-identity-provider --addon-env USER_PASSWORD=<NEW_PASSWORD>

The value of the —remote-ssh-key flag must be the location of a private SSH key on the host machine.

To change the default username and password, you must apply the htpasswd-identity-provider add-on with the desired username and password after running the minishift start command. By default, Minishift uses the Allow All identity provider. The Allow All identity provider allows any non-empty username and password to log in.