Add auto compaction to new cilium etcd clusters and to docs

This commit is contained in:
Ole Markus With 2021-07-08 22:05:55 +02:00
parent 97a41c66f4
commit a536929fec
2 changed files with 20 additions and 0 deletions

View File

@ -44,6 +44,7 @@ kops create cluster \
For existing clusters, add the following to `spec.etcdClusters`:
Make sure `instanceGroup` match the other etcd clusters.
You should also enable auto compaction.
```yaml
- etcdMembers:
@ -53,6 +54,12 @@ Make sure `instanceGroup` match the other etcd clusters.
name: b
- instanceGroup: master-az-1c
name: c
manager:
env:
- name: ETCD_AUTO_COMPACTION_MODE
value: revision
- name: ETCD_AUTO_COMPACTION_RETENTION
value: "2500"
name: cilium
```

View File

@ -1173,6 +1173,19 @@ func createEtcdCluster(etcdCluster string, masters []*api.InstanceGroup, encrypt
m.InstanceGroup = fi.String(ig.ObjectMeta.Name)
etcd.Members = append(etcd.Members, m)
}
// Cilium etcd server is not compacted by the k8s API server.
if etcd.Name == "cilium" {
if etcd.Manager == nil {
etcd.Manager = &api.EtcdManagerSpec{
Env: []api.EnvVar{
{Name: "ETCD_AUTO_COMPACTION_MODE", Value: "revision"},
{Name: "ETCD_AUTO_COMPACTION_RETENTION", Value: "2500"},
},
}
}
}
return etcd
}