Showing posts with label solved. Show all posts
Showing posts with label solved. Show all posts

Sunday, January 8, 2017

SOLVED: Add persistency to integrated OpenShift Origin container registry

While integrated container registry is very useful in some scenarios , i.e. you can push docker images there from your local docker/composer builds, but when cluster restarts all images are gone

Of course you can setup separate registry , but for small/local setups it's not so useful. More simple solution (though not scalable) just allow registry to keep images in filesystem on restart.

Making this is relatively simple.

  1. Allow registry to use host/node file system 

    oc login -u system:admin
    oc adm policy add-scc-to-user hostaccess -z registry -n default

     
  2. replace 'emptyDir' with 'hostPath' volume 

    oc edit dc/docker-registry -n default

    And change

          volumes:
          - emptyDir: {}
            name: registry-storage

    to

          volumes:
          - hostPath:
              path: /some/path/on/node
            name: registry-storage

     
  3. Ensure that path is writeable by group (root) - 775
  4. Re-deploy registry

    oc deploy docker-registry --latest --follow=true -n default





SOLVED: OpenShift events lifetime

OpenShift events are available under web console, "Monitoring" page  and via console 'oc get events'

Their default lifetime is very small (1 hour), because for big clusters thousands and millions of events create huge risk for stability.

But in case of local/small setups it's more useful to increase events lifetime.

in the 'master-config.yaml'  under kubernetesMasterConfig place something like

  apiServerArguments:
    event-ttl:
    - "48h"

to have 48 hours lifetime of events