-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use port name instead of port number for the ingress #30925
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
Use port name instead of port number for the ingress #30925
Conversation
a49a25e to
b440169
Compare
|
@shawkins - I'm struggling with this change as after using the port name, the Operator can't update a custom Ingress which has only the port number specified. It then throws the error "cannot set both port name & port number". What is the recommended way to handle this with server-side-apply? IMHO the Ingress is missing an annotation in the Go code of Kubernetes to make this work, and I've opened an upstream issue for that: kubernetes/kubernetes#125869 Still this won't solve my problem short term. So I wonder:
Thanks! |
I've logged upstream issues related to this, but for services. SSA does not use the same rules as merge patches, so it's easier for it to get in a situation where the patch is invalid.
Let me check.
Ideally not, but in some cases we don't have a choice - such as changing a immutable field like statefulset match labels. If a regular merge patch will work, it would probably be just as easy to use an override to do that patch instead of deleting.
If the user creates the ingress and it lacks the owner reference for the operator, the operator will not manage it - if it has the same name as the managed ingress and the user has not turned off ingress handling in the keycloak cr, then we'll throw an exception when we try to create the managed version. |
I committed a possible workaround to repeat the update as a regular patch. |
67d95df to
c5f309a
Compare
|
@shawkins - thank you for your contribution. I've updated this PR to apply the client side work a bit more broader in a way that you suggested in your commit. I didn't want to catch all Please let me know your thoughts in a review, and also decide if someone else from the CND team should review it as well. Thanks! |
shawkins
left a comment
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 want to catch all KubernetesClientExceptions as that seems to be a bit broad to me.
I think this looks good, but it still might be better to look at the code for the KubernetesClientException, rather than the message - that should be more stable as that will come directly from the api server.
Pepo48
left a comment
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. Thank you both.
c5f309a to
376d171
Compare
|
@shawkins - thank you for pointing me at the "code". I didn't know about it and it is a lot cleaner. I've updated the commit. If the build is green, it should be ready for review. |
376d171 to
cfe3cc9
Compare
Also adding a retry if server-side-apply fails Closes keycloak#30924 Co-authored-by: Steven Hawkins <[email protected]> Signed-off-by: Alexander Schwartz <[email protected]>
cfe3cc9 to
a5dbf80
Compare
shawkins
left a comment
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.
Also adding a retry if server-side-apply fails Closes keycloak#30924 Signed-off-by: Alexander Schwartz <[email protected]> Co-authored-by: Steven Hawkins <[email protected]> Signed-off-by: Pavel Borisenko <[email protected]>
Also adding a retry if server-side-apply fails Closes keycloak#30924 Signed-off-by: Alexander Schwartz <[email protected]> Co-authored-by: Steven Hawkins <[email protected]>
Also adding a retry if server-side-apply fails Closes keycloak#30924 Signed-off-by: Alexander Schwartz <[email protected]> Co-authored-by: Steven Hawkins <[email protected]>
Closes #30924