twuni / docker-registry.helm

Helm chart for a Docker registry. Successor to stable/docker-registry chart.
Apache License 2.0
309 stars 146 forks source link

`s3.regionEndpoint` requires scheme #97

Closed 0xDEC0DE closed 4 months ago

0xDEC0DE commented 1 year ago

If configuring an S3-compatible object store with an endpoint that is not AWS, the transport scheme (http/https) must be provided, or the server will hang on start while logging no errors, and the liveness checks will eventually kill it, and force the pod into a crash/restart loop.

The docs provided in the values.yaml do not include a scheme, which leads to confusion.

Steps to reproduce

In the config.yaml:

docker-registry:
  storage: s3
  s3:
    region: my-region
    regionEndpoint: s3.compatible.storagedevice.local
    bucket: some-bucket

Deploy the chart

Expected result

The pod comes up and provides a registry

Actual behavior

The pod cannot actually talk to the S3 service, so it silently hangs until killed by the livenessProbe checks. Hilarity ensues.

Workaround

Provide the transport scheme when defining the endpoint:

    regionEndpoint: http://s3.compatible.storagedevice.local/

The provided values.yaml contraindicates this.

vyas-n commented 4 months ago

Sorry for the delay in reviewing the issue,

As of the current version of the helm chart (from my personal experience), the transport scheme isn't necessary for that helm value. I'm able to use Ceph's S3 Object Store endpoint without specifying the scheme.

s3.regionEndpoint: ceph-objectstore.<my-domain>

This value is passed into the registry container via the environment variable REGISTRY_STORAGE_S3_REGIONENDPOINT: https://github.com/twuni/docker-registry.helm/blob/d6bc315183422f0782d7537b2c93fbf09362fce1/templates/_helpers.tpl#L87

While the upstream container doesn't specify either, it appears that they do include the transportation scheme in their example values: https://distribution.github.io/distribution/about/configuration/

Since the ambiguity is confusing, I'll vote in favor of your change to specify the scheme in the endpoint URL. I'll do a quick test to confirm and post my findings in your PR #98.