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

Ensure pod and manifest have a UUID in apiserver #345

Merged
merged 2 commits into from
Jul 11, 2014

Conversation

smarterclayton
Copy link
Contributor

Also has replication controller allow apiserver to automatically assign a UUID

Continues #253 and #199

@@ -96,7 +100,7 @@ func (storage *ControllerRegistryStorage) Update(obj interface{}) (<-chan interf
if !ok {
return nil, fmt.Errorf("not a replication controller: %#v", obj)
}
if controller.ID == "" {
if len(controller.ID) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

I don't care which way it is, but only change this if you think it's clearer; don't do it as an optimization... http://stackoverflow.com/questions/18594330/the-best-way-to-test-for-an-empty-string-in-go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was just cleaning the file as I went. I saw len() and it seemed more broadly used.

@lavalamp
Copy link
Member

lavalamp commented Jul 2, 2014

Aside from a few comments, this LGTM. Thanks for this change, it should go a long ways towards making our IDs sensible!

@brendandburns
Copy link
Contributor

Thanks for the PR! LGTM, modulo Daniel's comments.

@monnand
Copy link
Contributor

monnand commented Jul 3, 2014

I have a small request: Would you please run the race detector first? Or could we wait for #348 getting merged?

I'm sorry, after fixing data races for two days, I think it might be better to make sure the code could pass the race detector before merging it.

@smarterclayton
Copy link
Contributor Author

@monnand no additional data races reported (other than the existing one in TestWatchControllers)

@thockin
Copy link
Member

thockin commented Jul 3, 2014

I'm unclear on what exactly JSONBase.ID is supposed to represent. Is it a globally unique ID for each api-managed object? Is it a transaction ID? Something in-between?

I'm also finding it hard to think about this change because I am still mulling the other discussion about the different forms of name and ID. It feels weird that ID is in JSONBase for some objects and not others.

I'm not blocking this change at this point, but I feel like I don't quite get it yet. Something somewhere has not clicked for me :)

@brendandburns
Copy link
Contributor

I intended ID to be a unique GUID that identifies a particular type of resource in the system.

So all Pods should have unique ID, all replication controllers should have unique ID (though a replication controller and a pod might have the same id, since they're in different namespaces)

as far as I intended, it is not a transaction ID, except in the case of an ServerOp, and even their it is a GUID, its just a GUID for an object that represents a transaction.

I think its different than the name of a container inside a pod, for example, since that is a semantic construct used for identifying (and possibly for DNS allocation, etc), but will never be used by the API itself to reference to anything.

For a while, I actually had ID (GUID) and Name (semantic identifier) but that actually got too confusing, so I ripped out Name...

@thockin
Copy link
Member

thockin commented Jul 5, 2014

Should we use JSONBase.ID instead of structure-specific IDs with
structure-specific semantics (e.g. "this ID survives pod moves and
restarts" vs "this ID is changed on every reschedule") ?

Or put another way, the ContainerManifest does not include JSONBase.
Should it?

On Thu, Jul 3, 2014 at 2:25 PM, brendandburns notifications@github.com
wrote:

I intended ID to be a unique GUID that identifies a particular type of
resource in the system.

So all Pods should have unique ID, all replication controllers should have
unique ID (though a replication controller and a pod might have the same
id, since they're in different namespaces)

as far as I intended, it is not a transaction ID, except in the case of an
ServerOp, and even their it is a GUID, its just a GUID for an object that
represents a transaction.

I think its different than the name of a container inside a pod, for
example, since that is a semantic construct used for identifying (and
possibly for DNS allocation, etc), but will never be used by the API itself
to reference to anything.

For a while, I actually had ID (GUID) and Name (semantic identifier) but
that actually got too confusing, so I ripped out Name...

Reply to this email directly or view it on GitHub
#345 (comment)
.

@smarterclayton
Copy link
Contributor Author

This implies to me that ContainerManifest should not have an ID - it was a temporary issue that the presence of a pod uuid resolves, so I marked it as deprecated in the latest commit. Now, if ContainerManifest becomes an API resource as commented in another issue, I think we would want to make it a JSON base.

@thockin
Copy link
Member

thockin commented Jul 7, 2014

Yeah, we have some confusion between what is a pod and what is a manifest.
From Kubelet's point of view a manifest IS a pod, and it is a resource.
From apiserver's point of view it's just a piece of a larger resource.

Brendan and I were discussing separating the objects based on point-of-view
(API Server vs Kubelet) but I have not done so yet. If
ContainerManifest.ID is deprecated, what do I use to identify a pod on a
kubelet?

Got time to do a hangout this week maybe?

On Sat, Jul 5, 2014 at 10:35 AM, Clayton Coleman notifications@github.com
wrote:

This implies
#345 (comment)
to me that ContainerManifest should not have an ID - it was a temporary
issue that the presence of a pod uuid resolves, so I marked it as
deprecated in the latest commit. Now, if ContainerManifest becomes an API
resource as commented in another issue, I think we would want to make it a
JSON base.

Reply to this email directly or view it on GitHub
#345 (comment)
.

@smarterclayton
Copy link
Contributor Author

Sure - I had started to take a stab at what it would take to abstract the kubelet from a direct etcd dependency in #356 and noted the same thing. Would be good to go over the options in a hangout.

@thockin
Copy link
Member

thockin commented Jul 7, 2014

You're east-coast time, right?

Tuesday afternoon (your time, after 11:00a California time) is open for
me...

For anyone else, this is not a private meeting, but we would like to focus
on progress as much as possible :)

On Sun, Jul 6, 2014 at 8:53 PM, Clayton Coleman notifications@github.com
wrote:

Sure - I had started to take a stab at what it would take to abstract the
kubelet from a direct etcd dependency in #356
#356 and noted
the same thing. Would be good to go over the options in a hangout.

Reply to this email directly or view it on GitHub
#345 (comment)
.

@verdverm
Copy link

verdverm commented Jul 7, 2014

I'd be down to join a hangout, though I'm not sure how much I have to contribute at this point

@smarterclayton
Copy link
Contributor Author

Let's try 2pm EDT on Tuesday

@thockin
Copy link
Member

thockin commented Jul 7, 2014

I will post a hangout link on this thread.

Proposed topics:

API structure split: master vs slave
API versioning
IDs and Names

On Mon, Jul 7, 2014 at 6:29 AM, Clayton Coleman notifications@github.com
wrote:

Let's try 2pm EDT on Tuesday

Reply to this email directly or view it on GitHub
#345 (comment)
.

@thockin
Copy link
Member

thockin commented Jul 8, 2014

https://plus.google.com/hangouts/_/grkrl7elarpergdg6ksepxjclea

I hope this works - never set up a public hangout before.

On Mon, Jul 7, 2014 at 11:35 AM, Tim Hockin thockin@google.com wrote:

I will post a hangout link on this thread.

Proposed topics:

API structure split: master vs slave
API versioning
IDs and Names

On Mon, Jul 7, 2014 at 6:29 AM, Clayton Coleman notifications@github.com
wrote:

Let's try 2pm EDT on Tuesday

Reply to this email directly or view it on GitHub
#345 (comment)
.

@verdverm
Copy link

verdverm commented Jul 8, 2014

Link says the party is over

@thockin
Copy link
Member

thockin commented Jul 8, 2014

try

https://plus.google.com/hangouts/_/g6eqprge2izsz3xmvubuajky2ua

On Tue, Jul 8, 2014 at 11:01 AM, Tony Worm notifications@github.com wrote:

Link says the party is over

Reply to this email directly or view it on GitHub
#345 (comment)
.

@thockin
Copy link
Member

thockin commented Jul 8, 2014

Notes from this discussion:

  • API structure split: master vs slave

We all agreed in general that we should differentiate top-level API
structures between the API server and the Kubelet. Common structures like
ContainerManifest will stay common and shared, but (for example) there
probably needs to be a different "Pod" structure for master and slave.

Google will find someone to work on this issue.

  • API versioning

We all agreed in general that we need to start versioning the APIs and
having an explicit point in the processing logic where we convert from
versioned external structures to internal structures. We will try to avoid
explicitly versioning internal structures for simplicity, but nobody was
deeply against it, if need be. If we find ourselves with truly
incompatible behavior, we will need to introduce them carefully with
explicit notes of API breakage.

Nobody volunteered to work on this, so Google will find someone if possible

  • IDs and names

We agreed on the following:

  • "Pod ID" that exists for the lifetime of the pod in k8s
  • "Pod Instance ID" that exists for the lifetime of a pod on a host
  • "Container attempt ID" that is assigned to each run of a container
    (docker's ID)

We did not discuss, but previously agreed on:

  • "Pod namespace" that represents the origin of the pod
  • "Pod name"
  • "Container name"

We agreed to not have the following:

  • A generation number that changes on stop/start cycles.

I'll write this up more fully in PR #349. Clayton is working on this.

Thanks everyone. way faster than email.

Tim

On Mon, Jul 7, 2014 at 11:35 AM, Tim Hockin thockin@google.com wrote:

I will post a hangout link on this thread.

Proposed topics:

API structure split: master vs slave
API versioning
IDs and Names

On Mon, Jul 7, 2014 at 6:29 AM, Clayton Coleman notifications@github.com
wrote:

Let's try 2pm EDT on Tuesday

Reply to this email directly or view it on GitHub
#345 (comment)
.

@smarterclayton
Copy link
Contributor Author

For the purposes of this pull, I think the change here fits within the agreed direction and is merely an incremental step towards it (accordingly I marked ContainerManifest.ID as deprecated). Disagreement? If no could use a final rereview and merge.

@thockin
Copy link
Member

thockin commented Jul 10, 2014

LGTM - resolve conflicts or whatever is causing "We can’t automatically merge this pull request"

* Fixes implication #2 in docs/identifiers.md
* Replication controller lets the apiserver set the pod ID
@smarterclayton
Copy link
Contributor Author

@thockin ptal

thockin added a commit that referenced this pull request Jul 11, 2014
Ensure pod and manifest have a UUID in apiserver
@thockin thockin merged commit f532038 into kubernetes:master Jul 11, 2014
@smarterclayton smarterclayton deleted the fix_ids branch February 11, 2015 02:21
vishh pushed a commit to vishh/kubernetes that referenced this pull request Apr 6, 2016
Added HTTP Auth and HTTP Digest authentication kubernetes#302
seans3 pushed a commit to seans3/kubernetes that referenced this pull request Apr 10, 2019
Format Node Component, Scheduling, and API Machinery sections.
smarterclayton pushed a commit to smarterclayton/kubernetes that referenced this pull request Sep 21, 2020
…r-scheduler-plugin

bug 1874920: Revert "bug 1874919: UPSTREAM: 94423: debugger scheduler plugin"
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.

6 participants