Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

knight42
Copy link
Member

@knight42 knight42 commented Nov 4, 2020

What type of PR is this?

/kind deprecation
/kind cleanup

What this PR does / why we need it:

Disable insecure serving in controller-manager

Which issue(s) this PR fixes:

xref #91506

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

[ACTION REQUIRED] controller-manager: the following flags have no effect and would be removed in v1.24:
* `--port`
* `--address`
The insecure port flags `--port` may only be set to 0 now.

In addtion, please be careful that:
* controller-manager MUST start with `--authorization-kubeconfig` and `--authentication-kubeconfig` correctly set to get authentication/authorization working.
* liveness/readiness probes to controller-manager MUST use HTTPS now, and the default port has been changed to 10257.
* Applications that fetch metrics from controller-manager should use a dedicated service account which is allowed to access nonResourceURLs `/metrics`.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 4, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Nov 4, 2020
@knight42
Copy link
Member Author

knight42 commented Nov 4, 2020

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 4, 2020
@knight42 knight42 force-pushed the refactor/disable-insecure-port-in-ctrler-mgr branch from b04a6b5 to f1f7014 Compare November 4, 2020 10:20
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 4, 2020
@knight42 knight42 force-pushed the refactor/disable-insecure-port-in-ctrler-mgr branch 4 times, most recently from be7dccc to f299bd9 Compare November 4, 2020 10:31
@k8s-ci-robot k8s-ci-robot added area/provider/gcp Issues or PRs related to gcp provider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. labels Nov 4, 2020
@knight42 knight42 force-pushed the refactor/disable-insecure-port-in-ctrler-mgr branch from f299bd9 to 023e6f0 Compare November 4, 2020 12:12
@liggitt
Copy link
Member

liggitt commented Nov 4, 2020

Looks like a couple legitimate CI failures, and the one comment about not exposing /metrics. Looks reasonable otherwise.

// this is fragile, which assumes that the default port is being used
// TODO: switch to secure port until these components remove the ability to serve insecurely.
serversToValidate := map[string]*componentstatus.Server{
"controller-manager": {Addr: "127.0.0.1", Port: ports.InsecureKubeControllerManagerPort, Path: "/healthz"},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this breaks the case where we're rolling back apiserver before controller-manager?

Copy link
Member

Choose a reason for hiding this comment

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

Per https://kubernetes.io/docs/setup/release/version-skew-policy/#kube-controller-manager-kube-scheduler-and-cloud-controller-manager:

kube-controller-manager, kube-scheduler, and cloud-controller-manager must not be newer than the kube-apiserver instances they communicate with.

This also only works for deployments where the controller-manager is colocated with the API server (since it uses localhost communication). In all the deployments I'm aware of, the API server and controller manager move versions together as static pods in lockstep.

@lavalamp
Copy link
Contributor

I think you can't turn off the insecure ports in the same release that you make communication go over the secure ports, some rollback scenarios are broken if we do that.

@lavalamp
Copy link
Contributor

/approve

Since Jordan thinks we don't need to worry about people rolling back wrong.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: knight42, lavalamp, sttts

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-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 10, 2021
@ingvagabund
Copy link
Contributor

/retest

@k8s-ci-robot
Copy link
Contributor

@knight42: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-integration 97b5d2a link /test pull-kubernetes-integration
pull-kubernetes-e2e-gce-ubuntu-containerd 97b5d2a link /test pull-kubernetes-e2e-gce-ubuntu-containerd

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.

@ingvagabund
Copy link
Contributor

/retest

@k8s-ci-robot k8s-ci-robot merged commit 7563d30 into kubernetes:master May 10, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone May 10, 2021
@knight42 knight42 deleted the refactor/disable-insecure-port-in-ctrler-mgr branch May 11, 2021 00:05
dghubble added a commit to poseidon/terraform-render-bootstrap that referenced this pull request Aug 11, 2021
* Kubernetes v1.22.0 disables kube-controller-manager insecure
port which was used internally for Prometheus metrics scraping
In Typhoon, we'll switch to using the https port which requires
Prometheus present a bearer token
* Go ahead and disable the insecure port for kube-scheduler too,
we'll configure Prometheus to scrape it with a bearer token as
well
* Remove unused kube-apiserver `--port` flag

Rel:

* kubernetes/kubernetes#96216
elemental-lf pushed a commit to elemental-lf/terraform-render-bootstrap that referenced this pull request Dec 11, 2021
* Kubernetes v1.22.0 disables kube-controller-manager insecure
port which was used internally for Prometheus metrics scraping
In Typhoon, we'll switch to using the https port which requires
Prometheus present a bearer token
* Go ahead and disable the insecure port for kube-scheduler too,
we'll configure Prometheus to scrape it with a bearer token as
well
* Remove unused kube-apiserver `--port` flag

Rel:

* kubernetes/kubernetes#96216
monogon-bot pushed a commit to monogon/monogon that referenced this pull request Apr 25, 2022
From logs:

  Flag --port has been deprecated, This flag has no effect now and will be removed in v1.24.

So that's what we do. We had this flag only set to disable insecure
serving, and insecure serving has been removed in upstream, thereby
rendering the use of this flag a no-op.

Controller-manager PR: kubernetes/kubernetes#96216
Scheduler PR: kubernetes/kubernetes#96345

Change-Id: If9009aa6f7c72a5ec8b7baf2326964167059c0a1
Reviewed-on: https://review.monogon.dev/c/monogon/+/665
Reviewed-by: Lorenz Brun <[email protected]>
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/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/provider/gcp Issues or PRs related to gcp provider area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.