OpenShift 4 Installation on Libvirt

From Dogtag
Jump to: navigation, search


This page describes the process to install OpenShift with libvirt based on Libvirt HOWTO.

Installing Dependencies

$ yum install golang-bin gcc-c++ libvirt-devel dep
$ yum install libvirt libvirt-devel libvirt-daemon-kvm qemu-kvm
$ systemctl enable --now libvirtd

Environment Variables

$ export GOPATH=$HOME/go
$ export PATH=$PATH:$GOPATH/bin

Configuring Permissions

$ cat <<EOF >> /etc/polkit-1/rules.d/80-libvirt.rules
polkit.addRule(function(action, subject) {
  if ( == "org.libvirt.unix.manage" && subject.local && && subject.isInGroup("wheel")) {
      return polkit.Result.YES;

Enabling IP Forwarding

Make sure IP forwarding is enabled:

$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1

Configuring libvirt

Edit /etc/libvirt/libvirtd.conf:

listen_tls = 0
listen_tcp = 1
tcp_port = "16509"

Edit /etc/sysconfig/libvirtd:



$ systemctl restart libvirtd

Configuring Firewall

Either disable firewall or allow connections from the IP range used by the cluster nodes. See Firewall.

Configuring Storage Pool

Make sure a default storage pool has been defined. See libvirt.

Configure NetworkManager DNS Overlay

Configure NetworkManager to use dnsmasq:

$ echo -e "[main]\ndns=dnsmasq" | tee /etc/NetworkManager/conf.d/openshift.conf

Configure dnsmasq to use the cluster:

$ echo server=/tt.testing/ | tee /etc/NetworkManager/dnsmasq.d/openshift.conf

Reload NetworkManager:

$ systemctl reload NetworkManager

Getting the Source Code

$ git clone $GOPATH/src/

Building OpenShift Installer

$ cd $GOPATH/src/
$ hack/

Installing OpenShift Cluster

$ bin/openshift-install create cluster --dir test

Removing OpenShift Cluster

$ bin/openshift-install destroy cluster

See Also