Skip to content

Commit

Permalink
Merge pull request #11976 from olemarkus/automated-cherry-pick-of-#11…
Browse files Browse the repository at this point in the history
…961-origin-release-1.21

Automated cherry pick of #11961: Enable k8s event handover when kvstore is used
  • Loading branch information
k8s-ci-robot committed Jul 11, 2021
2 parents eaabb04 + 105195e commit 3f088c6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/networking/cilium.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ data:
trusted-ca-file: '/var/lib/etcd-secrets/etcd-ca.crt'
key-file: '/var/lib/etcd-secrets/etcd-client-cilium.key'
cert-file: '/var/lib/etcd-secrets/etcd-client-cilium.crt'

enable-k8s-event-handover: "true"
{{ end }}

# Identity allocation mode selects how identities are shared between cilium
Expand Down
13 changes: 13 additions & 0 deletions upup/pkg/fi/cloudup/new_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,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

}
Expand Down

0 comments on commit 3f088c6

Please sign in to comment.