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

optional flatcar tests will create a loadbalancer #3386

Merged
merged 1 commit into from
May 18, 2023

Conversation

nawazkh
Copy link
Member

@nawazkh nawazkh commented Apr 3, 2023

What type of PR is this?
/kind bug
/kind flake

What this PR does / why we need it:

  • Flatcar's optional tests should be failing if the cloud-controller-manager-x-x pod fails or errors out due to a panic.

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

Special notes for your reviewer:
This PR:

  • Will add caCertDir while installing cloud provider manager on a workload cluster.
    • Updates Tiltfile and
    • Updates E2E tests
  • Updates external-cloud-provider documentation
  • Updates Azure Flatcar tests to check the workload cluster after it has been brought up.

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

flatcar: Specify `caCertDir` location while installing “external” cloud provider for Azure

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 3, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 3, 2023
@nawazkh
Copy link
Member Author

nawazkh commented Apr 3, 2023

/test ls

@k8s-ci-robot
Copy link
Contributor

@nawazkh: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-azure-build
  • /test pull-cluster-api-provider-azure-ci-entrypoint
  • /test pull-cluster-api-provider-azure-e2e
  • /test pull-cluster-api-provider-azure-e2e-aks
  • /test pull-cluster-api-provider-azure-test
  • /test pull-cluster-api-provider-azure-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-azure-apidiff
  • /test pull-cluster-api-provider-azure-apiversion-upgrade
  • /test pull-cluster-api-provider-azure-capi-e2e
  • /test pull-cluster-api-provider-azure-conformance
  • /test pull-cluster-api-provider-azure-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-e2e-optional
  • /test pull-cluster-api-provider-azure-e2e-workload-upgrade
  • /test pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts-serial-slow

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-azure-apidiff
  • pull-cluster-api-provider-azure-build
  • pull-cluster-api-provider-azure-ci-entrypoint
  • pull-cluster-api-provider-azure-conformance
  • pull-cluster-api-provider-azure-conformance-with-ci-artifacts
  • pull-cluster-api-provider-azure-e2e
  • pull-cluster-api-provider-azure-e2e-aks
  • pull-cluster-api-provider-azure-test
  • pull-cluster-api-provider-azure-verify
  • pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts

In response to this:

/test ls

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.

@nawazkh

This comment was marked as outdated.

@nawazkh nawazkh force-pushed the add_lb_to_flatcar_tests branch from a2435bd to 954678d Compare April 3, 2023 23:05
@nawazkh
Copy link
Member Author

nawazkh commented Apr 3, 2023

/test pull-cluster-api-provider-azure-e2e-optional

@nawazkh
Copy link
Member Author

nawazkh commented Apr 4, 2023

Hmm, as expected. cloud-controller-manager-74f84b7fb5-4589r restarted 4 times.

Restart Count:  4
 [PANICKED] in [AfterEach] - /usr/local/go/src/runtime/panic.go:260 @ 04/03/23 23:39:03.297
  << Timeline
   [FAILED] Timed out after 180.001s.
  Failed to get capz-e2e-wk6i3c/capz-e2e-e

@invidian
Copy link
Member

invidian commented Apr 4, 2023

I've created #3387 to track the investigation, as we will need both test and a fix for this.

I can reproduce it on my cluster, so I'm investigating, will share findings in the issue.

@@ -294,10 +294,9 @@ var _ = Describe("Workload cluster creation", func() {
})
})

