Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Customization for nameserver/searchDomain/ntpServer for vSphere cc mode #3617

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

ydp
Copy link

@ydp ydp commented Oct 11, 2022

What this PR does / why we need it

We need to support officially documented ytt overlay customization in CC mode. This PR address 3 of them:

  • Nameservers on vSphere (This one is just a fix, add indentation and support multiple nameserver)
  • Resolve .local Domain
  • Configuring NTP without DHCP Option 42

Which issue(s) this PR fixes

Part of #3616

Describe testing done for PR

Manually create CC cluster with customization.

Release note

Support customization for nameserver/searchDomain/ntpServer when creating CC based cluster on vSphere

Doc

Nameservers on vSphere

  1. Enable custom-nameservers flag:
    tanzu config set features.management-cluster.custom-nameservers true
  2. Add below variable in config file to customize name server on control plane and worker nodes, for example:
CONTROL_PLANE_NODE_NAMESERVERS: 10.132.7.1, 10.142.7.1
WORKER_NODE_NAMESERVERS: 10.132.7.1, 10.142.7.1

Validate whether it's set successfully, login into the control plane or worker node vm:

$ cat /etc/systemd/network/10-cloud-init-eth0.network
[Network]
DHCP=ipv4
DNS=10.132.7.1 10.142.7.1

Resolve .local Domain

Add below variable in config file to customize search domain:

CONTROL_PLANE_NODE_SEARCH_DOMAINS: eng.vmware.com, vmware.com
WORKER_NODE_SEARCH_DOMAINS: eng.vmware.com, vmware.com

Validate whether it's set successfully, login into the control plane or worker node vm:

$ cat /etc/systemd/network/10-cloud-init-eth0.network
[Network]
DHCP=ipv4
Domains=eng.vmware.com vmware.com

Configuring NTP without DHCP Option 42 (vSphere)

Add below variable in config file to customize ntp servers:

NTP_SERVERS: time.google.com

Validate whether it's set successfully, login into the control plane or worker node vm:

$ cat /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# servers
server time.google.com iburst

Additional information

Special notes for your reviewer

@ydp ydp requested review from a team as code owners October 11, 2022 04:19
@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Merging #3617 (58456af) into main (7a3435b) will decrease coverage by 0.93%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3617      +/-   ##
==========================================
- Coverage   46.26%   45.32%   -0.94%     
==========================================
  Files         400      425      +25     
  Lines       39624    41188    +1564     
==========================================
+ Hits        18331    18668     +337     
- Misses      19605    20810    +1205     
- Partials     1688     1710      +22     
Impacted Files Coverage Δ
addons/controllers/machine_controller.go 65.65% <0.00%> (-3.04%) ⬇️
addons/controllers/clusterbootstrap_controller.go 63.26% <0.00%> (-1.61%) ⬇️
cmd/cli/plugin/cluster/credentials_update.go 9.23% <0.00%> (ø)
cmd/cli/plugin/cluster/delete_node_pool.go 16.66% <0.00%> (ø)
cmd/cli/plugin/cluster/machinehealthcheck.go 100.00% <0.00%> (ø)
cmd/cli/plugin/cluster/main.go 0.00% <0.00%> (ø)
cmd/cli/plugin/cluster/delete.go 12.50% <0.00%> (ø)
...in/cluster/get_machinehealthcheck_control_plane.go 11.11% <0.00%> (ø)
...i/plugin/cluster/delete_machinehealthcheck_node.go 16.66% <0.00%> (ø)
cmd/cli/plugin/cluster/set_machinehealthcheck.go 23.33% <0.00%> (ø)
... and 18 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@wjun
Copy link
Contributor

wjun commented Oct 12, 2022

LGTM. Please rebase the codes from main branch and clear the checks failure.

@ydp ydp force-pushed the topic/dingpingy/ytt-customization branch 3 times, most recently from a0bb41d to 5d102d3 Compare October 12, 2022 07:09
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3617/20221012072253/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@wjun wjun added the ok-to-merge PRs should be labelled with this before merging label Oct 13, 2022
Copy link
Contributor

@wjun wjun left a comment

Choose a reason for hiding this comment

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

LGTM after rebase the codes to solve the conflicts.

@ydp ydp force-pushed the topic/dingpingy/ytt-customization branch from 5d102d3 to 58456af Compare October 14, 2022 11:28
@ydp ydp changed the title Support customization for nameserver/searchDomain/ntpServer in CC mode Customization for nameserver/searchDomain/ntpServer for vSphere cc mode Oct 14, 2022
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3617/20221014113921/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@ydp
Copy link
Author

ydp commented Oct 14, 2022

Rebased the code and Updated commit title to reflect it's only for vSphere.
All pipeline passed.

@ydp ydp merged commit 8907c74 into main Oct 14, 2022
@ydp ydp deleted the topic/dingpingy/ytt-customization branch October 14, 2022 13:43
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
cla-not-required ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants