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

Specifying ID twice is sort of tedious #294

Closed
thockin opened this issue Jun 30, 2014 · 9 comments
Closed

Specifying ID twice is sort of tedious #294

thockin opened this issue Jun 30, 2014 · 9 comments
Assignees
Labels
area/api Indicates an issue on api area. area/kubelet-api area/usability kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@thockin
Copy link
Member

thockin commented Jun 30, 2014

From examples:

{
"id": "redis-master-2",
"desiredState": {
"manifest": {
"id": "redis-master-2"

This stems from the fact that Kubelet takes ContainerManifest structs and needs them to have an ID, but none of the frontends massage the info from the Pod struct into the Manifest struct.

We should think hard about whether using the same structs for the user API and the Kubelet API makes sense. Or maybe we can restructure them to nest better, so the kubelet API looks more like:

{
id
manifest
}

@lavalamp
Copy link
Member

Also need to consider how replication controllers produce IDs for the pods they make, right now I think they just copy the possibly-blank ID field in their pod template.

@smarterclayton
Copy link
Contributor

If Pod ID is required, and a ContainerManifest ID is also required, should the pod controller duplicate the pod id into the container manifest id if the container manifest id is not specified? Then the replication controller should also generate a unique container manifest ID in the template on creation if one is not specified.

I will make that change in #253 if so

@thockin
Copy link
Member Author

thockin commented Jun 30, 2014

I think so. Re3plication controller should add a short random
prefix/suffix to each ID

On Mon, Jun 30, 2014 at 12:39 PM, Clayton Coleman notifications@github.com
wrote:

If Pod ID is required, and a ContainerManifest ID is also required, should
the pod controller duplicate the pod id into the container manifest id if
the container manifest id is not specified? Then the replication controller
should also generate a unique container manifest ID in the template on
creation if one is not specified.

I will make that change in #253
#253 if so

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

@smarterclayton
Copy link
Contributor

With #846 the need for a manifest ID on the primary source may go away, once we can isolate the Kubelet from the etcd schema. Probably still need a source of uniqueness on config from other sources, but it could be source specific instead of being inside the source.

@bgrant0607 bgrant0607 added the area/api Indicates an issue on api area. label Sep 30, 2014
@bgrant0607
Copy link
Member

Addressed by implementation of #1225?

@smarterclayton
Copy link
Contributor

EDIT: Yes, will add this to #1519

@bgrant0607 bgrant0607 added this to the v0.8 milestone Oct 4, 2014
@bgrant0607
Copy link
Member

@smarterclayton Should we expect that this has been addressed in v1beta1 by the BoundPod conversion functions in pkg/api/conversion.go? If I try to create a pod without the manifest version and id, it fails, since those fields are required. However, the conversion functions appear to trash the user-provided id value, and there's no choice for version. Example:

apiVersion: v1beta1
kind: Pod
id: www
desiredState:
  manifest:
    version: v1beta1
    id: www-manifest
    containers:
      - name: nginx
        image: dockerfile/nginx

result:

cluster/kubectl.sh get -o json pod www
{
    "metadata": {
        "name": "www",
        "namespace": "default",
        "selfLink": "/api/v1beta1/pods/www",
        "resourceVersion": "12",
        "creationTimestamp": "2014-11-04T06:03:29Z"
    },
    "desiredState": {
        "manifest": {
            "version": "v1beta1",
            "id": "www",
            "uuid": "4c6e7bf1-63e8-11e4-a40f-42010af03d18",
            "volumes": null,
            "containers": [
                {
                    "name": "nginx",
                    "image": "dockerfile/nginx",
                    "imagePullPolicy": ""
                }
            ],
            "restartPolicy": {
                "always": {}
            }
        },
        "status": "Waiting",
        "host": ""
    },

@smarterclayton
Copy link
Contributor

BoundPod gets half of it. Once we land the internal pod refactor the validator can stop validating version and id (they become optional and ignored). We will still need to support the backward compatible validator for old ContainerManifests on disk though.

----- Original Message -----

@smarterclayton Should we expect that this has been addressed in v1beta1 by
the BoundPod conversion functions in pkg/api/conversion.go? If I try to
create a pod without the manifest version and id, it fails, since those
fields are required. However, the conversion functions appear to trash the
user-provided id value, and there's no choice for version. Example:

apiVersion: v1beta1
kind: Pod
id: www
desiredState:
  manifest:
    version: v1beta1
    id: www-manifest
    containers:
      - name: nginx
        image: dockerfile/nginx

result:

cluster/kubectl.sh get -o json pod www
{
    "metadata": {
        "name": "www",
        "namespace": "default",
        "selfLink": "/api/v1beta1/pods/www",
        "resourceVersion": "12",
        "creationTimestamp": "2014-11-04T06:03:29Z"
    },
    "desiredState": {
        "manifest": {
            "version": "v1beta1",
            "id": "www",
            "uuid": "4c6e7bf1-63e8-11e4-a40f-42010af03d18",
            "volumes": null,
            "containers": [
                {
                    "name": "nginx",
                    "image": "dockerfile/nginx",
                    "imagePullPolicy": ""
                }
            ],
            "restartPolicy": {
                "always": {}
            }
        },
        "status": "Waiting",
        "host": ""
    },

Reply to this email directly or view it on GitHub:
#294 (comment)

@bgrant0607 bgrant0607 added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Dec 3, 2014
@bgrant0607
Copy link
Member

I'm going to close this. IMO, we should focus on v1beta3.

vishh pushed a commit to vishh/kubernetes that referenced this issue Apr 6, 2016
wking pushed a commit to wking/kubernetes that referenced this issue Jul 21, 2020
marun pushed a commit to marun/kubernetes that referenced this issue Aug 5, 2020
Add custom resource validation for network spec
linxiulei pushed a commit to linxiulei/kubernetes that referenced this issue Jan 18, 2024
Allow compilation time disabling for each type of Problem Daemon.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue on api area. area/kubelet-api area/usability kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

4 participants