Skip to content

Commit 39a82aa

Browse files
Merge pull request #732 from dmage/storage-health
Bug 2015459: Enable health check for storage driver
2 parents f4964a8 + b68ed81 commit 39a82aa

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

pkg/resource/podtemplatespec.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,23 @@ func generateLogLevel(cr *v1.Config) string {
4040
return "debug"
4141
}
4242

43+
// generateLivenessProbeConfig returns an HTTPS liveness probe for the image
44+
// registry.
4345
func generateLivenessProbeConfig() *corev1.Probe {
4446
probeConfig := generateProbeConfig()
45-
probeConfig.InitialDelaySeconds = 10
46-
47+
// Wait until the registry is ready to serve requests.
48+
probeConfig.InitialDelaySeconds = 5
4749
return probeConfig
4850
}
4951

52+
// generateReadinessProbeConfig returns an HTTPS readiness probe for the image
53+
// registry.
5054
func generateReadinessProbeConfig() *corev1.Probe {
51-
return generateProbeConfig()
55+
probeConfig := generateProbeConfig()
56+
// Wait until the registry checks its storage health before reporting
57+
// the registry as Ready.
58+
probeConfig.InitialDelaySeconds = 15
59+
return probeConfig
5260
}
5361

5462
func generateProbeConfig() *corev1.Probe {
@@ -157,6 +165,9 @@ func makePodTemplateSpec(coreClient coreset.CoreV1Interface, proxyLister configl
157165
corev1.EnvVar{Name: "REGISTRY_OPENSHIFT_QUOTA_ENABLED", Value: "true"},
158166
corev1.EnvVar{Name: "REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR", Value: "inmemory"},
159167
corev1.EnvVar{Name: "REGISTRY_STORAGE_DELETE_ENABLED", Value: "true"},
168+
corev1.EnvVar{Name: "REGISTRY_HEALTH_STORAGEDRIVER_ENABLED", Value: "true"},
169+
corev1.EnvVar{Name: "REGISTRY_HEALTH_STORAGEDRIVER_INTERVAL", Value: "10s"},
170+
corev1.EnvVar{Name: "REGISTRY_HEALTH_STORAGEDRIVER_THRESHOLD", Value: "1"},
160171
corev1.EnvVar{Name: "REGISTRY_OPENSHIFT_METRICS_ENABLED", Value: "true"},
161172
// TODO(dmage): sync with InternalRegistryHostname in origin
162173
corev1.EnvVar{Name: "REGISTRY_OPENSHIFT_SERVER_ADDR", Value: fmt.Sprintf("%s.%s.svc:%d", defaults.ServiceName, defaults.ImageRegistryOperatorNamespace, defaults.ContainerPort)},

0 commit comments

Comments
 (0)