From 0e89d363576d36486ac714662bedfee602d4c781 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Wed, 20 Nov 2019 17:59:34 +0100 Subject: [PATCH 1/3] Enables the debug endpoint that the registry refers to in the REST response on /v2/ on some occasions when the storage backend is inaccessible --- registry/generic/config.yml | 2 ++ registry/generic/deployment.yaml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/registry/generic/config.yml b/registry/generic/config.yml index f0e26b19..d0d46d07 100644 --- a/registry/generic/config.yml +++ b/registry/generic/config.yml @@ -8,6 +8,8 @@ storage: http: headers: X-Content-Type-Options: [nosniff] + debug: + addr: 0.0.0.0:5001 health: storagedriver: enabled: true diff --git a/registry/generic/deployment.yaml b/registry/generic/deployment.yaml index 6dc60d8e..90ddf3f2 100644 --- a/registry/generic/deployment.yaml +++ b/registry/generic/deployment.yaml @@ -28,6 +28,9 @@ spec: - containerPort: 80 name: registry protocol: TCP + - containerPort: 5001 + name: debug + protocol: TCP env: - name: REGISTRY_HTTP_SECRET valueFrom: From 21fcb74d40416ee99f08c1fca2c6fd05983d3000 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Thu, 21 Nov 2019 06:47:48 +0100 Subject: [PATCH 2/3] Maybe, but / seems to align quite well with health, though possiblly too optimistic in that registries can get ready on start and the unready again because storage never started to work --- .../generic/debug-endpoint-readiness-probe.yaml | 14 ++++++++++++++ registry/generic/kustomization.yaml | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 registry/generic/debug-endpoint-readiness-probe.yaml diff --git a/registry/generic/debug-endpoint-readiness-probe.yaml b/registry/generic/debug-endpoint-readiness-probe.yaml new file mode 100644 index 00000000..074eaf5c --- /dev/null +++ b/registry/generic/debug-endpoint-readiness-probe.yaml @@ -0,0 +1,14 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: registry +spec: + template: + spec: + containers: + - name: docker-v2 + readinessProbe: + httpGet: + path: /debug/health + port: 5001 + scheme: HTTP diff --git a/registry/generic/kustomization.yaml b/registry/generic/kustomization.yaml index 5be5a7d8..2c98aa49 100644 --- a/registry/generic/kustomization.yaml +++ b/registry/generic/kustomization.yaml @@ -2,6 +2,8 @@ resources: - service-builds.yaml - service-prod-placeholder.yaml - deployment.yaml +patchesStrategicMerge: +- debug-endpoint-readiness-probe.yaml configMapGenerator: - name: registry-config files: From c3e738fb262db1976205368ce55976ee13483b6d Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Thu, 21 Nov 2019 06:56:10 +0100 Subject: [PATCH 3/3] All endpoints (tried /v2/ too) seem to assume readiness and after something like 30s start to fail because storage didn't go up --- .../generic/debug-endpoint-readiness-probe.yaml | 14 -------------- registry/generic/kustomization.yaml | 2 -- 2 files changed, 16 deletions(-) delete mode 100644 registry/generic/debug-endpoint-readiness-probe.yaml diff --git a/registry/generic/debug-endpoint-readiness-probe.yaml b/registry/generic/debug-endpoint-readiness-probe.yaml deleted file mode 100644 index 074eaf5c..00000000 --- a/registry/generic/debug-endpoint-readiness-probe.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: registry -spec: - template: - spec: - containers: - - name: docker-v2 - readinessProbe: - httpGet: - path: /debug/health - port: 5001 - scheme: HTTP diff --git a/registry/generic/kustomization.yaml b/registry/generic/kustomization.yaml index 2c98aa49..5be5a7d8 100644 --- a/registry/generic/kustomization.yaml +++ b/registry/generic/kustomization.yaml @@ -2,8 +2,6 @@ resources: - service-builds.yaml - service-prod-placeholder.yaml - deployment.yaml -patchesStrategicMerge: -- debug-endpoint-readiness-probe.yaml configMapGenerator: - name: registry-config files: