Following my previous post, I’m explaining how to use Azure Blob Storage for OpenShift internal docker registry storage.
By default, OpenShift internal docker registry uses an ephemeral disk for storage. However, you can use Azure Blob Storage for docker registry storage.
This technology depends on Azure storage driver for Docker.
You can set up Azure Blob Storage in advance. You should retrieve storage account name
and storage account key
.
And you should create a container for the registry.
Now, save below yaml file as a registry-config.yaml
. Please replace <***> with your Azure Blob container values.
version: 0.1 log: level: debug http: addr: :5000 storage: cache: blobdescriptor: inmemory delete: enabled: true azure: accountname: <storage_account_name> accountkey: <storage_account_key> container: <storage_container_name> auth: openshift: realm: openshift middleware: registry: - name: openshift repository: - name: openshift options: acceptschema2: false pullthrough: true enforcequota: false projectcachettl: 1m blobrepositorycachettl: 10m storage: - name: openshift
Execute below commands as cluster-admin
.
$ oc secrets new registry-config config.yml=registry-config.yaml $ oc volume dc/docker-registry --add --type=secret \ --secret-name=registry-config -m /etc/docker/registry/ $ oc set env dc/docker-registry \ REGISTRY_CONFIGURATION_PATH=/etc/docker/registry/config.yml
Now new registry pod will be running with Azure Blob storage.