502 invalid gateway., AKA "What are the valid correct settings for gitlab docker registry in DO spaces, for omnibus gitlab? "

October 9, 2018 519 views
Docker DigitalOcean Storage Ubuntu 18.04

Using the instructions here https://docs.gitlab.com/ee/administration/container_registry.html#container-registry-storage-driver, I was trying to put my docker registry in s3 storage. The registry tries to go to AWS by default, eventually I figured out what to do, so in case there're some other lost souls out there trying to do the same thing and having no luck, here's the solution

I put the ruby snippet in my

registry['storage'] = {
    's3' => {
        'accesskey' => 's3-access-key',
        'secretkey' => 's3-secret-key-for-access-key',
        'bucket' => 'docker-registry',
        'region' => 'ams3',
    }
}```
Didn't work

2018-10-0917:13:03.86623 /var/cache/omnibus/src/registry/src/github.com/docker/distribution/cmd/registry/main.go:24 +0x2d
2018-10-09
17:13:04.89556 panic: Invalid region provided: ams3

How do I convince it to go to DO? I tried to use the setting from the DO backup documentation

I found some additional information here https://www.digitalocean.com/community/questions/docker-registry-with-spaces-as-storage, so I tried

'regionendpoint' => 'https://ams3.digitaloceanspaces.com'

Now I get a 503

Another bit of research brings me here https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/2429. Full snippet now looks like

registry['healthstoragedriverenabled'] = false
registry['storage'] = {
's3' => {
'accesskey' => 's3-access-key',
'secretkey' => 's3-secret-key-for-access-key',
'bucket' => 'docker-registry',
'region' => 'ams3',
'regionendpoint' => 'https://ams3.digitaloceanspaces.com'
}
}

Bingo!

Be the first one to answer this question.