Skip to content

Commit 4d8b758

Browse files
yacovmmaru-avaStephenButtolph
authored
Adjust free disk space thresholds (#4514)
Signed-off-by: Yacov Manevich <[email protected]> Co-authored-by: maru <[email protected]> Co-authored-by: Stephen Buttolph <[email protected]>
1 parent 9f0f11d commit 4d8b758

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

config/flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ func addNodeFlags(fs *pflag.FlagSet) {
357357
fs.Duration(SystemTrackerProcessingHalflifeKey, 15*time.Second, "Halflife to use for the processing requests tracker. Larger halflife --> usage metrics change more slowly")
358358
fs.Duration(SystemTrackerCPUHalflifeKey, 15*time.Second, "Halflife to use for the cpu tracker. Larger halflife --> cpu usage metrics change more slowly")
359359
fs.Duration(SystemTrackerDiskHalflifeKey, time.Minute, "Halflife to use for the disk tracker. Larger halflife --> disk usage metrics change more slowly")
360-
fs.Uint64(SystemTrackerRequiredAvailableDiskSpaceKey, units.GiB/2, "Minimum number of available bytes on disk, under which the node will shutdown.")
361-
fs.Uint64(SystemTrackerWarningThresholdAvailableDiskSpaceKey, units.GiB, fmt.Sprintf("Warning threshold for the number of available bytes on disk, under which the node will be considered unhealthy. Must be >= [%s]", SystemTrackerRequiredAvailableDiskSpaceKey))
360+
fs.Uint64(SystemTrackerRequiredAvailableDiskSpaceKey, 10*units.GiB, "Minimum number of available bytes on disk, under which the node will shutdown.")
361+
fs.Uint64(SystemTrackerWarningThresholdAvailableDiskSpaceKey, 200*units.GiB, fmt.Sprintf("Warning threshold for the number of available bytes on disk, under which the node will be considered unhealthy. Must be >= [%s]", SystemTrackerRequiredAvailableDiskSpaceKey))
362362

363363
// CPU management
364364
fs.Float64(CPUVdrAllocKey, float64(runtime.NumCPU()), "Maximum number of CPUs to allocate for use by validators. Value should be in range [0, total core count]")

tests/fixture/bootstrapmonitor/e2e/e2e_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
2727
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet/flags"
2828
"github.com/ava-labs/avalanchego/utils/constants"
29+
"github.com/ava-labs/avalanchego/utils/logging"
2930

3031
appsv1 "k8s.io/api/apps/v1"
3132
corev1 "k8s.io/api/core/v1"
@@ -286,7 +287,17 @@ func newNodeStatefulSet(name string, flags tmpnet.FlagsMap) *appsv1.StatefulSet
286287
}
287288

288289
func defaultPodFlags() map[string]string {
289-
return tmpnet.DefaultPodFlags(constants.LocalName, nodeDataDir)
290+
flags := tmpnet.FlagsMap{
291+
config.DataDirKey: nodeDataDir,
292+
config.NetworkNameKey: constants.LocalName,
293+
config.SybilProtectionEnabledKey: "false",
294+
config.HealthCheckFreqKey: "500ms", // Ensure rapid detection of a healthy state
295+
config.LogDisplayLevelKey: logging.Debug.String(),
296+
config.LogLevelKey: logging.Debug.String(),
297+
config.HTTPHostKey: "0.0.0.0", // Need to bind to pod IP to ensure kubelet can access the http port for the readiness
298+
}
299+
flags.SetDefaults(tmpnet.DefaultTmpnetFlags())
300+
return flags
290301
}
291302

292303
// waitForPodCondition waits until the specified pod reports the specified condition

tests/fixture/tmpnet/defaults.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ const (
3838
// Flags suggested for temporary networks. Applied by default.
3939
func DefaultTmpnetFlags() FlagsMap {
4040
return FlagsMap{
41-
config.NetworkPeerListPullGossipFreqKey: "250ms",
42-
config.NetworkMaxReconnectDelayKey: "1s",
43-
config.HealthCheckFreqKey: "2s",
44-
config.AdminAPIEnabledKey: "true",
45-
config.IndexEnabledKey: "true",
41+
config.SystemTrackerRequiredAvailableDiskSpaceKey: "1GB",
42+
config.SystemTrackerWarningThresholdAvailableDiskSpaceKey: "3GB",
43+
config.NetworkPeerListPullGossipFreqKey: "250ms",
44+
config.NetworkMaxReconnectDelayKey: "1s",
45+
config.HealthCheckFreqKey: "2s",
46+
config.AdminAPIEnabledKey: "true",
47+
config.IndexEnabledKey: "true",
4648
}
4749
}
4850

tests/fixture/tmpnet/kube.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,6 @@ import (
4343
restclient "k8s.io/client-go/rest"
4444
)
4545

46-
// DefaultPodFlags defines common flags for avalanchego nodes running in a pod.
47-
func DefaultPodFlags(networkName string, dataDir string) map[string]string {
48-
return map[string]string{
49-
config.DataDirKey: dataDir,
50-
config.NetworkNameKey: networkName,
51-
config.SybilProtectionEnabledKey: "false",
52-
config.HealthCheckFreqKey: "500ms", // Ensure rapid detection of a healthy state
53-
config.LogDisplayLevelKey: logging.Debug.String(),
54-
config.LogLevelKey: logging.Debug.String(),
55-
config.HTTPHostKey: "0.0.0.0", // Need to bind to pod IP to ensure kubelet can access the http port for the readiness check
56-
}
57-
}
58-
5946
// NewNodeStatefulSet returns a statefulset for an avalanchego node.
6047
func NewNodeStatefulSet(
6148
name string,

0 commit comments

Comments
 (0)