Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm: Mount additional paths inside apiserver/controller-manager for working CA root #59122

Merged
merged 1 commit into from
Apr 24, 2018

Conversation

klausenbusk
Copy link
Contributor

@klausenbusk klausenbusk commented Jan 31, 2018

This is required for a working CA root, as /etc/ssl/certs on a few
Linux distributions just contains a bunch of symlinks.
Container Linux and Debian have symlinks pointing to
/usr/share/ca-certificates, ArchLinux has symlinks pointing
to /etc/ca-certificates.
On Debian /etc/ssl/certs can also include symlinks pointing
to /usr/local/share/ca-certificates for local CA certificates.

Fix: kubeadm/#671


What this PR does / why we need it:

Without this PR, controller-manager and apiserver would lack a CA root on some Linux distro (ex: Container Linux) which for example break flexplugins which require a CA root [1].

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes kubernetes/kubeadm#671

Special notes for your reviewer:

Release note:

Mount additional paths required for a working CA root, for setups where /etc/ssl/certs doesn't contains certificates but just symlink.

/sig sig-kubeadm

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 31, 2018
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 31, 2018
@klausenbusk
Copy link
Contributor Author

/assign @krousey

@dixudx
Copy link
Member

dixudx commented Feb 13, 2018

/area kubeadm

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 13, 2018
Copy link
Member

@dixudx dixudx left a comment

Choose a reason for hiding this comment

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

In your case, you can try to use config file to add extra volumes. Please refer to Using kubeadm init with a configuration file.

// caCertsExtraVolumePath specifies the paths that can be conditionally mounted into the apiserver and controller-manager containers
// as /etc/ssl/certs might be or contain a symlink to them. It's a variable since it may be changed in unit testing. This var MUST
// NOT be changed in normal codepaths during runtime.
var caCertsExtraVolumePaths = []string{"/etc/pki", "/usr/share/ca-certificates"}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should include this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dunno, it is required at least on Container Linux if you want a working CA root. Maybe we should just mention it on the Install kubeadm page?

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any issue with adding this as a stopgap for now, since we are already special casing /etc/pki.

@jdumars
Copy link
Member

jdumars commented Mar 2, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 2, 2018
@klausenbusk
Copy link
Contributor Author

/retest

@klausenbusk
Copy link
Contributor Author

@klausenbusk: The following test failed, say /retest to rerun them all:

I think the failed test is unrelated to this PR.

@klausenbusk
Copy link
Contributor Author

I think the failed test is unrelated to this PR.

The test was fixed in master ~ 22 hours ago (#60730). I have just rebased the PR and force pushed.

@timothysc timothysc assigned timothysc and unassigned krousey Apr 13, 2018
@timothysc timothysc added the sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. label Apr 13, 2018
@timothysc
Copy link
Member

/cc @detiber @stealthybox - want to quick review.

// caCertsExtraVolumePath specifies the paths that can be conditionally mounted into the apiserver and controller-manager containers
// as /etc/ssl/certs might be or contain a symlink to them. It's a variable since it may be changed in unit testing. This var MUST
// NOT be changed in normal codepaths during runtime.
var caCertsExtraVolumePaths = []string{"/etc/pki", "/usr/share/ca-certificates"}
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any issue with adding this as a stopgap for now, since we are already special casing /etc/pki.

// as /etc/ssl/certs might be a symlink to it. It's a variable since it may be changed in unit testing. This var MUST NOT be changed
// in normal codepaths during runtime.
var caCertsPkiVolumePath = "/etc/pki"
// caCertsExtraVolumePath specifies the paths that can be conditionally mounted into the apiserver and controller-manager containers
Copy link
Member

Choose a reason for hiding this comment

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

Comment needs to be updated to caCertsExtraVolumePaths

Copy link
Member

@detiber detiber left a comment

Choose a reason for hiding this comment

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

Outside of the minor comments, this looks okay to me as a bandaid fix.

@klausenbusk
Copy link
Contributor Author

@detiber Good catch :) I have fixed the comments, rebased and squashed the commits.

@klausenbusk
Copy link
Contributor Author

/test pull-kubernetes-e2e-kops-aws

@detiber
Copy link
Member

detiber commented Apr 13, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 13, 2018
// caCertsExtraVolumePaths specifies the paths that can be conditionally mounted into the apiserver and controller-manager containers
// as /etc/ssl/certs might be or contain a symlink to them. It's a variable since it may be changed in unit testing. This var MUST
// NOT be changed in normal codepaths during runtime.
var caCertsExtraVolumePaths = []string{"/etc/pki", "/usr/share/ca-certificates"}
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to address the other paths for OS's mentioned in kubernetes/kubeadm#671 (comment) ?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about the late response, I will add the extra paths when I get home. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done..

@timothysc timothysc removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 18, 2018
Copy link
Member

@timothysc timothysc left a comment

Choose a reason for hiding this comment

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

/approve

@stealthybox feel free to lgtm when you think the changes are ready.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 18, 2018
…or working CA root

This is required for a working CA root, as /etc/ssl/certs on a few
Linux distributions just contains a bunch of symlinks.
Container Linux and Debian have symlinks pointing to
/usr/share/ca-certificates, ArchLinux has symlinks pointing
to /etc/ca-certificates.
On Debian /etc/ssl/certs can also include symlinks pointing
to /usr/local/share/ca-certificates for local CA certificates.

Fix: kubeadm/#671
@klausenbusk klausenbusk changed the title kubeadm: Mount /usr/share/ca-certificates inside apiserver/controller… kubeadm: Mount additional paths inside apiserver/controller-manager for working CA root Apr 18, 2018
@timothysc
Copy link
Member

@stealthybox @detiber - requires re-eval b/c of PR change.

@detiber
Copy link
Member

detiber commented Apr 23, 2018

@stealthybox I do not believe that this will conflict with the other changes in flight, lgtm

@timothysc
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 24, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: detiber, klausenbusk, timothysc

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

The pull request process is described here

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

@klausenbusk
Copy link
Contributor Author

/test pull-kubernetes-node-e2e

Looks unrelated: There was a problem refreshing your current auth tokens: Unable to find the server at accounts.google.com

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 62655, 61711, 59122, 62853, 62390). If you want to cherry-pick this change to another branch, please follow the instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CoreOS: Mount /usr/share/ca-certificates inside kube-controller-manager
9 participants