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: do not use --admission-control for the API server #64165

Merged
merged 1 commit into from
May 29, 2018

Conversation

neolit123
Copy link
Member

@neolit123 neolit123 commented May 22, 2018

What this PR does / why we need it:
The API server argument --admission-control is deprecated.
Use the following arguments instead:
--enable-admission-plugins=NodeRestriction
--disable-admission-plugins=PersistentVolumeLabel

Add comment that PersistentVolumeLabel should be removed at some
point in 1.11.

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

Special notes for your reviewer:
NONE

Release note:

kubeadm: when starting the API server use the arguments --enable-admission-plugins and --disable-admission-plugins instead of the deprecated --admission-control.

@luxas
@kubernetes/sig-cluster-lifecycle-pr-reviews
/area 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. area/kubeadm 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 22, 2018
@@ -154,7 +154,8 @@ func TestGetAPIServerCommand(t *testing.T) {
expected: []string{
"kube-apiserver",
"--insecure-port=0",
"--admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota",
"--enable-admission-plugin=NodeRestriction",
"--disable-admission-plugin=PersistentVolumeLabel",
Copy link
Member

Choose a reason for hiding this comment

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

If this is deprecated I don't know why we need to explicitly specify.

Copy link
Member Author

Choose a reason for hiding this comment

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

@luxas can comment further i guess, i was just following the guide here:
kubernetes/kubeadm#840

Copy link
Member

Choose a reason for hiding this comment

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

It's still enabled by default which is a bug. Until that bug is fixed, let's leave it out here.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with defaulting off, but lets cross-link an issue.

Copy link
Member Author

@neolit123 neolit123 May 24, 2018

Choose a reason for hiding this comment

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

should i cross link to this (i.e. adding a comment with link in the code)?:
kubernetes/kubeadm#840

Copy link
Member

Choose a reason for hiding this comment

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

@neolit123 I'm thinking about the api-server deprecation default issue, should be in the main repo somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

i can't seem to find it. only found the PR that deprecated admission-control: #58123

Copy link
Member

Choose a reason for hiding this comment

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

#64326 and #52617 and #52618

Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

Thanks @neolit123! Can you use kubeadm with this patch to start up both a v1.10 cluster and a v1.11-beta.0 API server and post the final admission chain that was loaded (it's printed in the API server logs in the beginning), so we have a double-check that everything we want to be running actually is?
/approve

@@ -143,7 +143,8 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration) []string {
defaultArguments := map[string]string{
"advertise-address": cfg.API.AdvertiseAddress,
"insecure-port": "0",
"admission-control": defaultAdmissionControl,
Copy link
Member

Choose a reason for hiding this comment

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

please remove the unused variable

Copy link
Member Author

@neolit123 neolit123 May 22, 2018

Choose a reason for hiding this comment

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

will do.

edit: done

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2018
@luxas luxas self-assigned this May 22, 2018
@neolit123
Copy link
Member Author

Thanks @neolit123! Can you use kubeadm with this patch to start up both a v1.10 cluster and a v1.11-beta.0 API server and post the final admission chain that was loaded (it's printed in the API server logs in the beginning), so we have a double-check that everything we want to be running actually is?
/approve

ha!! as long as my control plane even starts. my setup is beyond broken ATM and it's not really kubeadm's fault. i can try...

@stealthybox
Copy link
Member

stealthybox commented May 22, 2018

@neolit123 if your personal lab is non-functional, this should serve the need:
https://github.com/kubernetes/kubeadm/tree/master/vagrant

just change the package versions in the Vagrantfile to 1.10.2 instead of 1.9.7 and then follow the guide for comparing different builds with the already installed kubeadm binary

@neolit123
Copy link
Member Author

yeah @stealthybox . we spoke about it at KubeCon.
i didn't had the time to try it, but i definitely need to find the time...

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 25, 2018
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 25, 2018
@@ -143,7 +141,9 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration) []string {
defaultArguments := map[string]string{
"advertise-address": cfg.API.AdvertiseAddress,
"insecure-port": "0",
"admission-control": defaultAdmissionControl,
// https://github.com/kubernetes/kubeadm/issues/840
Copy link
Member Author

Choose a reason for hiding this comment

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

^ added link to the issue here.

@neolit123
Copy link
Member Author

/test pull-kubernetes-kubemark-e2e-gce-big
/test pull-kubernetes-node-e2e

@neolit123
Copy link
Member Author

/test pull-kubernetes-node-e2e
/test pull-kubernetes-kubemark-e2e-gce-big

Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

Please fix these comments. After that this LGTM

"admission-control": defaultAdmissionControl,
"advertise-address": cfg.API.AdvertiseAddress,
"insecure-port": "0",
// https://github.com/kubernetes/kubernetes/pull/58123
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we should have this here...

"insecure-port": "0",
// https://github.com/kubernetes/kubernetes/pull/58123
"enable-admission-plugin": "NodeRestriction",
"disable-admission-plugin": "PersistentVolumeLabel",
Copy link
Member

Choose a reason for hiding this comment

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

Add a TODO to remove this in kubeadm v1.11, as it's automatically disabled in v1.11, and reference #64326.
We can't skip it now as we support v1.10 clusters still.

"advertise-address": cfg.API.AdvertiseAddress,
"insecure-port": "0",
// https://github.com/kubernetes/kubernetes/pull/58123
"enable-admission-plugin": "NodeRestriction",
Copy link
Member

Choose a reason for hiding this comment

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

These are actually called enable/disable-admission-plugins

@@ -154,7 +154,8 @@ func TestGetAPIServerCommand(t *testing.T) {
expected: []string{
"kube-apiserver",
"--insecure-port=0",
"--admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota",
"--enable-admission-plugin=NodeRestriction",
"--disable-admission-plugin=PersistentVolumeLabel",
Copy link
Member

Choose a reason for hiding this comment

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

#64326 and #52617 and #52618

@neolit123
Copy link
Member Author

neolit123 commented May 26, 2018

updated.

  • fixed typo - missing s in argument keys
  • add TODO comment above PersistentVolumeLabel usage

added the same TODO note here and also made this PR not close the issue:
kubernetes/kubeadm#840

The API server argument --admission-control is deprecated.
Use the following arguments instead:
  --enable-admission-plugins=NodeRestriction
  --disable-admission-plugins=PersistentVolumeLabel

Add comment that PersistentVolumeLabel should be removed at some
point in 1.11.
Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 28, 2018
@luxas
Copy link
Member

luxas commented May 28, 2018

/retest

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: luxas, neolit123

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

@neolit123
Copy link
Member Author

/test pull-kubernetes-e2e-gce-100-performance
/test pull-kubernetes-e2e-gce
/test pull-kubernetes-e2e-gce-device-plugin-gpu

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 64308, 64367, 64165, 64274). If you want to cherry-pick this change to another branch, please follow the instructions here.

@Arnavion
Copy link

Using minikube to create a 1.11.0 cluster puts this in /etc/kubernetes/manifests/kube-apiserver.yaml :

spec:
  containers:
  - command:
    - kube-apiserver
    - --admission-control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota
    <snip>
    - --disable-admission-plugins=PersistentVolumeLabel
    - --enable-admission-plugins=NodeRestriction

so apiserver fails to start because admission-control and enable-admission-plugins/disable-admission-plugins flags are mutually exclusive

$ minikube version

minikube version: v0.28.0

and inside the cluster VM:

$ kubeadm version 

kubeadm version: &version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:14:41Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}

The enable/disable parameters are presumably coming because of this PR, so is there some place left that's still creating the default admission control parameter list?

@neolit123
Copy link
Member Author

the --admission-control part should not be there. it's unclear to me what's adding it.

@Arnavion
Copy link

Arnavion commented Jun 28, 2018

Ah, it's coming from the MasterConfiguration/apiServerExtraArgs in the config file passed to kubeadm. So this is probably minikube creating the file incorrectly. Will follow up there.

@neolit123
Copy link
Member Author

@Arnavion
Copy link

Yeah, just found it. I'll file a bug there.

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.

None yet

8 participants