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

21.11.X: k8s: fix bug reconciling clusters with fixed nodeport #3281

Merged
merged 3 commits into from
Dec 16, 2021

Conversation

alenkacz
Copy link
Contributor

Cover letter

The nodeport service when nodePort field provided behaves a bit differently and repeated create on the same resource does not return createifnotexists error but rather an allocation error. so because of that, after the external service gets created after first run of the reconciliation loop, it keeps failing with the nodeport allocated error. The fix is to switch to get-or-create method that creates only if GET call did not succeed.

➜  temp kubectl apply -f nodeport.yaml
service/my-service created
➜  temp kubectl apply -f nodeport.yaml
service/my-service unchanged
➜  temp kubectl create -f nodeport.yaml
The Service "my-service" is invalid: spec.ports[0].nodePort: Invalid value: 30007: provided port is already allocated

Fixes #3263

Release notes

Improvements

k8s: fixed bug with nodeport handling for clusters that have external connectivity with fixed port

@alenkacz alenkacz requested a review from a team as a code owner December 16, 2021 08:13
Copy link
Contributor

@RafalKorepta RafalKorepta left a comment

Choose a reason for hiding this comment

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

LGTM

@alenkacz alenkacz merged commit 50722a1 into redpanda-data:v21.11.x Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants