Skip to content

Commit

Permalink
[222] Compaction settings as args
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenmarten committed Jun 2, 2024
1 parent 4d4b8fc commit 5d57537
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/controller/factory/configMap.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ func CreateOrUpdateClusterStateConfigMap(
Name: GetClusterStateConfigMapName(cluster),
},
Data: map[string]string{
"ETCD_INITIAL_CLUSTER_STATE": "new",
"ETCD_INITIAL_CLUSTER": initialCluster,
"ETCD_INITIAL_CLUSTER_TOKEN": cluster.Name + "-" + cluster.Namespace,
"ETCD_AUTO_COMPACTION_RETENTION": "5m",
"ETCD_SNAPSHOT_COUNT": "10000",
"ETCD_INITIAL_CLUSTER_STATE": "new",
"ETCD_INITIAL_CLUSTER": initialCluster,
"ETCD_INITIAL_CLUSTER_TOKEN": cluster.Name + "-" + cluster.Namespace,
},
}

Expand Down
6 changes: 6 additions & 0 deletions internal/controller/factory/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ func generateEtcdArgs(cluster *etcdaenixiov1alpha1.EtcdCluster) []string {
}
}

autoCompactionSettings := []string{
"--auto-compaction-retention=5m",
"--snapshot-count=10000",
}

args = append(args, []string{
"--name=$(POD_NAME)",
"--listen-metrics-urls=http://0.0.0.0:2381",
Expand All @@ -325,6 +330,7 @@ func generateEtcdArgs(cluster *etcdaenixiov1alpha1.EtcdCluster) []string {
args = append(args, peerTlsSettings...)
args = append(args, serverTlsSettings...)
args = append(args, clientTlsSettings...)
args = append(args, autoCompactionSettings...)

return args
}
Expand Down

0 comments on commit 5d57537

Please sign in to comment.