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

[WIP] Update VM based templates with private IP and update Tiltfile #5248

Closed
wants to merge 23 commits into from

Conversation

nawazkh
Copy link
Member

@nawazkh nawazkh commented Nov 7, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:

  • This PR updates the templates (based off of VMs) to use private IP of the API Server of the control plane of the workload cluster for inter-node communication.
  • This PR also updates the Tiltfile with logic to peer AKS VNets with workload cluster's VNets.

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

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Update VM based templates to use Private IP solution for workload cluster's inter-node communication. Also update Tiltfile to update AKS Vnet with workload cluster's VNet

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 7, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 7, 2024
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 7, 2024
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 12, 2024
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.53%. Comparing base (7e9ebb9) to head (6cb4ead).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5248      +/-   ##
==========================================
- Coverage   53.00%   52.53%   -0.47%     
==========================================
  Files         272      272              
  Lines       29429    29433       +4     
==========================================
- Hits        15598    15463     -135     
- Misses      13027    13167     +140     
+ Partials      804      803       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@nawazkh nawazkh force-pushed the update_tilt_settings_yaml branch 2 times, most recently from 8eed73c to 40a2e9d Compare November 13, 2024 19:36
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 14, 2024
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 15, 2024
@nawazkh nawazkh marked this pull request as ready for review November 15, 2024 03:41
Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

This seems like a reasonable approach. Should we have somewhere to document which CIDR ranges are "reserved" by which flavors? If we add a new flavor, we'd want to make sure it doesn't overlap, and it would be better not to have that rely just on maintainers' memories.

local_resource(
name = "delete-all-workload-clusters",
cmd = kubectl_cmd + " delete clusters --all --wait=false",
cmd = ["sh", "-ec", delete_all_workload_clusters],
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to run this command with sh explicitly? It was just kubectl directly before, which seems more portable (although I doubt anyone is running make tilt-up on Windows).

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 think we do need sh here. We are updating delete_all_workload_clusters to have a bunch of delete vnet peering commands added in this function https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/5248/files#diff-c2ee8653e1d6b85f0aadf87cd438a9250806c052877248442be4d434cbc52425R522-R532


# copy the kubeadm configmap to the calico-system namespace.
# This is a workaround needed for the calico-node-windows daemonset to be able to run in the calico-system namespace.
if "windows" in flavor_name:
flavor_cmd += "; until " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig get configmap kubeadm-config --namespace=kube-system > /dev/null 2>&1; do sleep 5; done"
flavor_cmd += "; " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig create namespace calico-system --dry-run=client -o yaml | " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig apply -f -; " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig get configmap kubeadm-config --namespace=kube-system -o yaml | sed 's/namespace: kube-system/namespace: calico-system/' | " + kubectl_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig apply -f -"

# TODO: no one is clearing MGMT_CLUSTER_NAME when using KIND, so this is always going to be true. Improve this logic.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we create a GitHub issue to improve this? It's easy to forget about // TODO comments.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, good call out, will update the epic with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #5289

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from mboersma. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@nawazkh
Copy link
Member Author

nawazkh commented Nov 18, 2024

Lemme break this PR into multiple smaller PRs updating each of the templates. I will ship this PR with changes to default template and addressing the comments.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 18, 2024
@nawazkh
Copy link
Member Author

nawazkh commented Nov 18, 2024

Should we have somewhere to document which CIDR ranges are "reserved" by which flavors? If we add a new flavor, we'd want to make sure it doesn't overlap, and it would be better not to have that rely just on maintainers' memories.

Where could be a good place to put this?
Does a readme in /templates/flavors be a good place to put the CIDR matrix ?

@nawazkh
Copy link
Member Author

nawazkh commented Nov 18, 2024

Screenshot 2024-11-18 at 3 33 46 PM Something is up with GitHub, it is not letting me see my changes where I dropped my commits to just 5 instead of 23.

@k8s-ci-robot
Copy link
Contributor

@nawazkh: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-azure-e2e 6cb4ead link true /test pull-cluster-api-provider-azure-e2e
pull-cluster-api-provider-azure-windows-with-ci-artifacts 6cb4ead link false /test pull-cluster-api-provider-azure-windows-with-ci-artifacts
pull-cluster-api-provider-azure-windows-custom-builds 6cb4ead link false /test pull-cluster-api-provider-azure-windows-custom-builds

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-sigs/prow repository. I understand the commands that are listed here.

@nawazkh
Copy link
Member Author

nawazkh commented Nov 19, 2024

Sorry for the churn @mboersma , I need to close out this PR and open a new one. I will address your comments on there.

@nawazkh
Copy link
Member Author

nawazkh commented Nov 19, 2024

/close

@k8s-ci-robot
Copy link
Contributor

@nawazkh: Closed this PR.

In response to this:

/close

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-sigs/prow repository.

@nawazkh
Copy link
Member Author

nawazkh commented Nov 19, 2024

Should we have somewhere to document which CIDR ranges are "reserved" by which flavors? If we add a new flavor, we'd want to make sure it doesn't overlap, and it would be better not to have that rely just on maintainers' memories.

Where could be a good place to put this? Does a readme in /templates/flavors be a good place to put the CIDR matrix ?

Updated https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/5288/files#diff-e7ce6ca4dcc711afa1a2e1afdb50d9c9902749a29f4af50cde1a12f2e51f4858 with the CIDR matrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants