Skip to content

RegistryCacheConfig ​

The registrycacheconfigs.core.kyma-project.io CustomResourceDefinition (CRD) is a detailed description of the kind of data and the format used to configure a caching layer for a specific upstream container image registry. To get the up-to-date CRD and show the output in the yaml format, run this command:

bash
kubectl get crd registrycacheconfigs.core.kyma-project.io -o yaml

Overview ​

The user creates a RegistryCacheConfig custom resource (CR) to configure a caching layer for one upstream container image registry. Each resource targets a single upstream, for example, docker.io or my-registry.example.com:5000. Multiple RegistryCacheConfig resources can coexist in a cluster, but each upstream must be unique across all namespaces.

The resource is namespace-scoped and can be created in any namespace.

Sample Custom Resource ​

This is a sample RegistryCacheConfig resource that configures a cache for docker.io with a 100Gi volume and custom garbage collection TTL:

yaml
apiVersion: core.kyma-project.io/v1beta1
kind: RegistryCacheConfig
metadata:
  name: docker-cache
  namespace: my-namespace
spec:
  upstream: docker.io
  volume:
    size: 100Gi
  garbageCollection:
    ttl: 72h

Custom Resource Parameters ​

This table lists all the possible parameters of a RegistryCacheConfig resource together with their descriptions:

ParameterRequiredDefaultDescription
metadata.nameYes—Specifies the name of the CR.
metadata.namespaceYes—The namespace in which the CR is created.
spec.upstreamYes—The host (and optional port) of the upstream registry to cache. No scheme — for example, docker.io or my-registry.example.com:5000. Must be DNS-resolvable and unique across all RegistryCacheConfig resources in the cluster.
spec.remoteURLNohttps://<upstream>The remote registry URL in <scheme><host>[:<port>] format, where <scheme> is https:// or http://. If set, used as proxy.remoteurl in the registry configuration and as the server field in the containerd hosts.toml file.
spec.secretReferenceNameNo—The name of a Kubernetes Secret in the same namespace containing credentials for the upstream registry. The Secret must be immutable and contain exactly the username and password data keys.
spec.volume.sizeNo10GiThe size of the persistent volume for storing cached images. Immutable after creation.
spec.volume.storageClassNameNocluster defaultThe storage class for the persistent volume. Immutable after creation.
spec.garbageCollection.ttlNo168hThe time-to-live for cached images. Images not accessed within this duration are eligible for garbage collection. Set to 0s to disable. Cannot be re-enabled once disabled.
spec.proxy.httpProxyNo—Proxy server URL for HTTP connections used by the registry cache. Must start with http:// or https://.
spec.proxy.httpsProxyNo—Proxy server URL for HTTPS connections used by the registry cache. Must start with http:// or https://.
spec.http.tlsNotrueWhether TLS is enabled for the HTTP server of the registry cache.

Status Fields ​

FieldDescription
status.stateCurrent state of the resource. See State Values.
status.conditionsA list of Kubernetes standard conditions. Condition types: RegistryCacheValidated, RegistryCacheConfigured.

State Values ​

StateDescription
PendingThe resource has been accepted; the Kyma Control Plane is processing the configuration.
ReadyThe caching layer has been successfully configured for the upstream registry.
FailedThe configuration failed. Check status.conditions for the error message.

These components use this CR:

ComponentDescription
RegistryCacheConfig webhookValidates the CR on create and update before it is persisted.
Kyma Control Plane (KCP)Processes the CR and configures the caching layer on the target cluster.