The OpenShift 3 architecture builds upon the flexibility and scalability of Docker and Kubernetes to deliver a powerful new Platform as a Service system. This article explains how to set up a development environment and get involved with this latest version of OpenShift.
There are multiple ways to start coding OpenShift.
The OpenShift team periodically publishes binaries to Github on the Releases page. These are Linux, Windows, or Mac OS X 64bit binaries (note that Mac and Windows are client only). You’ll need Docker installed on your local system (see the installation page if you’ve never installed Docker before).
The tar file for each platform contains a single binary openshift
which is the all-in-one OpenShift installation.
-
Use
sudo openshift start
to launch the server. Root access is required to create services due to the need to modify IPTables. See issue: kubernetes/kubernetes#1859. -
Use
osc -h <server> …
to connect to an OpenShift server -
Use
openshift help
to see more about the commands in the binary
You can develop OpenShift 3 on Windows, Mac, or Linux, but you’ll need Docker installed on Linux to actually launch containers.
Here’s how to get set up:
-
For Go, Git and optionally also Docker, follow the links below to get to installation information for these tools:
-
Next, create a Go workspace directory:
$ mkdir $HOME/go
-
In your
.bashrc
file or.bash_profile
file, set a GOPATH and update your PATH:export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin
-
Open up a new terminal or source the changes in your current terminal, and you’re ready to code.
To facilitate rapid development we’ve put together a Vagrantfile you can use to stand up a development environment.
-
Install VirtualBox (Ex:
yum install VirtualBox
) -
Clone the project and change into the directory:
$ mkdir -p $GOPATH/src/github.com/openshift $ cd $GOPATH/src/github.com/openshift $ git clone git://github.com/openshift/origin $ cd origin
-
Bring up the VM:
$ vagrant up
-
SSH in:
$ vagrant ssh
-
Run a build (ssh puts you into the correct origin directory):
$ cd /data/src/github.com/openshift/origin $ hack/build-go.sh
-
Start an OpenShift all-in-one server (includes everything you need to try OpenShift)
$ sudo systemctl start openshift
-
On your host system, try browsing to: https://localhost:8444
Tip
|
See https://github.com/openshift/vagrant-openshift for more advanced options |
Tip
|
In some cases (eg. after git pull), you might run make clean in the origin directory to clean up outdated compiled files.
|
If you are developing on a Linux host, then you need to ensure that Network Manager is ignoring the virtual box interfaces, otherwise they cause issues with multi-vm networking.
Follow these steps to ensure that virtual box interfaces are unmanaged:
-
Check the status of Network Manager devices:
$ nmcli d
-
If any devices whose name start with vboxnet* are not unmanaged, then they need to be added to NetworkManager configuration to be ignored.
$ cat /etc/NetworkManager/NetworkManager.conf
[keyfile] unmanaged-devices=mac:0a:00:27:00:00:00;mac:0a:00:27:00:00:01;mac:0a:00:27:00:00:02
-
One can use the following command to help generate the configuration:
$ ip link list | grep vboxnet -A 1 | grep link/ether | awk '{print "mac:" $2}' | paste -sd ";" -
Right now you can see what’s happening with OpenShift development at:
Here’s a quick summary of what we’re doing there:
This repo contains the OpenShift 3 Platform-as-a-Service, built on Kubernetes, along with some script-based examples of the openshift utility in action. Kubernetes is included in this repo for ease of development, and the version we include is periodically updated. In the future it will be possible to run OpenShift on top of an existing system.
Hacking OpenShift Origin:
To get started, fork the origin repo and then set up a local copy:
$ go get github.com/openshift/origin $ cd $GOPATH/src/github.com/openshift/origin $ git remote add <YOUR_GITHUB_USERNAME> [email protected]:<YOUR_GITHUB_USERNAME>/origin
From here, you can follow the Getting Started section of the README for a brief tour of OpenShift 3 functionality, which includes single and multi-container pod examples.
Ready to play with some code? Hop down and read up on our roadmap for ideas on where you can contribute.
If you are interested in contributing to Kubernetes directly:
Join the Kubernetes community and check out the contributing guide.
If you run into difficulties running OpenShift, start by reading through the troubleshooting guide.
The OpenShift project roadmap lives on Trello. Of particular interest to those who want to get involved with the OpenShift 3 architecture are the following topics:
These link to active and backlog tasks that the OpenShift team is planning or working on for Kubernetes development.
Reach out to the OpenShift team and other community contributors through IRC and our mailing list:
-
IRC: Hop onto the #openshift-dev channel on FreeNode.
-
E-mail: Join the OpenShift developers' mailing list.