Hi all,
i the last days the docker registry on our cluster(3.9) ran out of space. The
registry the is backed with glusterfs storage. This happened sometime in the
past so i expanded the volume used by the docker registry
* heketi-cli volume expand --volume <volume_id> --expand-size <size>
I needed to recreate the pvc with the new capacity and rollout the docker
registry DeploymentConfig to get it working.
This happened again yesterday and I wanted to figure out how to clean up the
registry instead of expanding it's size. It got 80G huge!
This is how i done that
* ssh to the master
# Add the system:image-pruner role: The service account used to run the
registry instances requires additional permissions in order to list some
resources.
Get the service account name:
* service_account=$(oc get -n default -o
jsonpath=$'system:serviceaccount:{.metadata.namespace}:{.spec.template.spec.serviceAccountName}\n'
dc/docker-registry)
# Add the system:image-pruner cluster role to the service account:
service_account=$(oc get -n default -o
jsonpath=$'system:serviceaccount:{.metadata.namespace}:{.spec.template.spec.serviceAccountName}\n'
dc/docker-registry)
* oc adm policy add-cluster-role-to-user system:image-pruner
${service_account}
# select the default project
* oc project default
# login as registry service account
* oc login -u system:serviceaccount:default:registry
# check prune dry run
* oc adm prune images --keep-tag-revisions=3 --keep-younger-than=60m
# run prune
* oc adm prune images --keep-tag-revisions=3 --keep-younger-than=60m
--confirm
#login again as admin
* oc login -u system:admin
The Registry size shrank into 4G ^^
I though i share this with you if you got a similar issue. If any body has a
better approach or any note on that, I will be happy if you contact me :)
Kind Regards,
Alix A.
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users