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

deprecate insecure http flags and remove already deprecated flags #59018

Merged
merged 1 commit into from
Jan 30, 2018

Conversation

hzxuzhonghu
Copy link
Member

@hzxuzhonghu hzxuzhonghu commented Jan 30, 2018

What this PR does / why we need it:

  1. deprecate insecure-bind-address insecure-port flags
  2. remove flags public-address-override address port They are mark deprecated in move parts of the mega generic run struct out #36604, which is more than a year ago.

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 #58951

Special notes for your reviewer:

Release note:

Deprecate insecure flags `--insecure-bind-address`, `--insecure-port` and remove  `--public-address-override`.

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

/assign @deads2k @sttts

@hzxuzhonghu
Copy link
Member Author

/assign @gmarek

@@ -1518,7 +1518,6 @@ function start-kube-apiserver {

# Calculate variables and assemble the command line.
local params="${API_SERVER_TEST_LOG_LEVEL:-"--v=2"} ${APISERVER_TEST_ARGS:-} ${CLOUD_CONFIG_OPT}"
params+=" --address=127.0.0.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

--address is removed, insecure-bind-address is deprecated.

@hzxuzhonghu
Copy link
Member Author

/assign @bowei

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jan 30, 2018

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

Test name Commit Details Rerun command
pull-kubernetes-e2e-gke 9152862a4a61205ed127f47aa3ed46dd9695d29c link /test pull-kubernetes-e2e-gke

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.

@hzxuzhonghu
Copy link
Member Author

kops is using --address, should not execute until kops stop using --address.

  1. remove flags public-address-override address port They are mark deprecated in move parts of the mega generic run struct out #36604, which is more than a year ago.

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

/unassign @bowei @gmarek

@sttts
Copy link
Contributor

sttts commented Jan 30, 2018

kops is using --address, should not execute until kops stop using --address.

Are there issues in those projects to remove the deprecated use?

@sttts
Copy link
Contributor

sttts commented Jan 30, 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 Jan 30, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 30, 2018
@hzxuzhonghu
Copy link
Member Author

Are there issues in those projects to remove the deprecated use?

Yes, I create one kubernetes/kops#4355

@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 2f175bc into kubernetes:master Jan 30, 2018
@hzxuzhonghu hzxuzhonghu deleted the deprecate-http branch January 30, 2018 11:46
@justinsb
Copy link
Member

justinsb commented Feb 2, 2018

Do we have a solution for #43784 ?

@deads2k
Copy link
Contributor

deads2k commented Feb 5, 2018

Do we have a solution for #43784 ?

Health checks? /healthz isn't confidential and default policy allows anonymous access.

rfranzke added a commit to gardener/gardener that referenced this pull request Mar 2, 2018
As of Kubernetes 1.10, the insecure flags will be deprecated: kubernetes/kubernetes#59018
Currently, there is no other way to allow unauthenticated health checks (requests on kube-apiserver's /healthz endpoint) other than allowing anonymous requests (which we do not want). Related issue: kubernetes/kubernetes#43784
We are now going to use the basic authentication credentials which the kubelet will use to reach the /healthz endpoint.

fs.IntVar(&s.BindPort, "insecure-port", s.BindPort, ""+
"The port on which to serve unsecured, unauthenticated access. It is assumed "+
"that firewall rules are set up such that this port is not reachable from outside of "+
"the cluster and that port 443 on the cluster's public address is proxied to this "+
"port. This is performed by nginx in the default setup. Set to zero to disable")
"port. This is performed by nginx in the default setup. Set to zero to disable.")
fs.MarkDeprecated("insecure-port", "This flag will be removed in a future version.")
Copy link
Member

Choose a reason for hiding this comment

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

marking this deprecated actually omits it from the help, which means the fact that it is enabled by default and you need to "Set to zero to disable." is invisible to the end user. That is not good.

Copy link
Contributor

Choose a reason for hiding this comment

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

Never understood this behaviour.

@mwthink
Copy link

mwthink commented Apr 13, 2018

The API server still serves on localhost:8080 by default. Is this expected to be the case going forward, or is insecure access being removed entirely?

If the latter, it should be disabled by default, but if that's the case, what about health endpoints? Am I going to need a sidecar container to validate the TLS and proxy /healthz over HTTP?

Edit - For anyone coming along later, check out #43784

@deads2k
Copy link
Contributor

deads2k commented Apr 16, 2018

The API server still serves on localhost:8080 by default. Is this expected to be the case going forward, or is insecure access being removed entirely?

Nothing should be relying on the insecure port. It is a target for future removal.

@javefang
Copy link

javefang commented Apr 16, 2018

@deads2k we are running the apiserver as a static pod on master nodes, which currently requires the apiserver to listen on an insecure port 8080 on localhost for kubelet to be able to talk to it. All other worker nodes' kubelet uses the "--bootstrap-kubeconfig" to perform TLS bootstrapping once the apiserver is up.

I tried to use the same "--bootstrap-kubeconfig" for kubelet running on master, but it complains that it can't reach the apiserver (for obvious reason) and crash, without starting the apiserver/controller-manager/scheduler pods defined in the manifests.

Is there a proper way for kubelet on master to talk to the apiserver without utilising the --insecure-port and --insecure-bind-address?

Environment:
OS: Centos 7.3
Docker: 1.12.6
Kubernetes 1.10.1

@deads2k
Copy link
Contributor

deads2k commented Apr 16, 2018

Short lived client certificates are a good option since the kubelet running the kube-apiserver is effectively root on the cluster already.

dghubble added a commit to poseidon/terraform-render-bootstrap that referenced this pull request Jun 28, 2018
* Although the --insecure-port flag is deprecated, apiserver
continues to default to listening on 127.0.0.1:8080
* Explicitly disable insecure local listener since its unused
* kubernetes/kubernetes#59018 (comment)
* 5f3546b
@mrmm
Copy link

mrmm commented Oct 2, 2018

Update, thanks @justinsb implemented this for Kops (PR kubernetes/kops#5234)
Cheers 🍺

justinsb added a commit to justinsb/kubernetes that referenced this pull request Feb 18, 2019
Though the flags are deprecated, the deprecation process revealed that
the flag is important for health checks in more secure environments.
Add a link to kubernetes#43784 to help developers understand why the flags have
not yet been removed.

Issue kubernetes#43784
Issue kubernetes#74172
Issue kubernetes#59018
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.

Should deprecate kubeapiserver insecure http schema