These instructions will help you run your services on OpenShift using MiniShift.
Make sure you have all prerequisites installed. Please check the list here.
Download and put minishift
in your $PATH by following steps here.
Verify installation by running following command, you should get version number.
minishift version
Please install and set up oc on your machine by visiting oc.
Verify installation by running following command, you should get version number.
oc version
make minishift-start
eval $(minishift docker-env)
make dev-openshift
Make sure that you have minishift running. you can check it using minishift status
. If not then start it using make minishift-start
target.
Please enter sudo password when prompted, it is needed in order to create an entry in the /etc/hosts
.
minishift ip
gives the IP address on which MiniShift is running. This automation creates a host entry as minishift.local
for that IP. This domain is whitelisted on fabric8-auth
.
After successfully starting minishift, configure your shell to use docker daemon from minishift using eval $(minishift docker-env)
.
Now it’s time to run fabric8-cluster
and it’s dependent services i.e. fabric8-auth
on OpenShift use following command:
make dev-openshift
This build uses the developer account for creating a project called fabric8-services
.
The above command then automates the process of running the containers on OpenShift in MiniShift by using openshift templates.
Once the cluster service is running, it will be available at http://f8cluster-fabric8-services.$(minishift_ip).nip.io/api.
If you wish to access the cluster Postgres database, it is available on the same host but on port 31002. Use the following command to connect with the Postgres client:
PGPASSWORD=mysecretpassword psql -h minishift.local -U postgres -d postgres -p 31002
However you can see auth service is running, and will be available at http://auth-fabric8-services.$(minishift_ip).nip.io/api.
If you wish to access the auth Postgres database, it is available on the same host but on port 31001. Use the following command to connect with the Postgres client:
PGPASSWORD=mysecretpassword psql -h minishift.local -U postgres -d postgres -p 31001
See the next sections for other make targets to run fabric8-cluster, fabric8-auth independently on minishift
Here, we are going to deploy auth
, cluster
, services on minishift.
We have make target defined to start minishift with required cpu’s and configuration.
make minishift-start
Please enter sudo password when prompted, it is needed in order to create an entry in the /etc/hosts
.
minishift ip
gives the IP address on which MiniShift is running. This automation creates a host entry as minishift.local
for that IP. This domain is whitelisted on fabric8-auth.
Make sure to verify that your console is configured to reuse the Minishift Docker daemon by running docker ps
command. You should be able to see running containers for origin.
If not then follow this guide to configure it.
To deploy auth service, we have following make target which will deploy required secrets, postgres DB and create routes for you.
make deploy-auth
Look for running pods using oc get pods
. You should be able to see two pods(auth-
, db-auth-
). First time it will take some time as it has download required container images.
You can get auth route by using oc get routes
. It should be in format auth-fabric8-services.${minishift ip}.nip.io
You can check status by hitting this in browser http://auth-fabric8-services.$(minishift_ip).nip.io/api/status
(e.g. http://auth-fabric8-services.192.168.42.177.nip.io/api/status
).
To deploy cluster service, we have following make target which will deploy required secrets, config map, postgres DB and create routes for you.
make deploy-cluster
Look for running pods using oc get pods
. You should be able to see two pods(f8cluster-
, db-f8cluster-
). First time it will take some time as it has download required container images.
You can get cluster route by using oc get routes
. It should be in format f8cluster-fabric8-services.${minishift ip}.nip.io
You can check status by hitting this in browser http://f8cluster-fabric8-services.${minishift_ip}.nip.io/api/status
(e.g. http://f8cluster-fabric8-services.192.168.42.177.nip.io/api/status
).
To deploy auth
, f8cluster
together we have following target:
make deploy-all
This removes both the f8cluster
and db-f8cluster
services from minishift.
make clean-cluster
However if you are working on cluster service and wants to redeploy latest code change by building container with latest binary. We have special target for it which will do that for you.
It won’t deploy required secrets and postgres db again. It’ll re-deploy cluster service only.
make redeploy-cluster