Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 2. Image Registry Operator in OpenShift Container Platform
2.1. Image Registry on cloud platforms and OpenStack Link kopierenLink in die Zwischenablage kopiert!
The Image Registry Operator installs a single instance of the OpenShift image registry, and manages all registry configuration, including setting up registry storage.
Storage is only automatically configured when you install an installer-provisioned infrastructure cluster on AWS, Azure, Google Cloud, IBM®, or OpenStack.
When you install or upgrade an installer-provisioned infrastructure cluster on AWS, Azure, Google Cloud, IBM®, or OpenStack, the Image Registry Operator sets the
spec.storage.managementState
Managed
spec.storage.managementState
Unmanaged
After the control plane deploys, the Operator creates a default
configs.imageregistry.operator.openshift.io
If insufficient information is available to define a complete
configs.imageregistry.operator.openshift.io
The Image Registry Operator runs in the
openshift-image-registry
The Image Registry Operator’s behavior for managing the pruner is orthogonal to the
managementState
ClusterOperator
Managed
Pruning
However, the
managementState
-
: the
Managedflag for the image pruner is set to--prune-registry.true -
: the
Removedflag for the image pruner is set to--prune-registry, meaning it only prunes image metadata in etcd.false
2.2. Image Registry on bare metal, Nutanix, and vSphere Link kopierenLink in die Zwischenablage kopiert!
2.2.1. Image registry removed during installation Link kopierenLink in die Zwischenablage kopiert!
On platforms that do not provide shareable object storage, the OpenShift Image Registry Operator bootstraps itself as
Removed
openshift-installer
After installation, you must edit the Image Registry Operator configuration to switch the
managementState
Removed
Managed
2.3. Image Registry Operator distribution across availability zones Link kopierenLink in die Zwischenablage kopiert!
The default configuration of the Image Registry Operator spreads image registry pods across topology zones to prevent delayed recovery times in case of a complete zone failure where all pods are impacted.
The Image Registry Operator defaults to the following when deployed with a zone-related topology constraint:
Image Registry Operator deployed with a zone related topology constraint
topologySpreadConstraints:
- labelSelector:
matchLabels:
docker-registry: default
maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
- labelSelector:
matchLabels:
docker-registry: default
maxSkew: 1
topologyKey: node-role.kubernetes.io/worker
whenUnsatisfiable: DoNotSchedule
- labelSelector:
matchLabels:
docker-registry: default
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
The Image Registry Operator defaults to the following when deployed without a zone-related topology constraint, which applies to bare metal and vSphere instances:
Image Registry Operator deployed without a zone related topology constraint
topologySpreadConstraints:
- labelSelector:
matchLabels:
docker-registry: default
maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
- labelSelector:
matchLabels:
docker-registry: default
maxSkew: 1
topologyKey: node-role.kubernetes.io/worker
whenUnsatisfiable: DoNotSchedule
A cluster administrator can override the default
topologySpreadConstraints
configs.imageregistry.operator.openshift.io/cluster
2.5. Image Registry Operator configuration parameters Link kopierenLink in die Zwischenablage kopiert!
The
configs.imageregistry.operator.openshift.io
| Parameter | Description |
|---|---|
|
|
|
|
| Sets
The following values for
|
|
| Value needed by the registry to secure uploads, generated by default. |
|
| The
The following values for
|
|
| Defines the Proxy to be used when calling master API and upstream registries. |
|
| You can use the
Affinity settings can use the
|
|
|
|
|
| Indicates whether the registry instance should reject attempts to push new images or delete existing ones. |
|
| API Request Limit details. Controls how many parallel requests a given registry instance will handle before queuing additional requests. |
|
| Determines whether or not an external route is defined using the default hostname. If enabled, the route uses re-encrypt encryption. Defaults to
|
|
| Array of additional routes to create. You provide the hostname and certificate for the route. |
|
| Defines rollout strategy for the image registry deployment. Defaults to
|
|
| Replica count for the registry. |
|
| Controls whether to route all data through the registry, rather than redirecting to the back end. Defaults to
|
|
| The Image Registry Operator sets the
|
2.6. Enable the Image Registry default route with the Custom Resource Definition Link kopierenLink in die Zwischenablage kopiert!
In OpenShift Container Platform, the
Registry
configs.imageregistry.operator.openshift.io
If you need to automatically enable the Image Registry default route, patch the Image Registry Operator CRD.
Procedure
Patch the Image Registry Operator CRD:
$ oc patch configs.imageregistry.operator.openshift.io/cluster --type merge -p '{"spec":{"defaultRoute":true}}'
2.7. Configuring additional trust stores for image registry access Link kopierenLink in die Zwischenablage kopiert!
The
image.config.openshift.io/cluster
Prerequisites
- The certificate authorities (CA) must be PEM-encoded.
Procedure
You can create a config map in the
openshift-config
AdditionalTrustedCA
image.config.openshift.io
The config map key is the hostname of a registry with the port for which this CA is to be trusted, and the PEM certificate content is the value, for each additional registry CA to trust.
Image registry CA config map example
apiVersion: v1
kind: ConfigMap
metadata:
name: my-registry-ca
data:
registry.example.com: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
registry-with-port.example.com..5000: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
- 1
- If the registry has the port, such as
registry-with-port.example.com:5000,:should be replaced with...
You can configure additional CAs with the following procedure.
To configure an additional CA:
$ oc create configmap registry-config --from-file=<external_registry_address>=ca.crt -n openshift-config$ oc edit image.config.openshift.io clusterspec: additionalTrustedCA: name: registry-config
2.8. Configuring storage credentials for the Image Registry Operator Link kopierenLink in die Zwischenablage kopiert!
In addition to the
configs.imageregistry.operator.openshift.io
openshift-image-registry
The
image-registry-private-configuration-user
Procedure
Create an OpenShift Container Platform secret that contains the required keys.
$ oc create secret generic image-registry-private-configuration-user --from-literal=KEY1=value1 --from-literal=KEY2=value2 --namespace openshift-image-registry