diff --git a/apis/v1alpha1/defaulting.go b/apis/v1alpha1/defaulting.go index 9e41119..87226e9 100644 --- a/apis/v1alpha1/defaulting.go +++ b/apis/v1alpha1/defaulting.go @@ -398,11 +398,13 @@ func defaultStartupProbe() *corev1.Probe { Port: intstr.FromInt32(DefaultHTTPPort), }, }, - PeriodSeconds: 5, - // The StartupProbe can try up to 60 * 5 = 300 seconds to start the container. - // For some scenarios, the datanode may take a long time to start, so we set the failure threshold to 60. - FailureThreshold: 60, + // Check for the health endpoint every second to speed up the startup. + PeriodSeconds: 1, + + // The StartupProbe can try up to 300 * 1 = 300 seconds(5 minutes) to start the container. + // For some scenarios, the datanode may take a long time to start, so we set the failure threshold to 300. + FailureThreshold: 300, } } diff --git a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/merge/test00/expect.yaml b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/merge/test00/expect.yaml index e575d99..78bc9c8 100644 --- a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/merge/test00/expect.yaml +++ b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/merge/test00/expect.yaml @@ -43,8 +43,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 frontend: replicas: 1 httpPort: 9000 @@ -81,8 +81,8 @@ spec: httpGet: path: /health port: 9000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 resources: limits: cpu: 100m @@ -125,8 +125,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 resources: limits: cpu: 50m @@ -173,8 +173,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 resources: limits: cpu: 100m diff --git a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test00/expect.yaml b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test00/expect.yaml index 803d408..73b859f 100644 --- a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test00/expect.yaml +++ b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test00/expect.yaml @@ -36,8 +36,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 frontend: replicas: 1 httpPort: 4000 diff --git a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test01/expect.yaml b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test01/expect.yaml index 87b1340..3d4285b 100644 --- a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test01/expect.yaml +++ b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test01/expect.yaml @@ -36,8 +36,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 resources: requests: cpu: "500m" diff --git a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test02/expect.yaml b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test02/expect.yaml index be3f1ca..701c628 100644 --- a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test02/expect.yaml +++ b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test02/expect.yaml @@ -47,8 +47,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 frontend: replicas: 1 httpPort: 4000 diff --git a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test03/expect.yaml b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test03/expect.yaml index 1660311..3e13e7d 100644 --- a/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test03/expect.yaml +++ b/apis/v1alpha1/testdata/defaulting/greptimedbcluster/setdefaults/test03/expect.yaml @@ -23,8 +23,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 version: latest initializer: image: greptime/greptimedb-initializer:latest @@ -114,8 +114,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 datanodeStorage: dataHome: /data/greptimedb fs: diff --git a/apis/v1alpha1/testdata/defaulting/greptimedbstandalone/test00/expect.yaml b/apis/v1alpha1/testdata/defaulting/greptimedbstandalone/test00/expect.yaml index 3416ae0..86ded84 100644 --- a/apis/v1alpha1/testdata/defaulting/greptimedbstandalone/test00/expect.yaml +++ b/apis/v1alpha1/testdata/defaulting/greptimedbstandalone/test00/expect.yaml @@ -28,8 +28,8 @@ spec: httpGet: path: /health port: 4000 - periodSeconds: 5 - failureThreshold: 60 + periodSeconds: 1 + failureThreshold: 300 service: type: ClusterIP logging: