Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ func addNodeFlags(fs *pflag.FlagSet) {
fs.Duration(SystemTrackerProcessingHalflifeKey, 15*time.Second, "Halflife to use for the processing requests tracker. Larger halflife --> usage metrics change more slowly")
fs.Duration(SystemTrackerCPUHalflifeKey, 15*time.Second, "Halflife to use for the cpu tracker. Larger halflife --> cpu usage metrics change more slowly")
fs.Duration(SystemTrackerDiskHalflifeKey, time.Minute, "Halflife to use for the disk tracker. Larger halflife --> disk usage metrics change more slowly")
fs.Uint64(SystemTrackerRequiredAvailableDiskSpaceKey, units.GiB/2, "Minimum number of available bytes on disk, under which the node will shutdown.")
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))
fs.Uint64(SystemTrackerRequiredAvailableDiskSpaceKey, 10*units.GiB, "Minimum number of available bytes on disk, under which the node will shutdown.")
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))

// CPU management
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]")
Expand Down
13 changes: 12 additions & 1 deletion tests/fixture/bootstrapmonitor/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet/flags"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/logging"

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

func defaultPodFlags() map[string]string {
return tmpnet.DefaultPodFlags(constants.LocalName, nodeDataDir)
flags := tmpnet.FlagsMap{
config.DataDirKey: nodeDataDir,
config.NetworkNameKey: constants.LocalName,
config.SybilProtectionEnabledKey: "false",
config.HealthCheckFreqKey: "500ms", // Ensure rapid detection of a healthy state
config.LogDisplayLevelKey: logging.Debug.String(),
config.LogLevelKey: logging.Debug.String(),
config.HTTPHostKey: "0.0.0.0", // Need to bind to pod IP to ensure kubelet can access the http port for the readiness
}
flags.SetDefaults(tmpnet.DefaultTmpnetFlags())
return flags
}

// waitForPodCondition waits until the specified pod reports the specified condition
Expand Down
12 changes: 7 additions & 5 deletions tests/fixture/tmpnet/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ const (
// Flags suggested for temporary networks. Applied by default.
func DefaultTmpnetFlags() FlagsMap {
return FlagsMap{
config.NetworkPeerListPullGossipFreqKey: "250ms",
config.NetworkMaxReconnectDelayKey: "1s",
config.HealthCheckFreqKey: "2s",
config.AdminAPIEnabledKey: "true",
config.IndexEnabledKey: "true",
config.SystemTrackerRequiredAvailableDiskSpaceKey: "1GB",
config.SystemTrackerWarningThresholdAvailableDiskSpaceKey: "3GB",
config.NetworkPeerListPullGossipFreqKey: "250ms",
config.NetworkMaxReconnectDelayKey: "1s",
config.HealthCheckFreqKey: "2s",
config.AdminAPIEnabledKey: "true",
config.IndexEnabledKey: "true",
}
}

Expand Down
13 changes: 0 additions & 13 deletions tests/fixture/tmpnet/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@ import (
restclient "k8s.io/client-go/rest"
)

// DefaultPodFlags defines common flags for avalanchego nodes running in a pod.
func DefaultPodFlags(networkName string, dataDir string) map[string]string {
return map[string]string{
config.DataDirKey: dataDir,
config.NetworkNameKey: networkName,
config.SybilProtectionEnabledKey: "false",
config.HealthCheckFreqKey: "500ms", // Ensure rapid detection of a healthy state
config.LogDisplayLevelKey: logging.Debug.String(),
config.LogLevelKey: logging.Debug.String(),
config.HTTPHostKey: "0.0.0.0", // Need to bind to pod IP to ensure kubelet can access the http port for the readiness check
}
}

// NewNodeStatefulSet returns a statefulset for an avalanchego node.
func NewNodeStatefulSet(
name string,
Expand Down
Loading