-
Notifications
You must be signed in to change notification settings - Fork 431
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
Peer AKS VNet for apiserver-ilb template #5288
Peer AKS VNet for apiserver-ilb template #5288
Conversation
Skipping CI for Draft Pull Request. |
d24a789
to
dd27c47
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5288 +/- ##
=======================================
Coverage 52.43% 52.43%
=======================================
Files 272 272
Lines 29401 29401
=======================================
Hits 15417 15417
Misses 13178 13178
Partials 806 806 ☔ View full report in Codecov by Sentry. |
cbba70f
to
3025950
Compare
if settings.get("container_args"): | ||
capz_container_args = settings.get("container_args").get("capz-controller-manager") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have often struggled in getting more logs outputted while running in tilt.
With this change, if we add the below yaml fields to our tilt-settings.yaml, we will can play around with more logging
container_args:
capz-controller-manager:
- "--v=2"
This comment was marked as outdated.
This comment was marked as outdated.
/retest |
this PR needs to be held for feature flag for ILB can be added. |
3025950
to
b3a6424
Compare
cca6f89
to
f0b219e
Compare
9ba18dd
to
3d125d8
Compare
/test pull-cluster-api-provider-azure-windows-custom-builds |
Tiltfile
Outdated
def peer_vnets(): | ||
# TODO: check for az cli to be installed in local | ||
# wait for AKS VNet to be in the state created | ||
peering_cmd = "; echo \"--------Peering VNETs--------\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we maybe use multiline string literals to make this more readable?
peering_cmd = """; echo "--------Peering VNETs--------"
; az network vnet wait --resource-group ${AKS_RESOURCE_GROUP} --name ${AKS_MGMT_VNET_NAME} --created --timeout 180
; export MGMT_VNET_ID=$(az network vnet show --resource-group ${AKS_RESOURCE_GROUP} --name ${AKS_MGMT_VNET_NAME} --query id --output tsv)
; echo " 1/8 ${AKS_MGMT_VNET_NAME} found "
"""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing multi-line string literal. I did not use it here because multi-line string literal made it harder for me to debug/print 😅.
Plus, this code block is a result of iterative development, hence each command is broken over multiple lines.
I can put it in multi-line string literal if needed. What do you say ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be easier to read if each group (each section starting with a comment) were one multiline string. So you'd still be doing string concatenation, but with longer, logically coherent strings without escape characters. But it's mostly a style thing, lgtm otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating it so :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried updating it to multi-line string literal and realized that
local_resource.cmd
needssh -ec
prefix else thelocal_resource()
considers the series of commands as a filename- multi-line literals is pushing me into syntax errors.
I will try one more time to update these commands to multi-line else will open up an optimization issue regarding this update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean to break things, I thought it would be straightforward to substitute multiline string literals here. But if it's too fiddly, let's first make sure the commands are working and then make this a future cleanup task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it working :)
cluster.cluster.x-k8s.io/apiserver-ilb-20737 created
azurecluster.infrastructure.cluster.x-k8s.io/apiserver-ilb-20737 created
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/apiserver-ilb-20737-control-plane created
azuremachinetemplate.infrastructure.cluster.x-k8s.io/apiserver-ilb-20737-control-plane created
machinedeployment.cluster.x-k8s.io/apiserver-ilb-20737-md-0 created
azuremachinetemplate.infrastructure.cluster.x-k8s.io/apiserver-ilb-20737-md-0 created
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/apiserver-ilb-20737-md-0 created
azureclusteridentity.infrastructure.cluster.x-k8s.io/cluster-identity-ci unchanged
Cluster apiserver-ilb-20737 created, don't forget to delete
Waiting for kubeconfig to be available
Kubeconfig for apiserver-ilb-20737 created and saved in the local
Waiting for apiserver-ilb-20737 API Server to be accessible
API Server of apiserver-ilb-20737 is accessible
--------Peering VNETs--------
1/8 aks-mgmt-vnet-21778 found
2/8 apiserver-ilb-20737-vnet found
3/8 mgmt-to-apiserver-ilb-20737 peering created in aks-mgmt-vnet-21778
4/8 apiserver-ilb-20737-to-mgmt peering created in apiserver-ilb-20737-vnet
5/8 apiserver-ilb-20737-cthekbl4yg.northeurope.cloudapp.azure.com private DNS zone created in apiserver-ilb-20737
6/8 workload cluster vnet apiserver-ilb-20737-vnet linked with private DNS zone
7/8 management cluster vnet aks-mgmt-vnet-21778 linked with private DNS zone
8/8 @ private DNS zone record created to point apiserver-ilb-20737-cthekbl4yg.northeurope.cloudapp.azure.com to 30.0.11.100
NAME: cloud-provider-azure-1735849146
LAST DEPLOYED: Thu Jan 2 12:19:08 2025
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NAME: calico
LAST DEPLOYED: Thu Jan 2 12:19:25 2025
NAMESPACE: tigera-operator
STATUS: deployed
REVISION: 1
TEST SUITE: None
cfecb11
to
92c8a72
Compare
/test pull-cluster-api-provider-azure-windows-with-ci-artifacts |
/test |
@nawazkh: The
The following commands are available to trigger optional jobs:
Use
In response to this:
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. |
/test pull-cluster-api-provider-azure-apiserver-ilb |
/test pull-cluster-api-provider-azure-apiversion-upgrade |
I am facing issues in my local to build and test local CAPZ images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lgtm, just had another minor question about the string output.
Tiltfile
Outdated
# TODO: check for az cli to be installed in local | ||
# wait for AKS VNet to be in the state created | ||
peering_cmd = ''' | ||
; echo \"--------Peering VNETs--------\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we trying to print the quotation marks? If so, this is correct, but I wasn't sure why they would be included. Quotes don't need to be escaped generally in multiline string literals, or included for echo
. I thought the output
echo --------Peering VNETs--------
was sufficient, but I may be confused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Encapsulating the string that needs to be echoed does not seem to be printing the quotes in the final output.
Example:
.
.
.
--------Peering VNETs--------
1/8 aks-mgmt-vnet-21778 found
2/8 apiserver-ilb-20737-vnet found
3/8 mgmt-to-apiserver-ilb-20737 peering created in aks-mgmt-vnet-21778
4/8 apiserver-ilb-20737-to-mgmt peering created in apiserver-ilb-20737-vnet
5/8 apiserver-ilb-20737-cthekbl4yg.northeurope.cloudapp.azure.com private DNS zone created in apiserver-ilb-20737
6/8 workload cluster vnet apiserver-ilb-20737-vnet linked with private DNS zone
7/8 management cluster vnet aks-mgmt-vnet-21778 linked with private DNS zone
8/8 @ private DNS zone record created to point apiserver-ilb-20737-cthekbl4yg.northeurope.cloudapp.azure.com to 30.0.11.100
.
.
.
So I think we can leave the "
in there
f3c595d
to
96bfced
Compare
/unhold |
- update aks-as-mgmt scripts with VNet creation and all clusters deletion - internal LB IP can be set using a env variable
96bfced
to
73cd188
Compare
/test pull-cluster-api-provider-azure-apiserver-ilb |
/test pull-cluster-api-provider-azure-apiversion-upgrade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: a6fee83bd86db191d5cfbea66b0189749fe8614b
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nawazkh 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com
to private IP (${AZURE_INTERNAL_LB_PRIVATE_IP}
)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:
TODOs:
Release note: