Skip to content

Conversation

@fabioy
Copy link
Contributor

@fabioy fabioy commented Apr 8, 2015

This is the first step to resolving issue #5946.

@satnam6502
Copy link
Contributor

I think Zach is in a better position to review this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Add a TODO to make this hit a versioned validate endpoint?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this return an api.Status? If not then DoRaw() might be better.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is DoRaw() different from Do().Raw()?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I discovered a bug where Do().Raw() does the wrong thing when the non-apiStatus JSON response includes a status field as is the case with Elasticsearch. I refactored it into two distinct phases which first processes the response without assuming it is an api.Status (this is done by DoRaw()) and then interpret it as an api.Status which is done by Do() which now calls DoRaw(). I think we should replace all occurrences of Do().Raw() with DoRaw() and remove the Raw() method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added TODO and changed to DoRaw().

@roberthbailey
Copy link
Contributor

Since this makes changes to the api and @zmerlynn is out this week, I'm going to bounce this over to @lavalamp for server-side review. @jlowdermilk might also want to take a look at the kubectl changes.

@roberthbailey roberthbailey assigned lavalamp and unassigned zmerlynn Apr 10, 2015
@fabioy fabioy force-pushed the kubectl-validate branch from f410b60 to 0b9e39c Compare April 10, 2015 16:56
@fabioy
Copy link
Contributor Author

fabioy commented Apr 10, 2015

Rebased and pushed the changes. PTAL. Thank you.

Copy link
Contributor

Choose a reason for hiding this comment

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

New objects should never appear in this list. You have a bug in your conversions if you need this.

@lavalamp
Copy link
Contributor

I have pointed out some problems. Reassigning to @bgrant0607 to approve an API change.

@lavalamp lavalamp assigned bgrant0607 and unassigned lavalamp Apr 10, 2015
Copy link
Member

Choose a reason for hiding this comment

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

We have cluster-info. How about cluster-validate? validate is just too generic, and we're likely to want to use that for validating user objects.

Copy link
Member

Choose a reason for hiding this comment

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

I take it back. If this is just component status, we should call it component-status.

If we versioned the APIs, it could be:

kubectl get cs

@bgrant0607
Copy link
Member

More context please? The PR description and cited issue say almost nothing.

@bgrant0607
Copy link
Member

This is going to be a breaking API change. Have you asked on kubernetes-dev whether anyone is using the current /validate API?

pkg/api/types.go Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the json tags here. This is the internal rep.

@fabioy fabioy force-pushed the kubectl-validate branch from 5aa6371 to 9275dd2 Compare April 15, 2015 19:24
@fabioy
Copy link
Contributor Author

fabioy commented Apr 16, 2015

@bgrant0607 Ping. Does the object model seem ok?

@bgrant0607
Copy link
Member

@fabioy Will take a look tonight. In the future, feel free to ping me by direct email. I'm drowning in Github notifications.

Copy link
Member

Choose a reason for hiding this comment

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

Eventually I want the apiserver to be a dumb, CRUDy server. Eventually, a controller would need to implement all the business logic and post status back.

We'll need a registration mechanism for components. Right now, we sort of have a fixed set of components on one node, but that's about to change Real Soon Now. Already we have "add ons" that run on the cluster but which are required, or will be (DNS), and full API plugins are planned. The components are all being converted to static pods as we speak. Others are working on HA, so components will be replicated. Full self-hosting of those components is the eventual goal.

What should this return if there are 5 etcd instances, 3 apiservers, 2 schedulers, and 2 controller managers?

Copy link
Member

Choose a reason for hiding this comment

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

I'm wishing we had the experimental API prefix discussed in #6363 and elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"What should this return if there are 5 etcd instances, 3 apiservers, 2 schedulers, and 2 controller managers?"

The call is to the current master api server, which tries it best to return the status of the currently active components. It seems irrelevant to list the "stand-by" components. When HA become available, this "extended" reporting could be done under an option flag.

@fabioy fabioy force-pushed the kubectl-validate branch from 9275dd2 to c6ef2dd Compare April 17, 2015 19:00
@fabioy
Copy link
Contributor Author

fabioy commented Apr 17, 2015

Addressed comments, sync'ed, rebased and pushed changes. PTAL. Thank you!

@brendandburns
Copy link
Contributor

LGTM.

This PR has gone on long enough. This looks good enough to merge as a first round (and its certainly an improvement over what was there previously)

To be honest, blocking this PR on making it into a real API seems kind of like Overkill to me, but I was out, and now its done so merge and move on...

brendandburns added a commit that referenced this pull request Apr 20, 2015
Add "kubectl validate" command to do a cluster health check.
@brendandburns brendandburns merged commit e079e23 into kubernetes:master Apr 20, 2015
@bgrant0607
Copy link
Member

AFAICT, this PR had unresolved feedback. Maybe changes weren't pushed?

@bgrant0607
Copy link
Member

It also demonstrates another bug was introduced into verify-description.sh, since this should be failing it:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/v1beta1/types.go#L1606

Copy link
Member

Choose a reason for hiding this comment

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

This file shouldn't have description tags. Description tags need to be on all non-inline fields in the versioned types.go files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting, I have the standard presubmit hooks. Filed issue #7080 for the "verify-description.sh" error. I'll prepare a separate PR and address these.

@fabioy
Copy link
Contributor Author

fabioy commented Apr 20, 2015

I've created a separate PR to resolve these issues. PR #7082. Thank you.

@fabioy fabioy deleted the kubectl-validate branch April 24, 2015 16:55
@YitongFeng
Copy link

Is this feature still work? how to use kubectl validate? In k8s 1.9.9, kubectl validate command not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.