More Info:
The —peer-cert-file and —peer-key-file arguments must be set so that etcd peer-to-peer traffic is served over TLS. Without them, replication traffic containing all cluster state and secrets travels unencrypted between etcd nodes.Risk Level
CriticalAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every etcd (control plane) node, back up the current manifest and list existing etcd certs:
-
If you already have dedicated peer cert/key files, note their paths (for example
/etc/kubernetes/pki/etcd/peer.crtand/etc/kubernetes/pki/etcd/peer.key). If not, generate them following your PKI process or, as a simple local CA example, run: -
Edit the etcd static pod manifest on every etcd node to add the peer TLS flags, using the correct cert paths from step 2:
In the
spec.containers[0].commandlist, ensure these entries exist (adjust paths if different in your environment):Do not remove any existing TLS or cluster-related flags. -
Still in
/etc/kubernetes/manifests/etcd.yaml, if your etcd cluster uses peer CA verification, confirm a matching--peer-trusted-ca-fileis set and that the file exists:Save and exit the editor. The kubelet will automatically restart the etcd static pod when the manifest changes; this temporarily restarts etcd on that node. -
If you have multiple etcd nodes, repeat steps 1–4 on each etcd node, using the correct peer certificate and key for that node and ensuring any cluster-related flags (e.g.,
--initial-cluster,--initial-advertise-peer-urls,--initial-cluster-state) remain consistent with your existing etcd cluster configuration. -
On every etcd node, verify the process now includes the peer cert and key flags:
Confirm the output contains both
--peer-cert-file=/etc/kubernetes/pki/etcd/peer.crtand--peer-key-file=/etc/kubernetes/pki/etcd/peer.keywith the expected paths.
Using kubectl
Using kubectl
kubectl cannot be used to configure etcd’s
--peer-cert-file and --peer-key-file flags because they are set in the static Pod manifest on the host filesystem. Make the changes directly in /etc/kubernetes/manifests/etcd.yaml on every etcd node as described in the Manual Steps section.Automation
Automation

