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

enable Node authorizer and NodeRestriction admission controller #46796

Merged
merged 2 commits into from
Jun 13, 2017

Conversation

mikedanese
Copy link
Member

@mikedanese mikedanese commented Jun 1, 2017

Fixes #46999
Fixes #47135

gce kube-up: The `Node` authorization mode and `NodeRestriction` admission controller are now enabled

@mikedanese mikedanese self-assigned this Jun 1, 2017
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 1, 2017
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Jun 1, 2017
@luxas
Copy link
Member

luxas commented Jun 1, 2017

@mikedanese BTW, have we enabled the Node Authorizer in kubeadm?

nodeName := ""
if strings.HasPrefix(userName, nodeUserNamePrefix) {
nodeName = strings.TrimPrefix(userName, nodeUserNamePrefix)
if !strings.HasPrefix(userName, nodeUserNamePrefix) {
Copy link
Member

Choose a reason for hiding this comment

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

update godoc to match and move the username check before the loop over the groups

Copy link
Member

Choose a reason for hiding this comment

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

also, this'll require updating unit tests

@@ -1123,7 +1123,7 @@ function start-kube-apiserver {
fi


local authorization_mode="RBAC"
local authorization_mode="RBAC,Node"
Copy link
Member

@liggitt liggitt Jun 1, 2017

Choose a reason for hiding this comment

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

I would probably put the Node authorizer first... it does almost zero work for requests that are not from nodes, and is faster for requests that are

@@ -217,7 +217,7 @@ fi

# Admission Controllers to invoke prior to persisting objects in cluster
# If we included ResourceQuota, we should keep it at the end of the list to prevent incrementing quota usage prematurely.
ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,ResourceQuota
ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota
Copy link
Member

Choose a reason for hiding this comment

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

does this apply to all the gce clusters? what about ubuntu, container-linux, etc?

Copy link
Member

Choose a reason for hiding this comment

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

I guess with the change to treat things without a system:node:... formatted name as non-nodes, this is safe

@liggitt
Copy link
Member

liggitt commented Jun 1, 2017

/release-note-required

@@ -277,6 +277,7 @@ func init() {
Rules: []rbac.PolicyRule{
rbac.NewRule("get", "list", "watch").Groups(certificatesGroup).Resources("certificatesigningrequests").RuleOrDie(),
rbac.NewRule("update").Groups(certificatesGroup).Resources("certificatesigningrequests/status", "certificatesigningrequests/approval").RuleOrDie(),
rbac.NewRule("create").Groups(authorizationGroup).Resources("subjectaccessreviews").RuleOrDie(),
Copy link
Member

@liggitt liggitt Jun 1, 2017

Choose a reason for hiding this comment

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

needs bootstrap yaml updated (was correct in f533bf7)

@liggitt liggitt added area/platform/gce area/provider/gcp Issues or PRs related to gcp provider sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels Jun 1, 2017
@mikedanese mikedanese force-pushed the gce-2 branch 4 times, most recently from e04c9a8 to 9b2540d Compare June 1, 2017 21:46
@mikedanese mikedanese changed the title enable Node authorizer and NodeRestriction admission controller in GCE/GKE enable Node authorizer and NodeRestriction admission controller Jun 1, 2017
@mikedanese mikedanese added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Jun 1, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 1, 2017
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 12, 2017
@luxas
Copy link
Member

luxas commented Jun 12, 2017

Quota 'SUBNETWORKS' exceeded. Limit: 150.0 was the failure on gce-etcd3...

@mikedanese
Copy link
Member Author

/retest

@kubernetes kubernetes deleted a comment from k8s-ci-robot Jun 12, 2017
@mikedanese mikedanese force-pushed the gce-2 branch 3 times, most recently from 85059ce to d6202e6 Compare June 12, 2017 22:11
@mikedanese
Copy link
Member Author

/retest

1 similar comment
@mikedanese
Copy link
Member Author

/retest

@liggitt
Copy link
Member

liggitt commented Jun 13, 2017

cc @deads2k @ncdc @derekwaynecarr @wojtek-t on the namespace deletion worker bump (c.f. #46437). I'm in favor of it... experimentally, it cut cleanup time in half on the e2e, and we saw peak times to sync individual namespaces cut in half as well, indicating the controllers had QPS (c.f. #45304) and CPU headroom and were blocking on something else.

controller time to perform a single namespace sync

Before (max=215.29, median=20.92, average=26.82):
screen shot 2017-06-12 at 9 34 20 pm
After (max=98.93, median=19.43, average=19.68):
screen shot 2017-06-12 at 9 34 38 pm

e2e time to observe a namespace deletion completing

Before (max=305, median=100, average=120):
screen shot 2017-06-12 at 9 48 45 pm
After (max=156, median=44, average=45):
screen shot 2017-06-12 at 9 48 53 pm

@derekwaynecarr
Copy link
Member

+1 the worker bump to 10

@@ -1288,7 +1288,7 @@ function start-kube-apiserver {
fi


local authorization_mode="RBAC"
local authorization_mode="Node,RBAC"
Copy link
Member

Choose a reason for hiding this comment

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

I haven't kept up with the cluster/gce/... deployments...

this line also appears in gce/container-linux, gce/cos, gce/ubuntu as well... do any of those need to be updated as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

gce/cos is a symlink to gce/gci. I'm not sure if gce/container-linux is tested anywhere. A quick search of testgrid didn't turn anything up. I'm not inclined to change anywhere that is not being tested.

Copy link
Member

Choose a reason for hiding this comment

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

oh, ok

Copy link
Member Author

Choose a reason for hiding this comment

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

@roberthbailey who maintains container-linux?

Copy link
Contributor

Choose a reason for hiding this comment

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

According to the OWNERS file, it's @euank, @yifan-gu, and @ethernetdan.

@mikedanese
Copy link
Member Author

/retest

@liggitt
Copy link
Member

liggitt commented Jun 13, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 13, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, mikedanese

Associated issue: 46999

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

@@ -67,7 +67,7 @@ func NewCMServer() *CMServer {
ConcurrentJobSyncs: 5,
ConcurrentResourceQuotaSyncs: 5,
ConcurrentDeploymentSyncs: 5,
ConcurrentNamespaceSyncs: 5,
ConcurrentNamespaceSyncs: 10,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is 10 enough?

@mikedanese
Copy link
Member Author

@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

@mikedanese
Copy link
Member Author

/retest

@k8s-github-robot
Copy link

Automatic merge from submit-queue

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/platform/gce area/provider/gcp Issues or PRs related to gcp provider 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/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. 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.

None yet

9 participants