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

set default enabled admission plugins by official document #58684

Merged

Conversation

hzxuzhonghu
Copy link
Member

@hzxuzhonghu hzxuzhonghu commented Jan 23, 2018

What this PR does / why we need it:

https://kubernetes.io/docs/admin/admission-controllers/#is-there-a-recommended-set-of-admission-controllers-to-use

recommend running the following set of admission controllers

If you previously had not set the `--admission-control` flag, your cluster behavior may change (to be more standard).  See [https://kubernetes.io/docs/admin/admission-controllers/] for explanation of admission control.

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 #

Special notes for your reviewer:

Release note:

Set default enabled admission plugins `NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota`

@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 23, 2018
@hzxuzhonghu
Copy link
Member Author

/assign @sttts @deads2k

@hzxuzhonghu
Copy link
Member Author

And after this , the document also need revise.

@hzxuzhonghu hzxuzhonghu force-pushed the default-enabled-admission branch from 48574ab to e051ab5 Compare January 23, 2018 12:19
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 23, 2018
defaultOffPlugins := sets.NewString(AllOrderedPlugins...)
defaultOffPlugins.Delete(lifecycle.PluginName)
defaultOnPlugins := sets.NewString(
lifecycle.PluginName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Alias the packages to admission plugin names so we can recognize these. I think this is namespacelifecycle.

Copy link
Member Author

Choose a reason for hiding this comment

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

Add later.

@@ -79,7 +79,7 @@ func NewAdmissionOptions() *AdmissionOptions {
// after all the mutating ones, so their relative order in this list
// doesn't matter.
RecommendedPluginOrder: []string{lifecycle.PluginName, initialization.PluginName, mutatingwebhook.PluginName, validatingwebhook.PluginName},
DefaultOffPlugins: sets.NewString(initialization.PluginName, mutatingwebhook.PluginName, validatingwebhook.PluginName),
Copy link
Contributor

Choose a reason for hiding this comment

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

split this out, it is non-contentious

@deads2k
Copy link
Contributor

deads2k commented Jan 23, 2018

This is a huge change. I'm strongly in favor, but we need to agree that we're willing to do this.

  1. People who previously controlled the admission chain using --admission-control will be fine and their options are still respected.
  2. People who specified no admission chains had a scarily exposed cluster they could not run securely, but now they'll suddenly get the admission chain and potentially breaks as things like service accounts will now be require. We've long recommended this, but we've never turned them on by default before.

@smarterclayton @bgrant0607 @kubernetes/api-approvers @lavalamp @erictune @liggitt for comment on having a default admission chain.

@hzxuzhonghu hzxuzhonghu force-pushed the default-enabled-admission branch 2 times, most recently from 4e9af03 to 21c1040 Compare January 24, 2018 08:16
@hzxuzhonghu
Copy link
Member Author

ping @smarterclayton @bgrant0607 @kubernetes/api-approvers @lavalamp @erictune @liggitt for comment on having a default admission chain.

@lavalamp
Copy link
Member

I am in favor of fixing this but I'm not sure this is the right way to do it.

  • I think the UX is super confusing. It's not good to break naive users (e.g., I bet this breaks the local-up script). So, at a minimum I think we need users to opt-in to the new system.
  • Changing entries in a default-on list is always going to be a breaking change. I think the right way to do this is to have apiserver store the list, probably somewhere in etcd. If the list is unset, then we write the defaults; otherwise, we use the list. That way, we could change the defaults without totally breaking everyone on upgrades.

@deads2k
Copy link
Contributor

deads2k commented Jan 30, 2018

I think the UX is super confusing. It's not good to break naive users (e.g., I bet this breaks the local-up script). So, at a minimum I think we need users to opt-in to the new system.

I'm ok with having a --disable-admission flag (which is what this would be). I'd like to have a timeline for having --disable-admission default to false.

Changing entries in a default-on list is always going to be a breaking change. I think the right way to do this is to have apiserver store the list, probably somewhere in etcd. If the list is unset, then we write the defaults; otherwise, we use the list. That way, we could change the defaults without totally breaking everyone on upgrades.

The idea of a "default on" list is that we think these are a good default for a safe and sane cluster, it's not a guarantee of particular plugins being on or off. Think about things like the PodToleration plugin. If you don't enable it in the same release that you added taint and toleration support, the feature presents
a risk to your cluster. Most cluster-admins probably want to have their safe cluster continue being safe.

@sttts
Copy link
Contributor

sttts commented Jan 30, 2018

How many (non-toy/dev) clusters are out there without --admission-control?

Compared with the big switch to RBAC-by-default, any serious cluster probably has admission plugins enabled anyway. This was very different for RBAC.

@bgrant0607
Copy link
Member

We need to think carefully about what we're trying to achieve.

If we want to make it easier for users to stay up to date with recommended admission controllers, I suggest a new flag along the lines of --enable-recommended-admission-controllers, and a warning if the existing flag is otherwise left unset.

@erictune
Copy link
Member

erictune commented Feb 6, 2018

I'm in favor of making this change, and having it be opt-out.

@erictune
Copy link
Member

erictune commented Feb 6, 2018

The release note needs to be more specific. Maybe append something like this:

If you previously had not set the `--admission-control` flag, your cluster behavior may change (to be more standard).  See [https://kubernetes.io/docs/admin/admission-controllers/] for explanation of admission control.

@hzxuzhonghu
Copy link
Member Author

@erictune ok, will update today.

@hzxuzhonghu hzxuzhonghu force-pushed the default-enabled-admission branch from 21c1040 to 64cb323 Compare February 6, 2018 04:17
@hzxuzhonghu
Copy link
Member Author

so many case failed with ServiceAccount plugin enabled.

@deads2k
Copy link
Contributor

deads2k commented Feb 6, 2018

so many case failed with ServiceAccount plugin enabled.

controllers not running maybe?

@deads2k
Copy link
Contributor

deads2k commented Feb 21, 2018

Sorry, I didn't see that this got itself sorted out.

/lgtm

squash up when you rebase

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 21, 2018
@hzxuzhonghu hzxuzhonghu force-pushed the default-enabled-admission branch from 1c81b14 to de6bb56 Compare February 22, 2018 02:11
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 22, 2018
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 22, 2018
@hzxuzhonghu
Copy link
Member Author

@deads2k @sttts squashed and rebased

@deads2k
Copy link
Contributor

deads2k commented Feb 22, 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 Feb 22, 2018
@hzxuzhonghu hzxuzhonghu force-pushed the default-enabled-admission branch from de6bb56 to 27f3fd2 Compare February 22, 2018 03:03
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 22, 2018
@hzxuzhonghu
Copy link
Member Author

run gofmt

@deads2k
Copy link
Contributor

deads2k commented Feb 22, 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 Feb 22, 2018
@deads2k deads2k added this to the v1.10 milestone Feb 22, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, hzxuzhonghu

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

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 270148d into kubernetes:master Feb 22, 2018
@hzxuzhonghu hzxuzhonghu deleted the default-enabled-admission branch February 22, 2018 13:27
setdefault.PluginName, //DefaultStorageClass
defaulttolerationseconds.PluginName, //DefaultTolerationSeconds
mutatingwebhook.PluginName, //MutatingAdmissionWebhook
validatingwebhook.PluginName, //ValidatingAdmissionWebhook
Copy link
Member

Choose a reason for hiding this comment

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

Why are webhooks off by default?

Copy link
Member

Choose a reason for hiding this comment

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

this looks to make them on by default, not off

Copy link
Member

Choose a reason for hiding this comment

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

My bad. I was reading the function name, not the variable name. Sorry for the noise.

jqmichael added a commit to jqmichael/website that referenced this pull request May 21, 2020
> * Default enabled admission plugins are now `NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota`. Please note that if you previously had not set the `--admission-control` flag, your cluster behavior may change (to be more standard). ([#58684](kubernetes/kubernetes#58684), [@hzxuzhonghu](https://github.com/hzxuzhonghu))


https://github.com/kubernetes/kubernetes/blob/a6b0eaecc99c07aef4952e8fae09642cabe4df5e/CHANGELOG/CHANGELOG-1.10.md#L1542
jqmichael added a commit to jqmichael/website that referenced this pull request May 31, 2020
> * Default enabled admission plugins are now `NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota`. Please note that if you previously had not set the `--admission-control` flag, your cluster behavior may change (to be more standard). ([#58684](kubernetes/kubernetes#58684), [@hzxuzhonghu](https://github.com/hzxuzhonghu))

https://github.com/kubernetes/kubernetes/blob/a6b0eaecc99c07aef4952e8fae09642cabe4df5e/CHANGELOG/CHANGELOG-1.10.md#L1542
jqmichael added a commit to jqmichael/website that referenced this pull request May 31, 2020
> * Default enabled admission plugins are now `NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota`. Please note that if you previously had not set the `--admission-control` flag, your cluster behavior may change (to be more standard). ([#58684](kubernetes/kubernetes#58684), [@hzxuzhonghu](https://github.com/hzxuzhonghu))

https://github.com/kubernetes/kubernetes/blob/a6b0eaecc99c07aef4952e8fae09642cabe4df5e/CHANGELOG/CHANGELOG-1.10.md#L1542
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. 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. 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.

9 participants