OpenShift Registry Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 13: Line 13:


=Info about the Current Registry=
=Info about the Current Registry=
The registry must be deployed for this to work, otherwise I suspect it will attempt to create a registry:


  oadm registry -o yaml
  oadm registry -o yaml
To be sure, run
oadm registry --dry-run


=Deploy a Registry=
=Deploy a Registry=
{{External|https://docs.openshift.com/container-platform/latest/install_config/registry/deploy_registry_existing_clusters.html#deploy-registry}}


Normally, this is not required as the standard installation procedure installs an [[OpenShift_Concepts#Integrated_Docker_Registry|integrated registry]] as part of the "[[OpenShift_Concepts#Default_Project|default]]" project. In case the registry was not installed as part of the procedure, or we want to deploy a registry dedicated to a project, use the following procedure.
Normally, this is not required as the standard installation procedure installs an [[OpenShift_Concepts#Integrated_Docker_Registry|integrated registry]] as part of the "[[OpenShift_Concepts#Default_Project|default]]" project. In case the registry was not installed as part of the procedure, or we want to deploy a registry dedicated to a project, use the following procedure.
Line 32: Line 40:
   [--images='registry.access.redhat.com/openshift3/ose-${component}:${version}']
   [--images='registry.access.redhat.com/openshift3/ose-${component}:${version}']


If you want the registry to store images on external storage, a persistent storage claim must be declared for the project, and then attached to the deployment config. <font color=red>TODO.</font>
If you want the registry to store images on external storage, a persistent storage claim must be declared for the project, and then attached to the deployment config.  
 
<font color=red>TODO, the Web interface allows to do that, capture the REST traffic and see what it does. Also see https://docs.openshift.com/container-platform/latest/install_config/registry/deploy_registry_existing_clusters.html#storage-for-the-registry
 
oc volume deploymentconfigs/docker-registry --add --name=registry-storage -t pvc \
    --claim-name=<pvc_name> --overwrite
</font>


{{Warn|If the current context was changed to contain a different project than "default", for the account used to execute [[oadm]], restore the "default" project context}}
{{Warn|If the current context was changed to contain a different project than "default", for the account used to execute [[oadm]], restore the "default" project context}}


  oc project default
  oc project default
<font color=red>TODO: https://docs.openshift.com/container-platform/latest/install_config/registry/deploy_registry_existing_clusters.html#deploy-registry</font>

Latest revision as of 01:20, 19 October 2017

External

Internal

Overview

Image Registries

Info about the Current Registry

The registry must be deployed for this to work, otherwise I suspect it will attempt to create a registry:

oadm registry -o yaml

To be sure, run

oadm registry --dry-run

Deploy a Registry

https://docs.openshift.com/container-platform/latest/install_config/registry/deploy_registry_existing_clusters.html#deploy-registry

Normally, this is not required as the standard installation procedure installs an integrated registry as part of the "default" project. In case the registry was not installed as part of the procedure, or we want to deploy a registry dedicated to a project, use the following procedure.

If the registry needs to be deployed into a project other than "default", change the current context by running oc project from the same account used to run oadm:

oc project <project-name>

If you intend to use "registry" as service account, it will be created by default by the registry creation procedure. Otherwise create the desired service account.

Create the registry. Note that this command will create a registry with an "empty dir", which is a temporary directory destroyed with the pod, so it is not suitable for anything else but a demo:

oadm registry 
  [--service-account=registry] 
  [--images='registry.access.redhat.com/openshift3/ose-${component}:${version}']

If you want the registry to store images on external storage, a persistent storage claim must be declared for the project, and then attached to the deployment config.

TODO, the Web interface allows to do that, capture the REST traffic and see what it does. Also see https://docs.openshift.com/container-platform/latest/install_config/registry/deploy_registry_existing_clusters.html#storage-for-the-registry

oc volume deploymentconfigs/docker-registry --add --name=registry-storage -t pvc \
    --claim-name=<pvc_name> --overwrite


If the current context was changed to contain a different project than "default", for the account used to execute oadm, restore the "default" project context

oc project default