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

Move healthz check to secure ports #6446

Merged

Conversation

floryut
Copy link
Member

@floryut floryut commented Jul 23, 2020

What type of PR is this?
/kind feature

What this PR does / why we need it:
Insecure port were deprecated and are now removed by default (since 1.17.9, 1.18.6 etc..)

Which issue(s) this PR fixes:
None

Special notes for your reviewer:
None

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 23, 2020
@k8s-ci-robot k8s-ci-robot requested review from bozzo and holmsten July 23, 2020 14:05
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 23, 2020
@floryut floryut force-pushed the change_scheduler_manager_healthz branch from f6b2e44 to a1d732f Compare July 23, 2020 14:49
@floryut floryut force-pushed the change_scheduler_manager_healthz branch from a1d732f to ecdb710 Compare July 24, 2020 06:50
@EppO
Copy link
Contributor

EppO commented Jul 24, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 24, 2020
@@ -111,8 +113,6 @@
uri:
url: "{{ kube_apiserver_endpoint }}/healthz"
validate_certs: no
client_cert: "{{ kube_apiserver_client_cert }}"
client_key: "{{ kube_apiserver_client_key }}"
register: result
Copy link
Contributor

Choose a reason for hiding this comment

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

why removing the certs here?

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 keep them but as the validate certs is set to 'no' they are unused

@@ -93,15 +93,17 @@

- name: Master | wait for kube-scheduler
uri:
url: http://localhost:10251/healthz
url: https://localhost:10259/healthz
validate_certs: no
register: scheduler_result
Copy link
Contributor

@EppO EppO Jul 24, 2020

Choose a reason for hiding this comment

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

I assume we can use kube_apiserver_client_cert/kube_apiserver_client_key to validate both scheduler and controller manager endpoints, because they point to {{ kube_cert_dir }}/ca.crt by default but I'm wondering if that's a good solution to rely on a defaults that people can change.

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 tried to validate the url using certs but seems maybe the ca is needed or another issue as I wasn't able to query using the correct certs (even the API Server check doesn't work without the 'validate certs' set to no

Regarding the default you mean the ports? If so indeed but as we don't have a kubespray variable for that we don't have to worry I'd say.. Maybe we can add a variable and use it here with 10259 as the default

@Miouge1
Copy link
Contributor

Miouge1 commented Jul 27, 2020

I could see that we move to https without cert validation in this PR and do cert validation in another PR desirable?

@floryut
Copy link
Member Author

floryut commented Jul 27, 2020

I could see that we move to https without cert validation in this PR and do cert validation in another PR desirable?

@Miouge1 you mean this one ? https://github.com/kubernetes-sigs/kubespray/pull/6435/files I indeed tried to apply some certs but never manage to got a valid curl with ansible uri module.. and I saw that even the API check below fail without validate_certs: no .. so as the check is locally done and only to ensure health, not sure if we need to overthink this

@Miouge1
Copy link
Contributor

Miouge1 commented Jul 27, 2020

Considering that this is currently http, it's still better than nothing :)

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, Miouge1

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 Jul 27, 2020
@k8s-ci-robot k8s-ci-robot merged commit b680cdd into kubernetes-sigs:master Jul 27, 2020
floryut added a commit to floryut/kubespray that referenced this pull request Jul 27, 2020
erulabs added a commit to kubesail/kubespray that referenced this pull request Jul 29, 2020
* 'master' of https://github.com/kubernetes-sigs/kubespray:
  Documentation for Ingress (kubernetes-sigs#6378)
  Fix ansible-lint E301 for commands fetching data (kubernetes-sigs#6465)
  Fix shellcheck url (kubernetes-sigs#6462)
  Fix ansible-lint E305 (kubernetes-sigs#6459)
  Fix ansible-lint E404 (kubernetes-sigs#6417)
  Update README.md and openstack.md (kubernetes-sigs#6455)
  Add noqa and disable .ansible-lint global exclusions (kubernetes-sigs#6410)
  Move healthz check to secure ports (kubernetes-sigs#6446)
  Update multus version & crio conf (kubernetes-sigs#6444)
  Fix remove etcd broken with etcdctl_api 3 (kubernetes-sigs#6448)
  update cinder csi manifests (kubernetes-sigs#6434)
  Update docker package to 19.03.12 (kubernetes-sigs#6439)
  * add proxy_env definition to remove_node.yml resolving kubernetes-sigs#6430 (kubernetes-sigs#6431)
floryut added a commit to floryut/kubespray that referenced this pull request Jul 30, 2020
k8s-ci-robot pushed a commit that referenced this pull request Aug 1, 2020
* Move healthz check to secure ports (#6446) (#6457)

* Update hashes and set default version to 1.16.13
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Sep 17, 2020
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

4 participants