Configuring Registry Cache ​
Create a RegistryCacheConfig custom resource (CR) to enable caching for an upstream container image registry in your SAP BTP, Kyma runtime instance.
Prerequisites ​
- You have a Kyma instance created.
- You have administrative access to the Kyma runtime with kubeconfig and kubectl. See Access a Kyma Instance Using kubectl.
- You have the Registry Cache module added. See Quick Install.
Context ​
RegistryCacheConfig is a namespace-scoped resource. You can create it in any namespace.
Procedure ​
Create the
testnamespace if it doesn't exist.bashkubectl create namespace testCreate a
RegistryCacheConfigCR.bashkubectl create -f - <<EOF apiVersion: core.kyma-project.io/v1beta1 kind: RegistryCacheConfig metadata: name: config1 namespace: test spec: upstream: docker.io volume: size: 100Gi EOFWhen applied, Kyma Control Plane (KCP) processes the resource and configures a caching layer for the specified upstream registry (in this case,
docker.io). The volume.size field specifies the size of the persistent volume used to store cached images.You can create multiple
RegistryCacheConfigresources to cache different upstream registries. Each resource must have a unique name, and each upstream registry must be unique across all resources in the cluster.To verify that KCP processed the resource successfully, check the resource status.
bashkubectl get registrycacheconfig <name> -n <namespace> -o jsonpath='{.status.state}'The expected output values are the following:
Pending— KCP is processing the configuration.Ready— the caching layer has been configured successfully.Error— KCP encountered an issue and is retrying. The state transitions toReadyautomatically when processing succeeds.