Remove Image from Registry ​
This tutorial shows how to remove a previously pushed image to the registry using the pure registry API or skopeo.
Prerequsities ​
- kubectl
- Kyma CLI v3
- skopeo (for the skopeo scenario)
- curl (for the registry API scenario)
Steps ​
- Enable the image manifests deletion functionality by changing the .spec.storage.deleteEnabled flag to
true:
bash
kubectl apply -n kyma-system -f - <<EOF
apiVersion: operator.kyma-project.io/v1alpha1
kind: DockerRegistry
metadata:
name: default
namespace: kyma-system
spec:
storage:
deleteEnabled: true
EOFOnce the DockerRegistry CR becomes Ready, you see the updated .status.deleteEnabled field with a new value.
yaml
...
status:
deleteEnabled: true- Push the image to the registry:
bash
kyma registry image-import <IMAGE_NAME>:<IMAGE_TAG>- Port-forward the registry service to another terminal:
bash
kubectl port-forward -n kyma-system svc/dockerregistry 5000:5000- Export registry credentials:
bash
export DR_USERNAME=$(kubectl get secret -n kyma-system dockerregistry-config -o jsonpath="{.data.username}" | base64 -d)
export DR_PASSWORD=$(kubectl get secret -n kyma-system dockerregistry-config -o jsonpath="{.data.password}" | base64 -d)