Openshift_install_fedora

Posted by johara on May 23, 2019 · 5 mins read

So.. you want to install Openshift on Fedora? Confused by the myriad of installation options? Here, we run through step-by-step an easy installation of Openshift on Fedora 27, that will get you up and running in no time!

Docker rpm installation & configuration

Following step-by-step guide will allow you to install the latest version of docker and openshift origin on Fedora 27.

remove old versions of docker

$ sudo dnf remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

setup docker repository

  1. install dnf-plugins-core which provides command line tools to manage your dnf repo.

    $ sudo dnf -y install dnf-plugins-core
  2. configure the stable fedora repository

    $ sudo dnf config-manager \
      --add-repo \
      https://download.docker.com/linux/fedora/docker-ce.repo
  3. Optional: enable the edge and test repos, which are disabled by default in the docker.repo

    $ sudo dnf config-manager --set-enabled docker-ce-edge
    $ sudo dnf config-manager --set-enabled docker-ce-test

Install Docker-CE

  1. Install latest version of Docker-ce

    $ sudo dnf install docker-ce-17.12.1.ce-1.fc27.x86_64
    Currently, docker versions greater then 17.12 do not work correctly with openshift v3.9.0. If you use a more recent version, you will likely see the following expception "linux mounts: Could not find source mount of /var/lib/origin/openshift.local.volumes"
  2. Start Docker

    $ sudo systemctl start docker
  3. verfiy that the docker deamon is running correctly by running the hello-world image

    $ sudo docker run hello-world
    If installation has been successfull, you should see the following terminal output
       # sudo docker run hello-world
    
         Hello from Docker!
         This message shows that your installation appears to be working correctly.
  4. create docker group to manage docker service

    $ sudo groupadd docker
  5. add current user to docker group

    $ sudo usermod -aG docker $USER

    or a specific user

    $ sudo usermod -aG docker bob
  6. Log out and log back in again to ensure user has picked up the new group membership

  7. Test that you can use the docker service without sudo

    $ docker run hello-world

Openshift installation & configuration

  1. Download the binary from the Releases page. https://www.openshift.org/download.html

  2. Unpackage openshift server

    $ tar xvf openshift-origin-server-v3.9.0-191fece-linux-64bit.tar.gz
  3. Unpackage openshift client tool

    $ tar xvf openshift-origin-client-tools-v3.9.0-191fece-linux-64bit.tar.gz
  4. Ensure required packages are installed

    $ dnf install wget git net-tools bind-utils dnf-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct
  5. Ensure system is up to date

    $ dnf update
  6. Add the directory you untarred the release into to your path:

    $ export PATH="$(pwd)":$PATH
  7. Create a file /etc/docker/daemon.json with following content

    {
        "insecure-registries" : [ "hostname.cloudapp.net:5000" ]
    }
  8. Restart docker

    $ systemctl daemon-reload
    $ systemctl restart docker
  9. Launch the openshift cluster:

    $ oc cluster up

    If the above steps have been successful, you should see the following output

    # sudo oc cluster up
    Using nsenter mounter for OpenShift volumes
    Using 127.0.0.1 as the server IP
    Starting OpenShift using openshift/origin:v3.9.0 ...
    OpenShift server started.
    
    The server is accessible via web console at:
        https://127.0.0.1:8443
    
    You are logged in as:
        User:     developer
        Password: <any value>
    
    To login as administrator:
        oc login -u system:admin