!!! OpenShift

Just in case CF gets too expensive, how feasible would the OpenShift platform be as second choice?

Requirements:
* runnable jars 
* ease of use for developers (with no infrastructure hassle)
* service registry (run your own eureka or so ?)
* pricing

!! Pricing

Looking at [https://www.openshift.com/pricing/index.html] it says that running a "Medium Production gear" of 1GB costs $0.05 / hour. 
For a year this is 24x365x0.05 = __ $ 438,- per year__

!! Runnable jar.

Searched around a bit, came to [http://www.tearsofaunicorn.com/articles/2013/11/24/deploying-dropwizard-to-openshift.html]....  TBC

It says you should use a DIY cartridge, which then says:
{{{
The Do-It-Yourself (DIY) application type is a blank slate for trying unsupported languages, frameworks, and middleware on OpenShift. 
See the community site for examples of bringing your favorite framework to OpenShift.
OpenShift maintained
Receives automatic security updates
}}} 

Start to create a DIY project and enter my (ssh) git url, but it says :
{{{
Source code repository could not be cloned: 'git@github.com:metskem/demoapp1.git'. 
Git clone using SSH requires the OpenShift server to authenticate to the repository. Please verify the repository is correct, and try a non-SSH URL such as HTTPS.
}}}
So trying the https version [https://github.com/metskem/demoapp1.git]

It takes about a minute, then my app is created. It again warns me:
{{{
Disclaimer: This is an experimental cartridge that provides a way to try unsupported languages, frameworks, and middleware on OpenShift.
}}}

It provides me an [Overview page|https://openshift.redhat.com/app/console/application/583f185e2d5271b8c6000069-diy] and instructions how to do code changes:
{{{
git clone ssh://583f185e2d5271b8c6000069@diy-computerhok.rhcloud.com/~/git/diy.git/
cd diy/
}}}

My app of course fails because it requires one envvar ( %%warning How do I provide envvars in advance? Looks like I need the oc command for that %% )

The overview page BTW says my app is started, but it is not (I also get a 503, from a RedHat Apache server of course).

I can also ssh into my gear, the ui says ''ssh 583f185e2d5271b8c6000069@diy-computerhok.rhcloud.com'' .
{{{
[diy-computerhok.rhcloud.com /]\> lsb_release -a
LSB Version:	:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID:	RedHatEnterpriseServer
Description:	Red Hat Enterprise Linux Server release 6.7 (Santiago)
Release:	6.7
Codename:	Santiago
[diy-computerhok.rhcloud.com /]\> java -version
java version "1.7.0_121"
OpenJDK Runtime Environment (rhel-2.6.8.1.el6_8-i386 u121-b00)
OpenJDK Server VM (build 24.121-b00, mixed mode)
}}}

An old java version unfortunately.

! Download oc cli

See [Installing the cli|https://docs.openshift.com/enterprise/3.0/cli_reference/get_started_cli.html#installing-the-cli]. However, now I need a RedHat account.\\
I found another location to download the command: [http://repo.openshift3roadshow.com/clients/oc-linux.tar.gz]
Extracted this one and copied to /usr/local/bin.
Syntax:

%%collapsebox
__oc command syntax__ 

{{{
➜  ~ oc
Developer and Administrator Client

This client exposes commands for managing your applications, as well as lower level
tools to interact with each component of your system.

To create a new application, you can use the example app source. Login to your server and then
run new-app:

  $ oc login
  $ oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-hello-world.git

This will create an application based on the Docker image 'centos/ruby-22-centos7' that builds
the source code at 'github.com/openshift/ruby-hello-world.git'. A build will start automatically and
a deployment will start as soon as the build finishes.

Once your application is deployed, use the status, get, and describe commands to see more about
the created components:

  $ oc status
  $ oc describe deploymentconfig ruby-hello-world
  $ oc get pods

You'll be able to view the deployed application on the IP and port of the service that new-app
created for you.

You can easily switch between multiple projects using 'oc project <projectname>'.

Basic Commands:
  types        An introduction to concepts and types
  login        Log in to a server
  new-project  Request a new project
  new-app      Create a new application
  status       Show an overview of the current project
  project      Switch to another project

Build and Deploy Commands:
  start-build  Start a new build
  build-logs   Show logs from a build
  deploy       View, start, cancel, or retry a deployment
  rollback     Revert part of an application back to a previous deployment
  new-build    Create a new build configuration
  cancel-build Cancel a pending or running build
  import-image Imports images from a Docker registry
  scale        Change the number of pods in a deployment
  tag          Tag existing images into image streams

Application Modification Commands:
  get          Display one or many resources
  describe     Show details of a specific resource or group of resources
  edit         Edit a resource on the server
  env          Update the environment on a resource with a pod template
  volumes      Update volume on a resource with a pod template
  label        Update the labels on a resource
  annotate     Update the annotations on a resource
  expose       Expose a replicated application as a service or route
  stop         Deprecated: Gracefully shut down a resource by name or filename.
  delete       Delete resources by filenames, stdin, resources and names, or by resources and label selector.

Troubleshooting and Debugging Commands:
  explain      Documentation of resources.
  logs         Print the logs for a resource.
  rsh          Start a shell session in a pod
  rsync        Copy files between local filesystem and a pod
  exec         Execute a command in a container.
  port-forward Forward one or more local ports to a pod.
  proxy        Run a proxy to the Kubernetes API server

Advanced Commands:
  create       Create a resource by filename or stdin
  replace      Replace a resource by filename or stdin.
  patch        Update field(s) of a resource by stdin.
  process      Process a template into list of resources
  export       Export resources so they can be used elsewhere
  run          Run a particular image on the cluster.
  attach       Attach to a running container.
  policy       Manage authorization policy
  secrets      Manage secrets
  convert      Convert config files between different API versions

Settings Commands:
  logout       End the current server session
  config       Change configuration files for the client
  whoami       Return information about the current session

Other Commands:
  version      Display version
  help         Help about any command

Use "oc help <command>" for more information about a given command.
Use "oc options" for a list of global command-line options (applies to all commands).
}}}

%%

----
[{ALLOW edit metskem}]