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

Fix template issues in vsphere clusterclass implementation #3173

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

tenczar
Copy link
Contributor

@tenczar tenczar commented Aug 22, 2022

What this PR does / why we need it

This PR updates ytt and go text templates for vsphere clusterclass that prevented successful deployment of clusterclass based capv clusters. Changes include:

  • Fix indentation issue in VsphereMachineTemplate when updating network settings
  • Fix the kube-vip image and tag declaration to properly access resources from TKR_DATA
  • Adds a regex matcher for applying node labels. This prevents values from the TKR_DATA being used as node-labels if those values are not valid node-label values
  • Fix machineHealthCheck definition to only add this block if a cluster definition specifies mhcs.
  • Fixes credential values
  • Fixes an issue with incorrectly typed config values being passed to the clusterbootstrap

Which issue(s) this PR fixes

Fixes #3439

Describe testing done for PR

Manually deployed a clusterclass based management cluster using Antrea and validated that the cluster is created successfully.

Release note

Fixes vsphere clusterclass definition to successfully deploy clusterclass capv clusters.

Additional information

Special notes for your reviewer

@tenczar tenczar requested review from a team as code owners August 22, 2022 21:06
@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch 3 times, most recently from 4433ebe to 17f54a2 Compare August 25, 2022 20:20
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220825203057/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.

@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220830205618/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.

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from fed3b3c to 276383f Compare August 30, 2022 21:47
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220830215528/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.

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from 276383f to 4ccd9a8 Compare August 31, 2022 00:39
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220831004650/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.

@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220831190945/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.

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from b509df4 to e194a3e Compare August 31, 2022 20:18
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220831202948/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.

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from e194a3e to d8bde5d Compare September 1, 2022 19:53
@tenczar tenczar requested a review from a team as a code owner September 1, 2022 19:53
@github-actions
Copy link

github-actions bot commented Sep 1, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220901200148/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.

@@ -174,9 +174,9 @@ NSXT_PASSWORD: ""
#! NSX-T host
NSXT_MANAGER_HOST: ""
#! set this to true if NSX-T uses self-signed cert
NSXT_ALLOW_UNVERIFIED_SSL: "false"
NSXT_ALLOW_UNVERIFIED_SSL: false
Copy link
Contributor

@vuil vuil Sep 6, 2022

Choose a reason for hiding this comment

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

@tenczar : this change enables legacy config file not specifying this value to work correctly with the vsphere CC, but this changes the behavior when we need to use the equivalent legacy config file in fallback (pure client side ytt) mode.

Either existing logic that assumed string instead of bool will have to be updated (see ytt/02_addons/cpi/cpi_addon_data.lib.yaml and associated vendir-ed code)

or we should consider retaining the definition/semantics of the variables in config_default.yaml (and fixing on the yttcc side to translate the string to bool)

(same for NSXT_REMOTE_AUTH)

Copy link
Contributor

@lubronzhan lubronzhan Sep 7, 2022

Choose a reason for hiding this comment

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

Either existing logic that assumed string instead of bool will have to be updated (see ytt/02_addons/cpi/cpi_addon_data.lib.yaml and associated vendir-ed code)

If we change the existing logic, will the upgrade break, since customer's previous value is still string

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for reminding me. We will look for convertion for CC to avoid breaking existing logic.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we change the existing logic, will the upgrade break, since customer's previous value is still string

@lubronzhan if we elect to change the legacy overlays for handling cpi addons, it will have to be done in a way that accepts both a string and a bool to not break upgrade (or when we need to fallback to legacy creation, for that matter)

Copy link
Contributor

Choose a reason for hiding this comment

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

@vuil Yeah that's my concern, since we can't break customer's upgrade path.

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch 3 times, most recently from e6b15c3 to 2c1c825 Compare September 9, 2022 01:14
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220909011718/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.

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220909012008/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.

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220909012600/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.

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from 2c1c825 to 741aaef Compare September 12, 2022 19:24
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220912193233/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.

@vuil vuil added the do-not-merge/wip Still work in progress label Sep 13, 2022
@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from 741aaef to 1de66e6 Compare September 14, 2022 19:06
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220914191809/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.

@DanielXiao
Copy link
Contributor

@tenczar PR to fix CPI/CSI issue is #3320

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from 1de66e6 to 4f0c972 Compare September 20, 2022 17:57
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220920180826/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.

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from 4f0c972 to 595d6c4 Compare September 20, 2022 22:34
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220920224430/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.

@tenczar tenczar changed the title WIP vsphere cc changes. Fix template issues in vsphere clusterclass implementation Sep 20, 2022
@tenczar tenczar removed the do-not-merge/wip Still work in progress label Sep 20, 2022
@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from 595d6c4 to 2dd7bfb Compare September 21, 2022 01:52
@tenczar tenczar added the ok-to-merge PRs should be labelled with this before merging label Sep 21, 2022
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220921020302/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.

@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Merging #3173 (fbdb2bf) into main (142aa6f) will increase coverage by 0.54%.
The diff coverage is 90.05%.

@@            Coverage Diff             @@
##             main    #3173      +/-   ##
==========================================
+ Coverage   53.12%   53.66%   +0.54%     
==========================================
  Files         103       91      -12     
  Lines       10419    10002     -417     
==========================================
- Hits         5535     5368     -167     
+ Misses       4429     4193     -236     
+ Partials      455      441      -14     
Impacted Files Coverage Δ
...sphere-template-resolver/templateresolver/types.go 42.10% <42.10%> (ø)
...ter/vsphere-template-resolver/template/resolver.go 89.91% <89.91%> (ø)
...emplate-resolver/templateresolver/resolver_impl.go 99.02% <99.02%> (ø)
...re-template-resolver/templateresolver/interface.go 100.00% <100.00%> (ø)
...ntroller/tkr-status/clusterstatus/clusterstatus.go 45.35% <0.00%> (-2.19%) ⬇️
addons/controllers/clusterbootstrap_controller.go 62.92% <0.00%> (-1.63%) ⬇️
capabilities/client/pkg/discovery/cluster_gvr.go
...apabilities/client/pkg/discovery/cluster_object.go
...apabilities/client/pkg/discovery/cluster_schema.go
capabilities/client/pkg/discovery/discovery.go
... and 12 more

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

@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from 2dd7bfb to d001524 Compare September 22, 2022 00:50
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220922010339/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.

Fix missing config_default values
add missing "USE_TOPOLOGY_CATEGORIES" config variable with default
value of false.

properly convert boolean values to bool in clusterbootstrap.yml

Use kube-vip specific imageRepository for deploying kube-vip

ccluster gen hack to add resolve-os-image

Fix cb secret handling

fix indentation in vpshere machine template network defintion

updates patches so node-labels avoid adding illegal labels
@tenczar tenczar force-pushed the topic/ntenczar/vsphere_cc branch from d001524 to fbdb2bf Compare September 23, 2022 18:08
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3173/20220923182235/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.

Copy link
Contributor

@imikushin imikushin left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks @tenczar! (for the change and for your patience)

@tenczar tenczar merged commit 81af532 into main Sep 28, 2022
@tenczar tenczar deleted the topic/ntenczar/vsphere_cc branch September 28, 2022 00:25
# 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.

ClusterClass based capv Clusters don't provision successfully.
8 participants