Skip to content

Commit

Permalink
*: remove auto-disaster-recovery flag, fixup check-interval
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-M committed Sep 11, 2021
1 parent afa3a66 commit dbc74b7
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
3 changes: 0 additions & 3 deletions chart/etcd-cloud-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ data:
check-interval: {{ .Values.config.checkInterval }}
# The time after which, an unhealthy member will be removed from the cluster.
unhealthy-member-ttl: {{ .Values.config.unhealthyMemberTTL }}
# Defines whether the operator will attempt to seed a new cluster from a
# snapshot after the managed cluster has lost quorum.
auto-disaster-recovery: {{ .Values.config.autoDisasterRecovery }}
# Configuration of the etcd instance.
etcd:
# The address that clients should use to connect to the etcd cluster (i.e.
Expand Down
1 change: 0 additions & 1 deletion chart/etcd-cloud-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ setupProbe:
config:
checkInterval: 15s
unhealthyMemberTTL: 5m
autoDisasterRecovery: true
etcd:
dataDir: /var/lib/etcd
clientTransportSecurity:
Expand Down
1 change: 1 addition & 0 deletions cmd/operator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type config struct {
func defaultConfig() config {
return config{
ECO: operator.Config{
CheckInterval: 15 * time.Second,
UnhealthyMemberTTL: 2 * time.Minute,
Etcd: etcd.EtcdConfiguration{
DataDir: "/var/lib/etcd",
Expand Down
3 changes: 0 additions & 3 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ eco:
check-interval: 15s
# The time after which, an unhealthy member will be removed from the cluster.
unhealthy-member-ttl: 30s
# Defines whether the operator will attempt to seed a new cluster from a
# snapshot after the managed cluster has lost quorum.
auto-disaster-recovery: true
# Configuration of the etcd instance.
etcd:
# The address that clients should use to connect to the etcd cluster (i.e.
Expand Down
1 change: 0 additions & 1 deletion docs/docker-testing/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
eco:
check-interval: 5s
unhealthy-member-ttl: 30s
auto-disaster-recovery: true
etcd:
advertise-address:
data-dir: /var/lib/etcd
Expand Down
7 changes: 4 additions & 3 deletions pkg/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ type Operator struct {

// Config is the global configuration for an instance of ECO.
type Config struct {
UnhealthyMemberTTL time.Duration `yaml:"unhealthy-member-ttl"`
CheckInterval time.Duration `yaml:"check-interval"`
UnhealthyMemberTTL time.Duration `yaml:"unhealthy-member-ttl"`

Etcd etcd.EtcdConfiguration `yaml:"etcd"`
ASG asg.Config `yaml:"asg"`
Expand All @@ -78,7 +79,7 @@ func New(cfg Config) *Operator {
// Initialize providers.
asgProvider, snapshotProvider := initProviders(cfg)
if snapshotProvider == nil || cfg.Snapshot.Interval == 0 {
log.Fatal("snapshots must be enabled for auto disaster recovery")
log.Fatal("snapshots must be enabled for disaster recovery")
}

// Setup signal handler.
Expand All @@ -91,7 +92,7 @@ func New(cfg Config) *Operator {
snapshotProvider: snapshotProvider,
httpClient: &http.Client{Timeout: isHealthyTimeout},
state: "UNKNOWN",
ticker: time.NewTicker(loopInterval),
ticker: time.NewTicker(cfg.CheckInterval),
shutdownChan: shutdownChan,
}
}
Expand Down

0 comments on commit dbc74b7

Please sign in to comment.