diff --git a/bitnami/etcd/Chart.yaml b/bitnami/etcd/Chart.yaml index 312380118..d0131ef3e 100644 --- a/bitnami/etcd/Chart.yaml +++ b/bitnami/etcd/Chart.yaml @@ -25,4 +25,4 @@ name: etcd sources: - https://github.com/bitnami/bitnami-docker-etcd - https://coreos.com/etcd/ -version: 6.0.0 +version: 6.1.0 diff --git a/bitnami/etcd/README.md b/bitnami/etcd/README.md index 1669e20dc..1a8c314cd 100644 --- a/bitnami/etcd/README.md +++ b/bitnami/etcd/README.md @@ -98,6 +98,8 @@ The following tables lists the configurable parameters of the etcd chart and the | `auth.peer.caFilename` | Name of the file containing the peer CA certificate | `""` | | `initialClusterState` | Initial cluster state. Allowed values: 'new' or 'existing' | `nil` | | `maxProcs` | Set GOMAXPROCS environment variable to limit the number of CPUs | `nil` | +| `autoCompactionMode` | Set ETCD_AUTO_COMPACTION_MODE environment variable to define mode of autoCompaction | `nil` | +| `autoCompactionRetention` | Set ETCD_AUTO_COMPACTION_RETENTION environment variable to define autoCompaction retention| `nil` | | `removeMemberOnContainerTermination`| Use a PreStop hook to remove the etcd members from the cluster on container termination | `true` | | `configuration` | etcd configuration. Specify content for etcd.conf.yml | `nil` | | `existingConfigmap` | Name of existing ConfigMap with etcd configuration | `nil` | @@ -299,6 +301,22 @@ extraEnvVars: - Using a custom `etcd.conf.yml`: The etcd chart allows mounting a custom `etcd.conf.yml` file as ConfigMap. In order to so, you can use the `configuration` property. Alternatively, you can use an existing ConfigMap using the `existingConfigmap` parameter. +### Auto Compaction + +Since etcd keeps an exact history of its keyspace, this history should be periodically compacted to avoid performance degradation and eventual storage space exhaustion. Compacting the keyspace history drops all information about keys superseded prior to a given keyspace revision. The space used by these keys then becomes available for additional writes to the keyspace. + +`autoCompactionMode`, by default periodic. Valid values: ‘periodic’, ‘revision’. +- 'periodic' for duration based retention, defaulting to hours if no time unit is provided (e.g. ‘5m’). +- 'revision' for revision number based retention. +`autoCompactionRetention` for mvcc key value store in hour, by default 0, means disabled. + +You can enable auto compaction by using following parameters: + +```console +autoCompactionMode=periodic +autoCompactionRetention=10m +``` + ### Sidecars and Init Containers If you have a need for additional containers to run within the same pod as the etcd app (e.g. an additional metrics or logging exporter), you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec. diff --git a/bitnami/etcd/templates/statefulset.yaml b/bitnami/etcd/templates/statefulset.yaml index 9a0b508ed..17998e20b 100644 --- a/bitnami/etcd/templates/statefulset.yaml +++ b/bitnami/etcd/templates/statefulset.yaml @@ -152,6 +152,14 @@ spec: value: "{{ $etcdPeerProtocol }}://$(MY_POD_NAME).{{ $etcdHeadlessServiceName }}.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:{{ .Values.service.peerPort }}" - name: ETCD_LISTEN_PEER_URLS value: "{{ $etcdPeerProtocol }}://0.0.0.0:{{ .Values.service.peerPort }}" + {{- if .Values.autoCompactionMode }} + - name: ETCD_AUTO_COMPACTION_MODE + value: {{ .Values.autoCompactionMode }} + {{- end }} + {{- if .Values.autoCompactionRetention }} + - name: ETCD_AUTO_COMPACTION_RETENTION + value: {{ .Values.autoCompactionRetention }} + {{- end }} {{- if .Values.maxProcs }} - name: GOMAXPROCS value: {{ .Values.maxProcs }} diff --git a/bitnami/etcd/values.yaml b/bitnami/etcd/values.yaml index 2a82f8a29..b91083729 100644 --- a/bitnami/etcd/values.yaml +++ b/bitnami/etcd/values.yaml @@ -14,7 +14,7 @@ image: registry: docker.io repository: bitnami/etcd - tag: 3.4.15-debian-10-r9 + tag: 3.4.15-debian-10-r12 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -60,6 +60,16 @@ clusterDomain: cluster.local ## extraDeploy: [] +## Auto compaction mode, by default periodic. Valid values: ‘periodic’, ‘revision’. +## - 'periodic' for duration based retention, defaulting to hours if no time unit is provided (e.g. ‘5m’). +## - 'revision' for revision number based retention. +## +# autoCompactionMode: periodic + +## Auto compaction retention for mvcc key value store in hour, by default 0, means disabled +## +# autoCompactionRetention: 0 + ## Authentication parameters ## auth: