Skip to content

Maintain HeadlessService on upgrade #7865

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

Merged
merged 5 commits into from
Jun 11, 2025
Merged

Maintain HeadlessService on upgrade #7865

merged 5 commits into from
Jun 11, 2025

Conversation

vepatel
Copy link
Contributor

@vepatel vepatel commented Jun 5, 2025

Proposed changes

  • Updates createHeadlessService() to check if headless service from earlier installation exists, if yes then update the labels and ownerReferences (in case cm changes)

After upgrade:

1 main.go:1147] Headless service default/test-release-nginx-ingress-controller-replicaset-hl exists and needs update. Updating...
1 main.go:1084] Pod label updated: test-release-nginx-ingress-controller-6d887d4947-9hqzp
1 main.go:109] Event(v1.ObjectReference{Kind:"Pod", Namespace:"default", Name:"test-release-nginx-ingress-controller-6d887d4947-9hqzp", UID:"41b1f9e9-a38e-478e-a7db-91c0db341ce2", APIVersion:"v1", ResourceVersion:"1749129780125903017", FieldPath:""}): type: 'Normal' reason: 'UpdatePodLabel' Successfully added version labels, app.kubernetes.io/instance="test-release", app.kubernetes.io/name="nginx-ingress", pod-template-hash="6d887d4947", app.nginx.org/version="1.27.4-nginx-plus-r34-p1", app.kubernetes.io/version="hl-fix"
1 main.go:1152] Successfully updated headless service default/test-release-nginx-ingress-controller-replicaset-hl.

replicaset selectors:

Name:           test-release-nginx-ingress-controller-6d887d4947
Namespace:      default
Selector:       app.kubernetes.io/instance=test-release,app.kubernetes.io/name=nginx-ingress,pod-template-hash=6d887d4947

headless service selectors:

Name:                     test-release-nginx-ingress-controller-replicaset-hl
Namespace:                default
Labels:                   <none>
Annotations:              cloud.google.com/neg: {"ingress":true}
Selector:                 app.kubernetes.io/instance=test-release,app.kubernetes.io/name=nginx-ingress,pod-template-hash=6d887d4947

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@vepatel vepatel requested a review from a team as a code owner June 5, 2025 13:48
@github-actions github-actions bot added bug An issue reporting a potential bug go Pull requests that update Go code labels Jun 5, 2025
@vepatel vepatel linked an issue Jun 5, 2025 that may be closed by this pull request
AlexFenlon
AlexFenlon previously approved these changes Jun 9, 2025
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 89.18919% with 4 lines in your changes missing coverage. Please review.

Project coverage is 52.69%. Comparing base (f8d5420) to head (a702777).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/nginx-ingress/main.go 89.18% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7865      +/-   ##
==========================================
+ Coverage   52.51%   52.69%   +0.17%     
==========================================
  Files          90       90              
  Lines       21581    21598      +17     
==========================================
+ Hits        11334    11380      +46     
+ Misses       9776     9743      -33     
- Partials      471      475       +4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vepatel vepatel requested review from AlexFenlon and a team June 11, 2025 12:28
@vepatel vepatel merged commit 1fc1485 into main Jun 11, 2025
84 checks passed
@vepatel vepatel deleted the fix/zone-sync-hl branch June 11, 2025 14:13
@AlexFenlon AlexFenlon changed the title update createHeadlessService Maintain HeadlessService on upgrade Jun 23, 2025
@AlexFenlon AlexFenlon removed the go Pull requests that update Go code label Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue reporting a potential bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Upgrade from 5.0.0 to edge causes zone-sync to fail
3 participants