Etcd Cluster Resource Protection¶
etcd-druid provisions and manages kubernetes resources (a.k.a components) for each Etcd cluster. To ensure that each component's specification is in line with the configured attributes defined in Etcd custom resource and to protect unintended changes done to any of these managed components a Validating Webhook is employed.
Etcd Components Webhook is the validating webhook which prevents unintended UPDATE and DELETE operations on all managed resources. Following sections describe what is prohibited and in which specific conditions the changes are permitted.
Configure Etcd Components Webhook¶
Prerequisite to enable the validation webhook is to configure the Webhook Server. Additionally you need to enable the Etcd Components validating webhook and optionally configure other options. You can look at all the options here.
What is allowed?¶
Modifications to managed resources under the following circumstances will be allowed:
CreateandConnectoperations are allowed and no validation is done.- Changes to a kubernetes resource (e.g. StatefulSet, ConfigMap etc) not managed by etcd-druid are allowed.
- Changes to a resource whose Group-Kind is amongst the resources managed by etcd-druid but does not have a parent
Etcdresource are allowed. - It is possible that an operator wishes to explicitly disable etcd-component protection. This can be done by setting
druid.gardener.cloud/disable-etcd-component-protectionannotation on anEtcdresource. If this annotation is present then changes to managed components will be allowed. - If
Etcdresource has a deletion timestamp set indicating that it is marked for deletion and is awaiting etcd-druid to delete all managed resources then deletion requests for all managed resources for this etcd cluster will be allowed if: - The deletion request has come from a
ServiceAccountassociated to etcd-druid. If not explicitly specified via--reconciler-service-accountthen a default-reconciler-service-account will be assumed. - The deletion request has come from a
ServiceAccountconfigured via--etcd-components-webhook-exempt-service-accounts. Leaseobjects are periodically updated by each etcd member pod. A singleServiceAccountis created for all members.Updateoperation onLeaseobjects from this ServiceAccount is allowed.- If an active reconciliation is in-progress then only allow operations that are initiated by etcd-druid.
- If no active reconciliation is currently in-progress, then allow updates to managed resource from
ServiceAccountsconfigured via--etcd-components-webhook-exempt-service-accounts.