diff --git a/examples/minioinstance-kes.yaml b/examples/minioinstance-kes.yaml index d25fdb8b965..d70e7e86af1 100644 --- a/examples/minioinstance-kes.yaml +++ b/examples/minioinstance-kes.yaml @@ -142,7 +142,8 @@ spec: ## restarts the pods if liveness checks fail. liveness: initialDelaySeconds: 120 - periodSeconds: 60 + periodSeconds: 15 + timeoutSeconds: 12 # should always greater than MINIO_API_READY_DEADLINE (which defaults to 10s) ## Readiness probe detects situations when MinIO server instance ## is not ready to accept traffic. Kubernetes doesn't forward ## traffic to the pod while readiness checks fail. @@ -150,7 +151,8 @@ spec: ## Disable this check if you're setting PodManagementPolicy to "OrderedReady". readiness: initialDelaySeconds: 120 - periodSeconds: 60 + periodSeconds: 15 + timeoutSeconds: 1 ## nodeSelector parameters for MinIO Pods. It specifies a map of key-value pairs. For the pod to be ## eligible to run on a node, the node must have each of the ## indicated key-value pairs as labels. diff --git a/examples/minioinstance-mcs.yaml b/examples/minioinstance-mcs.yaml index dd7bcbe3f66..4fe2126ab7b 100644 --- a/examples/minioinstance-mcs.yaml +++ b/examples/minioinstance-mcs.yaml @@ -133,7 +133,8 @@ spec: ## restarts the pods if liveness checks fail. liveness: initialDelaySeconds: 120 - periodSeconds: 60 + periodSeconds: 15 + timeoutSeconds: 12 # should always greater than MINIO_API_READY_DEADLINE (which defaults to 10s) ## Readiness probe detects situations when MinIO server instance ## is not ready to accept traffic. Kubernetes doesn't forward ## traffic to the pod while readiness checks fail. @@ -141,7 +142,8 @@ spec: ## Disable this check if you're setting PodManagementPolicy to "OrderedReady". readiness: initialDelaySeconds: 120 - periodSeconds: 60 + periodSeconds: 15 + timeoutSeconds: 1 ## nodeSelector parameters for MinIO Pods. It specifies a map of key-value pairs. For the pod to be ## eligible to run on a node, the node must have each of the ## indicated key-value pairs as labels. diff --git a/examples/minioinstance.yaml b/examples/minioinstance.yaml index e028e85c14a..633538976e9 100644 --- a/examples/minioinstance.yaml +++ b/examples/minioinstance.yaml @@ -100,8 +100,10 @@ spec: # value: storage ## Add environment variables to be set in MinIO container (https://github.com/minio/minio/tree/master/docs/config) # env: + # - name: MINIO_API_READY_DEADLINE + # value: "10s" # - name: MINIO_BROWSER - # value: "off" # to turn-off browser + # value: "off" # to turn-off browser # - name: MINIO_STORAGE_CLASS_STANDARD # value: "EC:2" ## Configure resource requests and limits for MinIO containers @@ -113,7 +115,8 @@ spec: ## restarts the pods if liveness checks fail. liveness: initialDelaySeconds: 120 - periodSeconds: 60 + periodSeconds: 15 + timeoutSeconds: 12 # should always greater than MINIO_API_READY_DEADLINE (which defaults to 10s) ## Readiness probe detects situations when MinIO server instance ## is not ready to accept traffic. Kubernetes doesn't forward ## traffic to the pod while readiness checks fail. @@ -121,7 +124,8 @@ spec: ## Disable this check if you're setting PodManagementPolicy to "OrderedReady". readiness: initialDelaySeconds: 120 - periodSeconds: 60 + periodSeconds: 15 + timeoutSeconds: 1 ## nodeSelector parameters for MinIO Pods. It specifies a map of key-value pairs. For the pod to be ## eligible to run on a node, the node must have each of the ## indicated key-value pairs as labels. diff --git a/pkg/apis/operator.min.io/v1/constants.go b/pkg/apis/operator.min.io/v1/constants.go index 19b80f2579a..33c8cfd97e9 100644 --- a/pkg/apis/operator.min.io/v1/constants.go +++ b/pkg/apis/operator.min.io/v1/constants.go @@ -94,7 +94,10 @@ const ReadinessPath = "/minio/health/ready" const ReadinessInitialDelay = 120 // ReadinessPeriod specifies the interval in calling the readiness endpoint -const ReadinessPeriod = 60 +const ReadinessPeriod = 15 + +// ReadinessTimeout specifies the timeout for the readiness probe to expect a response +const ReadinessTimeout = 12 // LivenessPath specifies the endpoint for liveness check const LivenessPath = "/minio/health/live" @@ -103,7 +106,10 @@ const LivenessPath = "/minio/health/live" const LivenessInitialDelay = 120 // LivenessPeriod specifies the interval in calling the liveness endpoint -const LivenessPeriod = 60 +const LivenessPeriod = 15 + +// LivenessTimeout specifies the timeout for the liveness probe to expect a response +const LivenessTimeout = 1 // MCS Related Constants diff --git a/pkg/apis/operator.min.io/v1/helper.go b/pkg/apis/operator.min.io/v1/helper.go index bd0af5d5d2f..adbb48fad65 100644 --- a/pkg/apis/operator.min.io/v1/helper.go +++ b/pkg/apis/operator.min.io/v1/helper.go @@ -179,6 +179,9 @@ func (mi *MinIOInstance) EnsureDefaults() *MinIOInstance { if mi.Spec.Readiness.PeriodSeconds == 0 { mi.Spec.Readiness.PeriodSeconds = ReadinessPeriod } + if mi.Spec.Readiness.TimeoutSeconds == 0 { + mi.Spec.Readiness.TimeoutSeconds = ReadinessTimeout + } } if mi.Spec.Liveness != nil { @@ -188,6 +191,9 @@ func (mi *MinIOInstance) EnsureDefaults() *MinIOInstance { if mi.Spec.Liveness.PeriodSeconds == 0 { mi.Spec.Liveness.PeriodSeconds = LivenessPeriod } + if mi.Spec.Liveness.TimeoutSeconds == 0 { + mi.Spec.Liveness.TimeoutSeconds = LivenessTimeout + } } if mi.HasMCSEnabled() { diff --git a/pkg/apis/operator.min.io/v1/types.go b/pkg/apis/operator.min.io/v1/types.go index c496734cbc6..10f76e4302f 100644 --- a/pkg/apis/operator.min.io/v1/types.go +++ b/pkg/apis/operator.min.io/v1/types.go @@ -158,12 +158,14 @@ type Zone struct { type Liveness struct { InitialDelaySeconds int32 `json:"initialDelaySeconds"` PeriodSeconds int32 `json:"periodSeconds"` + TimeoutSeconds int32 `json:"timeoutSeconds"` } // Readiness specifies the spec for liveness probe type Readiness struct { InitialDelaySeconds int32 `json:"initialDelaySeconds"` PeriodSeconds int32 `json:"periodSeconds"` + TimeoutSeconds int32 `json:"timeoutSeconds"` } // MCSConfig defines the specifications for MCS Deployment diff --git a/pkg/resources/statefulsets/minio-statefulset.go b/pkg/resources/statefulsets/minio-statefulset.go index eea22fc4143..146930b5dca 100644 --- a/pkg/resources/statefulsets/minio-statefulset.go +++ b/pkg/resources/statefulsets/minio-statefulset.go @@ -162,6 +162,7 @@ func probes(mi *miniov1.MinIOInstance) (readiness, liveness *corev1.Probe) { }, InitialDelaySeconds: mi.Spec.Readiness.InitialDelaySeconds, PeriodSeconds: mi.Spec.Readiness.PeriodSeconds, + TimeoutSeconds: mi.Spec.Readiness.TimeoutSeconds, } } @@ -176,6 +177,7 @@ func probes(mi *miniov1.MinIOInstance) (readiness, liveness *corev1.Probe) { }, InitialDelaySeconds: mi.Spec.Liveness.InitialDelaySeconds, PeriodSeconds: mi.Spec.Liveness.PeriodSeconds, + TimeoutSeconds: mi.Spec.Liveness.TimeoutSeconds, } }