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

Send events on certain service repair controller errors #54304

Merged
merged 1 commit into from
Dec 15, 2017
Merged

Send events on certain service repair controller errors #54304

merged 1 commit into from
Dec 15, 2017

Conversation

frodenas
Copy link
Contributor

What this PR does / why we need it:

This PR enables sending events when the api-server service IP and port allocator repair controllers find an error repairing a cluster ip or a port respectively.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #54303

Special notes for your reviewer:

In case of an error, events will be emitted every 3 minutes for each failed Service. Even so, event spam protection has been merged (#47367) to mitigate the risk of excessive events.

Release note:

api-server provides specific events when unable to repair a service cluster ip or node port

@k8s-ci-robot k8s-ci-robot added 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 20, 2017
@dims
Copy link
Member

dims commented Oct 21, 2017

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 21, 2017
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2017
for i := range list.Items {
svc := &list.Items[i]
ports := service.CollectServiceNodePorts(svc)
for _, svc := range list.Items {
Copy link
Member

Choose a reason for hiding this comment

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

Please revert - this was done on purpose to avoid unnecessary copies for performance reasons.

@@ -136,6 +145,7 @@ func (c *Repair) runOnce() error {
ip := net.ParseIP(svc.Spec.ClusterIP)
if ip == nil {
// cluster IP is corrupt
c.recorder.Eventf(&svc, v1.EventTypeWarning, "ClusterIPNotValid", "Cluster IP %s is not a valid IP; please recreate service", svc.Spec.ClusterIP)
Copy link
Member

Choose a reason for hiding this comment

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

@gmarek - in the context of new event API, what is now the policy of adding new events?
I think those are added in this PR are generally useful, but I'm not sure if we should add them in the old API or maybe wait for the new one?

Copy link
Contributor

Choose a reason for hiding this comment

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

We add them with the old API, as new one doesn't have proper client library implemented yet.

@wojtek-t wojtek-t assigned gmarek and wojtek-t and unassigned hongchaodeng and wojtek-t Nov 20, 2017
@frodenas
Copy link
Contributor Author

@wojtek-t Rebased and fixed your comment. Waiting for @gmarek answer.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2017
@gmarek
Copy link
Contributor

gmarek commented Nov 24, 2017

Please squash commits. LGTM.

Signed-off-by: Ferran Rodenas <rodenasf@vmware.com>
@wojtek-t
Copy link
Member

/lgtm
/approve no-issue

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 24, 2017
@wojtek-t
Copy link
Member

/retest

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frodenas, wojtek-t

Associated issue: 54303

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 24, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 56308, 54304, 56364, 56388, 55853). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit dd4f84f into kubernetes:master Dec 15, 2017
@frodenas frodenas deleted the repair-events branch December 15, 2017 15:33
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. 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
None yet
Development

Successfully merging this pull request may close these issues.

Service IP and Port allocator repair controllers do not send events on errors
7 participants