Skip to content

dsf okd customize v3 7

jodacalc edited this page Jun 6, 2019 · 3 revisions

Customize Openshift Origin v3.7 for devonfw

This is a guide to customize Openshift cluster. For more informaticon read the next:

Images Styles

The icons for templates must measure the same as below or the images don’t show right:

  • Openshift logo: 230px x 40px.

  • Template logo: 50px x 50px.

  • Category logo: 110px x 36px.

Quick Use

This is a quick example to add custom icons and categories inside openshift.

To modify the icons inside openshift, we must to modify our master-config.yaml of our openshift cluster. This file is inside the openshift container and to obtain a copy of it, we must to know what’s our openshift container name.

Obtain the master-config.yaml of our openshift cluster

Obtain the name of our openshift container

To obtain it, we can know it executing the next:

$ docker container ls
CONTAINER ID        IMAGE                                           COMMAND                  CREATED             STATUS              PORTS                                     NAMES
83a4e3acda5b        openshift/origin:v3.7.0                         "/usr/bin/openshift …"   6 days ago          Up 6 days                                                     origin

Here we can see that the name of the container is origin. Normaly the container it’s called as origin.

Copy the master-config.yaml of our openshift container to our directory

This file is inside the openshift container in the next directory: /var/lib/origin/openshift.local.config/master/master-config.yaml and we can copy it with the next command:

$ docker cp origin:/var/lib/origin/openshift.local.config/master/master-config.yaml ./

Now we have a file with the configuration of our openshift cluster.

Copy all customize files inside the openshift container

To use our customization of devonfw Openshift, we need to copy our files inside the openshift container.

To do this we need to copy the images, scripts and stylesheets from here inside openshift container, for example, we could put it all inside a folder called openshift.local.devonfw. On the step one we obtain the name of this container, for this example we assume that it’s called origin. Then our images are located inside openshift container and we can see an access it in /var/lib/origin/openshift.local.devonfw/images.

$ docker cp ./openshift.local.devonfw origin:/var/lib/origin/

Edit and copy the master-config.yaml to use our customize files

The master-config.yaml have a sections to charge our custom files. All this sections are inside the assetConfig and their names are the next:

  • The custom stylessheets are into extensionStylesheets.

  • The custom scripts are into extensionScripts.

  • The custom images are into extensions.

To use all our custom elements only need to add the directory routes of each element in their appropriate section of the master-config.yaml

...
assetConfig:
  ...
  extensionScripts:
  - /var/lib/origin/openshift.local.devonfw/scripts/catalog-categories.js
  extensionStylesheets:
  - /var/lib/origin/openshift.local.devonfw/stylesheet/icons.css
  extensions:
  - name: images
    sourceDirectory: /var/lib/origin/openshift.local.devonfw/images
  ...
...

Now we only need to copy that master-config.yaml inside openshift, and restart it to load the new configuration. To do that execute the next:

$ docker cp ./master-config.yaml origin:/var/lib/origin/openshift.local.config/master/master-config.yaml

To re-start openshift do oc cluster down and start again your persistent openshift cluster.

More information

Clone this wiki locally