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

Update kubelet to be secureKubelet by default #4307

Closed

Conversation

audip
Copy link
Contributor

@audip audip commented Jan 20, 2018

Turns on secureKubelet by default based on @gambol99 's work on #3125
Towards an effort to complete issue #3998

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 20, 2018
@@ -60,6 +60,7 @@ func (b *KubeletOptionsBuilder) BuildOptions(o interface{}) error {
clusterSpec.Kubelet.ClusterDNS = ip.String()
clusterSpec.Kubelet.ClusterDomain = clusterSpec.ClusterDNSDomain
clusterSpec.Kubelet.NonMasqueradeCIDR = clusterSpec.NonMasqueradeCIDR
clusterSpec.Kubelet.anonymousAuth = fi.Bool(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

should we check that it is not set first? The user may have set it to true already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, adding the logic

@chrislovecnm
Copy link
Contributor

/ok-to-test

CI unit tests seemed to have failed as well

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 20, 2018
@chrislovecnm
Copy link
Contributor

/retest

@audip your code is failing CI. please run make ci locally.

/assign @gambol99

@gambol99 you understand this better than I ... thanks for your help!

@chrislovecnm
Copy link
Contributor

/retest

@audip
Copy link
Contributor Author

audip commented Jan 24, 2018

@chrislovecnm Thanks for re-testing this, the end-to-end test has passed and in the Travis build log:

--- FAIL: TestMinimalCloudformation (3.78s)
	integration_test.go:544: diff for key Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.UserData:
		...
		  kubelet:
		    allowPrivileged: true
		+   anonymousAuth: false
		    apiServers: https://api.internal.minimal.example.com
		    babysitDaemons: true

The AnonymousAuth flag is being run as anonymousAuth which is causing the test to fail. I'm not sure where the problem lies.

docs/security.md Outdated
@@ -48,7 +48,7 @@ By default AnonymousAuth on the kubelet is 'on' and so communication between kub
# In the cluster spec
spec:
kubelet:
anonymousAuth: false
AnonymousAuth: false
Copy link
Contributor

Choose a reason for hiding this comment

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

pretty sure this should remain anonymousAuth not AnonymousAuth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hadn't looked at componentconfig.go, will revert this change.

@@ -61,6 +61,11 @@ func (b *KubeletOptionsBuilder) BuildOptions(o interface{}) error {
clusterSpec.Kubelet.ClusterDomain = clusterSpec.ClusterDNSDomain
clusterSpec.Kubelet.NonMasqueradeCIDR = clusterSpec.NonMasqueradeCIDR

// Set secure kubelet on by default when the user has not set this flag
if clusterSpec.Kubelet.AnonymousAuth == nil {
clusterSpec.Kubelet.AnonymousAuth = fi.Bool(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes .. but this would force all clusters to suddenly use mutal tls on the kubelet api, so it would need to be highlighted vigorously not to surprise. I know @justinsb did some work on state to detect is new cluster or updating a cluster .. i'm not sure if this information is communicated here though ... @justinsb?

Copy link
Contributor

Choose a reason for hiding this comment

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

@gambol99 to see if I understand what you are saying, and thanks for the review. We would need to determine how an update would work with this. I think this is an ok change for a new cluster, but with an existing cluster, this would cause downtime. When the masters change to using TLS first during an update, not sure how the nodes would respond. @audip have you tested an upgrade?

@gambol99 we need rolling update e2e 🙊

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not tested the upgrade yet.

@gambol99
Copy link
Contributor

also the TestMinimalCloudformation needs fixing .. I believe these are the files located in kops/tests/integration/create_cluster/minimal and or kops/tests/integration/update_cluster/minimal

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: audip
We suggest the following additional approver: gambol99

Assign the PR to them by writing /assign @gambol99 in a comment when ready.

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 29, 2018
@justinsb justinsb added this to the 1.9 milestone Feb 21, 2018
@audip
Copy link
Contributor Author

audip commented Feb 22, 2018

@chrislovecnm @justinsb can you point me to where I'm going wrong? I'm stuck on the tests not passing, @gambol99 gave me some direction, but still, the tests are failing.

@chrislovecnm
Copy link
Contributor

/retest

Bump

@k8s-ci-robot
Copy link
Contributor

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

Test name Commit Details Rerun command
pull-kops-bazel-test e4dd534 link /test pull-kops-bazel-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@justinsb justinsb modified the milestones: 1.9.0, 1.10 May 26, 2018
@justinsb justinsb modified the milestones: 1.10, 1.11 Jun 10, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 8, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 8, 2018
@k8s-ci-robot k8s-ci-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Oct 8, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

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. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. 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.

6 participants