Context("Creating a Flatcar cluster [OPTIONAL]", func() {
Context("Creating a Flatcar cluster [OPTIONAL]", Ordered, func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks great to me! Just for my own understanding, what does the Ordered argument mean in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ordered containers will always run in the order they have been defined.
So in our scenario, all the It() will always run in the order they have been defined and not messed up by Ginkgo's parallelization approach.
Also note that I converted By() -> It().
By() acts mostly as a logger. By converting By() -> It() I can ask ginkgo to show that Log line as a test case.

More reference on ordered containers : https://onsi.github.io/ginkgo/#ordered-containers

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @willie-yao , Wanted to share something I learned the hard way.
Splitting the tests, as I did in here albeit preserving the order of the tests, does not help the testing. Unless the The tests warrants splitting the It spec into multiple Its, its better to stick with the existing code flow of using By inside It.
The problem with splitting Its in my case is that, AfterEach() gets triggered after each It and it cleans up all the setup the tests does in the first It.

TL;DR: Use By in our tests over splitting it into It since AfterEach() cleans up setup and other artifacts after each It.

@nawazkh nawazkh force-pushed the add_lb_to_flatcar_tests branch from 46ea255 to f8ad961 Compare April 4, 2023 21:49
@nawazkh
Copy link
Member Author

nawazkh commented Apr 4, 2023

/test pull-cluster-api-provider-azure-e2e-optional

@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (c125458) 51.64% compared to head (1372819) 51.63%.

❗ Current head 1372819 differs from pull request most recent head efacbb0. Consider uploading reports for the commit efacbb0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3386      +/-   ##
==========================================
- Coverage   51.64%   51.63%   -0.02%     
==========================================
  Files         182      182              
  Lines       18066    18066              
==========================================
- Hits         9331     9329       -2     
- Misses       8208     8210       +2     
  Partials      527      527              

see 1 file with indirect coverage changes

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

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nawazkh nawazkh force-pushed the add_lb_to_flatcar_tests branch from 1372819 to efacbb0 Compare April 5, 2023 23:03
@nawazkh
Copy link
Member Author

nawazkh commented Apr 5, 2023

/test pull-cluster-api-provider-azure-e2e-optional

@jackfrancis jackfrancis added this to the v1.9 milestone Apr 6, 2023
@nawazkh nawazkh force-pushed the add_lb_to_flatcar_tests branch from efacbb0 to dcd9881 Compare April 6, 2023 19:18
@nawazkh
Copy link
Member Author

nawazkh commented Apr 6, 2023

/test pull-cluster-api-provider-azure-e2e-optional

@nawazkh nawazkh force-pushed the add_lb_to_flatcar_tests branch from dcd9881 to bef278b Compare April 12, 2023 22:02
@invidian
Copy link
Member

Any clues why Flatcar tests are still failing? If not, I'll continue investigating.

@nawazkh

This comment was marked as resolved.

@nawazkh
Copy link
Member Author

nawazkh commented Apr 13, 2023

/test pull-cluster-api-provider-azure-e2e-optional

@nawazkh
Copy link
Member Author

nawazkh commented Apr 14, 2023

Any clues why Flatcar tests are still failing? If not, I'll continue investigating.

From the artifacts folder, looks like the workload cluster isn't even coming up.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 12, 2023
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. labels May 12, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 67c766eb3f72afcec7662addf060332e5734218b

1 similar comment
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 67c766eb3f72afcec7662addf060332e5734218b

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 12, 2023
@nawazkh nawazkh force-pushed the add_lb_to_flatcar_tests branch from 7af32d1 to f685b8f Compare May 13, 2023 03:00
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 13, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 13, 2023
- Set cloudControllerManager.caCertDir to `/usr/share/ca-certificates`
- and check if loadbalancer can spin up successfully
- add caCertDir to CCM in tiltfile
- add Note about caCertDir to CCM in azure external docs
@nawazkh nawazkh force-pushed the add_lb_to_flatcar_tests branch from f685b8f to 1ed2a41 Compare May 16, 2023 16:12
@nawazkh
Copy link
Member Author

nawazkh commented May 18, 2023

Rebased and resolved the Tiltfile conflict. Please take a look. @CecileRobertMichon @willie-yao

@nawazkh
Copy link
Member Author

nawazkh commented May 18, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 18, 2023
@willie-yao
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 18, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 450a92ac51af589000ff0e5f451de0111062e774

@willie-yao
Copy link
Contributor

/test pull-cluster-api-provider-azure-e2e-optional

@k8s-ci-robot k8s-ci-robot merged commit 4082e44 into kubernetes-sigs:main May 18, 2023
@nawazkh
Copy link
Member Author

nawazkh commented May 19, 2023

/cherry-pick release-1.9
/cherry-pick release-1.8

@k8s-infra-cherrypick-robot

@nawazkh: #3386 failed to apply on top of branch "release-1.9":

Applying: optional flatcar tests will create a loadbalancer
.git/rebase-apply/patch:30: trailing whitespace.
- **Note**: 
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	Tiltfile
M	test/e2e/azure_test.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/azure_test.go
Auto-merging Tiltfile
CONFLICT (content): Merge conflict in Tiltfile
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 optional flatcar tests will create a loadbalancer
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.9
/cherry-pick release-1.8

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.

Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

Sorry for late review. LGTM. Thanks again for the efforts @nawazkh!

@@ -394,6 +394,8 @@ def get_addons(flavor_name):

if "intree-cloud-provider" not in flavor_name:
addon_cmd += "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME}"
if "flatcar" in flavor_name: # append caCetDir location to the cloud-provider-azure helm install command for flatcar flavor
Copy link
Member

Choose a reason for hiding this comment

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

typo: caCetDir -> caCertDir

@nawazkh nawazkh deleted the add_lb_to_flatcar_tests branch August 31, 2023 20:47
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/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

CCM is in CrashLoopBackOff on Flatcar flavor
9 participants