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

ntp: add config to filter and set ntp interfaces #11066

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

Pavan-Gunda
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind flake

/kind feature

What this PR does / why we need it:
It makes ntp interfaces configurable
Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Added a config option to filter ntp interfaces

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 8, 2024
Copy link

linux-foundation-easycla bot commented Apr 8, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @Pavan-Gunda!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 8, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @Pavan-Gunda. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 8, 2024
@Pavan-Gunda Pavan-Gunda changed the title ntp: add config to set which interface ntp should listen ntp: add config to filter and set ntp interfaces Apr 8, 2024
Copy link
Contributor

@cyclinder cyclinder left a comment

Choose a reason for hiding this comment

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

/ok-to-test

# Specify the interfaces
# Only takes effect when ntp_filter_interface is true
ntp_interfaces:
- ens3
Copy link
Contributor

Choose a reason for hiding this comment

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

It's risky. ens3 is an exact NIC name and is not applicable in most scenarios. I prefer to comment them out and suggest that when ntp_filter_interface is true, we should update the value of ntp_interfaces to match the node's NIC name.

But, do you think this still works for scenarios with inconsistent NIC names per node?

Copy link
Contributor Author

@Pavan-Gunda Pavan-Gunda Apr 9, 2024

Choose a reason for hiding this comment

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

Sure! I will comment out the ntp_interfaces section and add your suggestion as a comment.

When having inconsistent NIC names per node, One can have all interfaces from all nodes listed under this list of interfaces and if the interface does not exist on a node, I did a quick test and NTP simply just listens on the set of interfaces that do exist.

interface listen ens3
interface listen test

The ntp server logs looked something like this when I restarted the service

systemd[1]: Started Network Time Service.
ntpd[252818]: proto: precision = 0.050 usec (-24)
ntpd[252818]: restrict: 'monitor' cannot be disabled while 'limited' is enabled
ntpd[252818]: Listen normally on 0 lo 127.0.0.1:123
ntpd[252818]: Listen normally on 1 ens3 xx.xx.xx.xx:123
ntpd[252818]: Listen normally on 2 lo [::1]:123
ntpd[252818]: Listen normally on 3 ens3 [xxx.xxx.xxx.xxx]:123
ntpd[252818]: Listen normally on 4 ens3 [xxx.xxx.xxx.xxx]:123
ntpd[252818]: Listening on routing socket on fd #21 for interface updates

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @Pavan-Gunda , It looks like the ntp_interfaces section is still not commented out. Is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi!

I commented ntp_interfaces section out now. :)

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 9, 2024
interface listen {{ item }}
{% endfor %}
{% endif %}

Copy link
Member

Choose a reason for hiding this comment

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

# Some comments
{% for item in ntp_interfaces %}
interface {{ item }}
{% endfor %}

@@ -98,6 +98,12 @@ ntp_servers:
ntp_restrict:
- "127.0.0.1"
- "::1"
# Specify whether to filter interfaces
Copy link
Member

Choose a reason for hiding this comment

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

HI @Pavan-Gunda

Because there is only one variable that needs to be config, so

# Some comments
# Uncomment `ntp_interfaces` if enable xxxx
# ntp_interfaces: 
#   - ignore wildcard
#   - isten xxx

Which Can be easier for the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you 👍

I made the change now and pushed the code :)

@yankay
Copy link
Member

yankay commented Apr 11, 2024

Thanks @Pavan-Gunda
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Pavan-Gunda, yankay

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 Apr 11, 2024
@Pavan-Gunda
Copy link
Contributor Author

Pavan-Gunda commented Apr 25, 2024

Hi @cyclinder and @yankay

This pull request apparently also requires an LGTM label for me to be able to merge this. Can I get some help with that :)

@cyclinder
Copy link
Contributor

Thanks @Pavan-Gunda!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 25, 2024
@k8s-ci-robot k8s-ci-robot merged commit 538deff into kubernetes-sigs:master Apr 25, 2024
60 checks passed
@mzaian mzaian mentioned this pull request Apr 26, 2024
dibi-codes pushed a commit to fino-digital/kubespray that referenced this pull request May 7, 2024
* ntp: add config to set which interface ntp should listen

* Fixed config to only have one variable
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
* ntp: add config to set which interface ntp should listen

* Fixed config to only have one variable
Rickkwa pushed a commit to Rickkwa/kubespray that referenced this pull request Jun 26, 2024
* ntp: add config to set which interface ntp should listen

* Fixed config to only have one variable
davidumea pushed a commit to elastisys/kubespray that referenced this pull request Oct 25, 2024
* ntp: add config to set which interface ntp should listen

* Fixed config to only have one variable
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

4 participants