Skip to content

Kubelet in standalone doesn't work with example YAML files #3584

Closed
@filbranden

Description

@filbranden

I'm trying containervm with kubelet built from head and this YAML file:

https://cloud.google.com/compute/docs/containers/container_vms#create_the_manifest

The YAML file is v1beta2 and doesn't set a name to the Pod. When starting kubelet, it doesn't start the "nc" echo server and complains about this on the logs:

config.go:307] Pod[1] (<empty-name>.url-a75326da) from http failed validation, ignoring: name: required value ''

Chatting with @dchen1107 on IM she mentioned it might be due to a change from @thockin that now requires non-empty pod names (replaces random generation with validation for non-emptiness) but that means all existing YAML files (even the ones with an older version) will stop working... Is that expected?

Thanks!
Filipe

Activity

dchen1107

dchen1107 commented on Jan 16, 2015

@dchen1107
Member

Yes, the latest kubelet call validation on all sources: etcd, file, http, etc. now, and PodName is a required field. One potential fix for this is also invoke conversion code before call validation, like what we have done at apiserver.

Thoughts? @thockin

filbranden

filbranden commented on Jan 16, 2015

@filbranden
ContributorAuthor

Just so I get unblocked... Do you have an example YAML file that will set the pod name and will work?

Right now this is what I'm using:

version: v1beta2
containers:
  - name: simple-echo
    image: busybox
    command: ['nc', '-p', '8080', '-l', '-l', '-e', 'echo', 'hello world!']
    ports:
      - name: nc-echo
        hostPort: 8080
        containerPort: 8080

Should I bump up version to v1beta3 and include a new - pod: whatever field somewhere?

Thanks!
Filipe

erictune

erictune commented on Jan 17, 2015

@erictune
Member

The type of that yaml is not pod, and the kubelet code doesn't know how to read pods from a file.
So, I think @thockin change needs to be reverted before you can make the next ContainerVM release.

The v1beta2 vs v1beta3 should not have anything to do with it, unless I'm misunderstanding.

erictune

erictune commented on Jan 17, 2015

@erictune
Member

Or will it work to do this:

id: simple-echo
version: v1beta2
containers:
  - name: simple-echo
    image: busybox
    command: ['nc', '-p', '8080', '-l', '-l', '-e', 'echo', 'hello world!']
    ports:
      - name: nc-echo
        hostPort: 8080
        containerPort: 8080
erictune

erictune commented on Jan 17, 2015

@erictune
Member

Still, not sure if you want to release a containerVM version that doesn't accept the old format?

filbranden

filbranden commented on Jan 17, 2015

@filbranden
ContributorAuthor

Thanks @erictune I made it work with the YAML above!

I still have errors in the logs:

kubelet.go:897] Couldn't make a ref to pod echo-pod, container net: 'selfLink was empty, can't make reference'
kubelet.go:622] Couldn't make a ref to pod echo-pod, container net: 'selfLink was empty, can't make reference'

But the docker containers are being brought up...

It's weird that id is the YAML field that is missing, considering the source seems to say it's a deprecated field that will be removed at some point...

https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/types.go#L1085

I agree with your point that this needs to be fixed at head before the next containervm release.

I opened #3573 to increase test coverage of standalone kubelet since we have been seeing many changes break that model recently.

Cheers,
Filipe

erictune

erictune commented on Jan 17, 2015

@erictune
Member

id in v1beta2 maps to name in v1beta3

Tim's change made name required. The internal representation is like v1beta3. But v1beta3 is not officially stable so we don't want to use it in the GKE or containerVM docs.

self-assigned this
on Jan 22, 2015
dchen1107

dchen1107 commented on Jan 22, 2015

@dchen1107
Member

The issue is caused by #3242, and affect both v0.8 and v0.9 release for standalone kubelet to support old format ContainerManifests.

thockin

thockin commented on Jan 22, 2015

@thockin
Member

Ugh, I thought ID was really required. I spoke with Dawn a bit, and here's my thinking.

  1. update all our docs and examples to include ID
  2. in file and HTTP config sources, check for Name = "" and apply a default, maybe log a warning that this is deprecated
  3. wait for the ContainerManifest -> Pod conversion to really make it required
added
priority/critical-urgentHighest priority. Must be actively worked on as someone's top priority right now.
on Jan 22, 2015

13 remaining items

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

Metadata

Metadata

Assignees

Labels

area/kubeletkind/bugCategorizes issue or PR as related to a bug.priority/critical-urgentHighest priority. Must be actively worked on as someone's top priority right now.sig/nodeCategorizes an issue or PR as relevant to SIG Node.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Kubelet in standalone doesn't work with example YAML files · Issue #3584 · kubernetes/kubernetes