openshift-evangelists / vagrant-origin

[DEPRECATED] Use https://github.com/minishift/minishift
Apache License 2.0
61 stars 35 forks source link

== OpenShift Origin Vagrant latest This repository let's you test using Vagrant a latest branch of an OpenShift Origin install

=== PRE-REQUISITES For this to work you need only 3 things:

The base box will be pulled down first time you run vagrant up:

It works with LibVirt and VirtualBox as there is default centos images for both.

NOTE: Windows users might need to install http://www.microsoft.com/en-us/download/details.aspx?id=8328[VC++ 2010] as https://github.com/mitchellh/vagrant/issues/6754[reported in Vagrant].

== USAGE For testing the latest Origin code, just do:


vagrant up

It will add a:

=== SCRIPTS The installation and configuration process consists of 5 scripts:

The execution of the provisioning scripts will happen just once (except for building and configuring Origin) unless forced. It will create a file names /..configured that can be deleted in order to rerun the script.

You can use a ENV (FORCE_DOCKER) with anyvalue that will force installing whatever addon you have selected

Just set any value to this ENV to work.

=== DIRS Default dirs used in the image:

=== CUSTOMIZATION If you want to customize the behaviour, you can use some Environment variables or modify link:config/config.env[], to create the environment or re-provision the environment:

For the generated VM (This Environment will be set on your host):

For the installation (This configuration will be in the VM or in link:config/config.env[])

You can of course do it on creation time:


echo "export OS_ORIGIN_REPO=spadgett" > config/config.env echo "export ORIGIN_BRANCH=route-named-ports" >> config/config.env vagrant up

Or a later provisioning:


vagrant ssh sudo -i echo "export OS_ORIGIN_REPO=spadgett" > /config/config.env echo "export OS_ORIGIN_BRANCH=route-named-ports" >> /config/config.env echo "export __OS_ACTION=clean" >> /config/config.env /scripts/install.sh

=== CUSTOMIZATION USING .env FILES You can add all your customizations to an environment file link:config/config.env[] before you create the VM with vagrant up command.

=== USERS Any user with any password will login as a regular user. If you want to access as an admin user, you need to use admin as the username. This user has cluster-admin role.

=== RUNNING IMAGES This VM is meant for development purposes, so it's allowed to run any image as anyuid, allowing to run images made to run as root.

== NFS mounts available in the VM The VM will ship by default with 10 NFS mounts in mode rw,root_squash available at /nfsvolumes/pv{01..10}.

All mounts have a corresponding PV created with ReadWriteOnce and ReadWriteMany capabilities and Recycle policy, and with a default capacity of 10 Gi.

If a user wants to create their own PV there's a script that can be run in the VM to do so (as root):

/scripts/nfs/create-nfs-volume <VOLUME_NAME> [<VOLUME_SIZE> [<NFS_OPTIONS>]]

== VMs Docker Registry OpenShift internal registry is exposed and available at hub.10.2.2.2.xip.io but it's not secured. To access the registry you need to add it to the list of insecure registries for your docker daemon and reload the daemon. Then you'll be able to pull/push images to the registry.

See details https://docs.openshift.org/latest/install_config/install/docker_registry.html[here]

== Metrics The VM can be installed with metrics framework installed. If you don't want to use it, there's 2 scripts to enable/disable them, that can be run by any logged in user in the VM.

To enable metrics:


vagrant ssh oc login -u user # This step is only required if there's no user logged in enable-metrics

To disable metrics:


vagrant ssh oc login -u user # This step is only required if there's no user logged in disable-metrics

NOTE: You'll need to access the hawkular endpoint and accept it's self signed certificate to see metrics in the pods

=== Metrics Configuration By default, metrics will be installed in the openshift-infra project and accesible at: link:https://hawkular-metrics.apps.10.2.2.2.xip.io/[]

== Logging The VM can be installed with logging framework installed. If you don't want to use it, there's 2 scripts to enable/disable them, that can be run by any logged in user in the VM.

To enable logging:


vagrant ssh oc login -u user # This step is only required if there's no user logged in enable-logging

To disable logging:


vagrant ssh oc login -u user # This step is only required if there's no user logged in disable-logging

=== Logging Configuration By default, logging will be installed in the openshift-infra project and accesible at: link:https://kibana.apps.10.2.2.2.xip.io/[]

== Cockpit The VM will be installed with cockpit for OpenShift in it's own project. You can access cockpit's console at link:http://cockpit.apps.10.2.2.2.xip.io/[]. Use admin user as most of the functionalities require a cluster-admin to be executed.

== Exporting the VM If you want to export your image for others to use, you can do so via:

vagrant package --base origin --output openshift-origin-1.2.0.box

And then, you need to import the .box file, and use it with a new Vagrantfile.


$ vagrant box add -n openshift-origin openshift-origin-1.2.0.box

Use this minimum Vagrantfile


-- mode: ruby --

vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2" Vagrant.require_version ">= 1.7.2"

Vagrant.configure(2) do |config|

config.vm.box = "openshift-origin" config.vm.network "private_network", ip: "10.2.2.2" config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.hostname = "origin"

config.vm.provider "virtualbox" do |vb| vb.memory = "4096" vb.cpus = 2 vb.name = "openshift-origin" end end

And then just Vagrant up you new environment


$ vagrant up $ vagrant up --provider virtualbox

=== Scripted packaging There is some scripts to help package the VM in link:release/[]