To build the project clone the repository into your GOPATH
and run the
make
command.
To build the container images run the make images
command.
To deploy the application to an OpenShift cluster you will first need to
build the images and upload them to the image registry used by the
cluster. The images can be built and exported to .tar
files files with
the make tars
command:
$ make tars
$ ls *.tar | sort
unified-hybrid-cloud_clusters-service_latest.tar
unified-hybrid-cloud_customers-service_latest.tar
Those .tar
files can then be copied to the OpenShift cluster, and
uploaded to the image registry:
$ scp *.tar template.* myhost:.
$ ssh root@myhost
# docker load -i unified-hybrid-cloud_clusters-service_latest.tar
# docker load -i unified-hybrid-cloud_customers-service_latest.tar
Then the template.sh
script can be used to create and populate the
unified-hybrid-cloud
namespace:
$ ./template.sh
$ oc get pods -n unified-hybrid-cloud
NAME READY STATUS RESTARTS AGE
clusters-db-59dbb97d4f-qdmjw 1/1 Running 0 1m
clusters-service-6b4877b885-k7zg2 1/1 Running 0 1m
customers-db-6cc7fc8c49-7mh7t 1/1 Running 0 1m
customers-service-7dfdf5b6b5-hqznw 1/1 Running 0 1m
To undeploy the application remove the unified-hybrid-cloud
namespace:
$ oc delete namespace unified-hybrid-cloud
Install and setup Docker:
sudo dnf install docker
sudo systemctl start docker
Install and setup origin-clients:
dnf install origin-clients
Edit the /etc/containers/registries.conf
file and add the following lines:
[registries.insecure]
registries = ['172.30.0.0/16']
Install mercurial:
sudo yum install mercurial
Install the go-bindata and library and command line:
go get -u github.com/go-bindata/go-bindata/...
Run:
./hack/cluster-restart.sh
Install and setup Docker:
sudo yum install docker
Edit the /etc/docker/daemon.json
file and add the following
(if you already have some configuration there, just add the setting to the json file):
{
"group": "dockerroot",
"insecure-registries" : [ "172.30.0.0/16" ]
}
Restart docker:
sudo systemctl start docker
In order to get the origin-clients you’ll need to download that from
https://github.com/openshift/origin/releases
Install mercurial:
sudo yum install mercurial
Install the go-bindata and library and command line:
go get -u github.com/go-bindata/go-bindata/...
Run:
./hack/cluster-restart.sh