Skip to content

fix: ensure consistent etcd certificate permissions on first etcd node#13367

Open
Dasmat13 wants to merge 1 commit into
kubernetes-sigs:masterfrom
Dasmat13:fix-etcd-cert-permissions-first-node
Open

fix: ensure consistent etcd certificate permissions on first etcd node#13367
Dasmat13 wants to merge 1 commit into
kubernetes-sigs:masterfrom
Dasmat13:fix-etcd-cert-permissions-first-node

Conversation

@Dasmat13

Copy link
Copy Markdown

Fixes #13250

The etcd certificate generation script runs on the first etcd node and creates certs with default ownership/permissions (root:root, umask-based), while the subsequent copy task sets explicit ownership/permissions (etcd:root, 0640) on the remaining etcd nodes. This leads to inconsistent permissions that can cause issues such as etcd backup jobs failing on the first node due to missing read access.

Add a task after cert generation to explicitly set ownership and permissions on the first etcd node to match what the copy task applies to other nodes.

etcd: ensure consistent certificate permissions on the first etcd node by explicitly setting owner, group, and mode after generation

@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 12, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @Dasmat13. 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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 review from VannTen and tico88612 July 12, 2026 08:34
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Dasmat13
Once this PR has been reviewed and has the lgtm label, please assign yankay 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

@Dasmat13
Dasmat13 force-pushed the fix-etcd-cert-permissions-first-node branch 3 times, most recently from 3c1f4ee to 5e36fa6 Compare July 12, 2026 08:37
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jul 12, 2026
@yankay

yankay commented Jul 13, 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 Jul 13, 2026
The etcd certificate generation script runs on the first etcd node and
creates certs with default ownership and permissions. Subsequent copy
tasks set explicit ownership and permissions on the remaining etcd
nodes, resulting in inconsistent permissions across the cluster.

This can cause issues such as etcd backup jobs failing on the first
node due to missing read access to certificate files.

Add an ansible.builtin.file task after cert generation to explicitly
set the correct ownership and permissions on the first etcd node.
@Dasmat13
Dasmat13 force-pushed the fix-etcd-cert-permissions-first-node branch from 5e36fa6 to ba0837d Compare July 13, 2026 08:38
@yankay
yankay requested a review from Copilot July 13, 2026 13:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix inconsistent ownership/permissions of etcd TLS certificates on the first etcd node by explicitly applying the same owner/group/mode that Kubespray already enforces when copying certs to the remaining etcd nodes (addressing #13250).

Changes:

  • Adds a new task to chmod/chown etcd certificate PEM files on the first etcd node to {{ etcd_owner }}:{{ etcd_cert_group }} with mode 0640.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +49 to +53
- name: Gen_certs | Ensure consistent etcd certificate permissions on first etcd node
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ etcd_owner }}"
group: "{{ etcd_cert_group }}"
@Dasmat13

Copy link
Copy Markdown
Author

Hi @yankay, all CI checks have passed. Could you please take another look when you have time? Also, let me know if you'd like me to address the Copilot suggestion. Thanks!

@Dasmat13

Copy link
Copy Markdown
Author

Hi @yankay, @VannTen, and @tico88612,

Just a friendly follow-up. All CI checks have passed, and the PR is ready for review. If you think the Copilot suggestion should be addressed before merging, I'm happy to update the implementation.

Thanks for your time!

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/S Denotes a PR that changes 10-29 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

3 participants