Skip to content

fix(etcd): align cert ownership/permissions on first etcd node - #13428

Open
mehrdadbn9 wants to merge 1 commit into
kubernetes-sigs:masterfrom
mehrdadbn9:fix/etcd-cert-perms-first-node
Open

fix(etcd): align cert ownership/permissions on first etcd node#13428
mehrdadbn9 wants to merge 1 commit into
kubernetes-sigs:masterfrom
mehrdadbn9:fix/etcd-cert-perms-first-node

Conversation

@mehrdadbn9

Copy link
Copy Markdown
Contributor

Summary

Fixes #13250 — etcd certificates have inconsistent ownership/permissions on the first control-plane/etcd node vs the remaining nodes.

Root cause

roles/etcd/templates/make-ssl-etcd.sh.j2 did mv *.pem ${SSLDIR}/ with no chown/chmod. On the first etcd node the certs therefore kept root:root with umask-derived perms (-rw------- keys, -rw-r--r-- certs). On every other node the copy: tasks in gen_certs_script.yml set mode: "0640", owner: "{{ etcd_owner }}" (etcd), group: "{{ etcd_cert_group }}" (root).

Fix

After moving the certs, chown {{ etcd_owner }}:{{ etcd_cert_group }} and chmod 0640 so the first node matches the others. Verified by rendering the template (vars resolve to etcd/root) and executing the install block: before -rw------- root root / -rw-r--r-- root root, after -rw-r----- etcd root for all *.pem.

Test plan

  • Template renders with no unrendered {{ }}
  • Install block executed locally: certs become 0640 etcd:root (matches other-node scheme)
  • Full molecule/CI run on a real cluster (pending /ok-to-test)

Checklist

  • Commits are signed off (CNCF CLA)
  • Change is minimal and scoped to the cert-install step
Fix inconsistent etcd certificate ownership/permissions on the first etcd node: generated certs are now chowned to the etcd user and chmoded to 0640, matching the other nodes.

@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 28, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @mehrdadbn9. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow
kubernetes-prow Bot requested a review from ErikJiang August 28, 2026 06:23
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mehrdadbn9
Once this PR has been reviewed and has the lgtm label, please assign vannten for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested a review from tico88612 August 28, 2026 06:23
The cert-generation script (make-ssl-etcd.sh.j2) moved generated
*.pem files into SSLDIR with no chown/chmod, so on the first
etcd node they kept root:root with umask-derived perms
(-rw------- keys, -rw-r--r-- certs). On every other node the
copy tasks set mode 0640, owner etcd, group root.

After moving the certs, chown to etcd:root and chmod 0640 so the
first node matches the other nodes. This fixes etcd backup jobs
that read certs on cp1 and fail with permission errors.

Refs kubernetes-sigs#13250

Signed-off-by: Mehrdad Biukian Naeini <mehrdadbiukian@gmail.com>
@mehrdadbn9
mehrdadbn9 force-pushed the fix/etcd-cert-perms-first-node branch from d922b2c to e9333f9 Compare August 28, 2026 13:14
@yankay

yankay commented Aug 30, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent etcd certificate permissions on first control-plane / etcd node

2 participants