Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 2.63 KB

build.adoc

File metadata and controls

60 lines (41 loc) · 2.63 KB

Building the Origin Metrics Docker Images

If you wish to build your own Origin Metric docker images, the easiest way is to use the hack/build-images.sh script.

This will allow you to build all the docker images, as well as optionally push those images out to a docker registry.

The script takes the following parameters

  1. --prefix : This is applied to the beginning of your image names and can be used to specify the docker registry, user account and any other prefix desired.

  2. --version : The version tag to apply to the build images.

  3. --push : If you wish to push out your image to a docker registry

All the images must have the same prefix and version tag in order for the deployer to deploy them. Components with different prefixes or versions are not currently supported.

By default, the --prefix and --version values will correspond to docker.io/openshift/origin- and latest. The default build will create the following images:

openshift/origin-metrics-deployer
openshift/origin-metrics-heapster
openshift/origin-metrics-cassandra
openshift/origin-metrics-hawkular-metrics

If you wanted to build your images under the myName account with a version tag of devel and an image prefix of origin-, you would perform the following command:

$ cd hack
$ ./build-images.sh --prefix=myName/origin- --version=devel

If you wish to optionally build and push your images to a registry, you will just need to add the --push option

$ cd hack
$ ./build-images.sh --prefix=myName/origin- --version=devel --push
Note

The heapster base image is not build by default using the hack/build-images.sh. If you wish to build this image you will need to do so manually with its provided Dockerfile in the heapster-base directory.

Using the Built Images

If you have built the images with the default prefix and version then there is no extra step required when deploying the metrics components. The deployer will use these values as its defaults.

If you have built the images with a different prefix or version then you will need to set the IMAGE_PREFIX and IMAGE_VERSION template parameters when deploying the deployer.

For instance, if the prefix corresponded to myName/origin- and the version corresponded to latest, then the deployer command would look something like this:

oc process -f metrics.yaml \
 -v HAWKULAR_METRICS_HOSTNAME=hawkular-metrics.example.com -v IMAGE_PREFIX=myName/origin- -v IMAGE_VERSION=latest -v USE_PERSISTENT_STORAGE=false \
| oc create -f -