Commit Graph

157 Commits (2803fbe3434b24a623a7714b0c34b2a81eefe096)

Author SHA1 Message Date
Justin Santa Barbara dee8d4b90b For kubelet, differentiate between the nodeName and the hostname
This will allow us to use a nodeName that is not the hostname,
for example on clouds where the hostname is not the natural identifier
for a node.
2015-06-18 12:40:01 -07:00
Satnam Singh e4f5529a2d Revert "Allow nodename to be != hostname, use AWS instance ID on AWS" 2015-06-18 11:27:55 -07:00
Justin Santa Barbara c28cdfbd43 For kubelet, differentiate between the nodeName and the hostname
This will allow us to use a nodeName that is not the hostname,
for example on clouds where the hostname is not the natural identifier
for a node.
2015-06-17 00:40:43 -04:00
Chao Xu b093af57ba cleanse common_test.go of v1beta1 2015-06-16 17:22:35 -07:00
Chao Xu ca72165b20 remove most references to api.PreV1Beta3 2015-06-03 20:09:03 -07:00
Chao Xu 97b29c7fe6 in pkg/kubelet/config/commont_test.go, remove check for v1beta1, add test cases for all registered version 2015-06-03 16:07:00 -07:00
Chao Xu d52cef11a4 add v1 tests to hack/test-go; let default value of Container.SecurityContext to be nil 2015-06-03 09:50:41 -07:00
Filip Grzadkowski 98115facfd Revert "Gracefully delete pods from the Kubelet" 2015-06-02 23:40:05 +02:00
Clayton Coleman 72ee028cab Gracefully delete pods from the Kubelet
This commit wires together the graceful delete option for pods
on the Kubelet.  When a pod is deleted on the API server, a
grace period is calculated that is based on the
Pod.Spec.TerminationGracePeriodInSeconds, the user's provided grace
period, or a default.  The grace period can only shrink once set.
The value provided by the user (or the default) is set onto metadata
as DeletionGracePeriod.

When the Kubelet sees a pod with DeletionTimestamp set, it uses the
value of ObjectMeta.GracePeriodSeconds as the grace period
sent to Docker.  When updating status, if the pod has DeletionTimestamp
set and all containers are terminated, the Kubelet will update the
status one last time and then invoke Delete(pod, grace: 0) to
clean up the pod immediately.
2015-06-01 19:23:59 -04:00
Kris f4e2c738f6 Delete deprecated API versions
pkg/service:

There were a couple of references here just as a reminder to change the
behavior of findPort. As of v1beta3, TargetPort was always defaulted, so
we could remove findDefaultPort and related tests.

pkg/apiserver:

The tests were using versioned API codecs for some of their encoding
tests. Necessary API types had to be written and registered with the
fake versioned codecs.

pkg/kubectl:

Some tests were converted to current versions where it made sense.
2015-05-29 17:17:35 -07:00
Chao Xu 9c1153322e update PodSpec.Host to PodSpec.NodeName in /pkg/api/types.go and /pkg/api/v1beta3/types.go 2015-05-28 14:10:06 -07:00
Yu-Ju Hong 3f791db886 Kubelet: remove unused getHostFieldLabel function 2015-05-11 14:39:22 -07:00
Yu-Ju Hong ab5e0e0b5c Use the full hostname for mirror pod name.
This change appends the full hostname to the mirror pod name (instead of taking
the first token) so that if the hostname is overriden, we'd not be creating
unncessary name conflicts. An example would be that a user overrides the
hostnames to be "127.0.0.1" and "127.0.0.2", and both of them were resolved to
"127" for the mirror pod name suffix.

Also, because `uname -n` could return a FQDN or not, this change takes only
the first token of it as the hostname for consistency.
2015-05-07 12:59:49 -07:00
Zach Loafman 875e83a741 Revert "Revert "Security context - types, kubelet, admission"" 2015-05-05 16:02:13 -07:00
Zach Loafman f48904fd5e Revert "Security context - types, kubelet, admission" 2015-05-05 15:20:39 -07:00
Paul Weil 982bf19c20 security context initial implementation - squash 2015-05-05 13:46:13 -04:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Brendan Burns 48d269e6ab Fix YAML parsing for v1beta3 objects in the kubelet for file/http 2015-04-29 11:38:36 -07:00
nikhiljindal dcc368c781 Removing more references to v1beta1 from pkg/ 2015-04-24 00:45:17 -07:00
Kris Rousey 81497f3ed2 Changing the scheduler package to use *api.Pod instead of api.Pod to
avoid unnecessary shallow copies. The change rippled through a lot of
code.
2015-04-17 13:34:31 -07:00
Yu-Ju Hong d7cf294c99 Kubelet: recreate mirror pod if the static pod changes
If a static pod changes, delete the corresponding mirror pod. When kubelet
could not see mirror pod from the API server update, it'd attemp to create a
new mirror pod with up-to-date specs.
2015-04-08 18:06:21 -07:00
Wojciech Tyczynski 8a5c76356c Revert "Stop the bleeding for #6059"
This reverts commit 6be09c5e97.
2015-04-08 13:29:29 +02:00
Daniel Smith c1390a0836 version field selector field names in the client 2015-04-07 16:59:57 -07:00
Daniel Smith 6be09c5e97 Stop the bleeding for #6059 2015-04-02 13:54:10 -07:00
saadali e0f71cb21f Make each new instance of kubelet generate a new event channel (instead of reusing existing). 2015-03-30 14:22:16 -07:00
Yu-Ju Hong 793a3c0c63 Use the first token of hostname for generating static pod names
This increases the readability of pods by avoiding long names.

This fixes #5936
2015-03-26 16:12:49 -07:00
Yu-Ju Hong 4e909c6cee Kubelet: no need to overwrite SelfLink for pods from the apiserver
Pods from the apiserver should already have SelfLink set. There is no need to
create one ourselves.
2015-03-25 16:34:02 -07:00
Yifan Gu 31bb11ac2a kubelet: Move pod name helpers to pkg/kubelet/container/runtime.go 2015-03-24 16:08:04 -07:00
Clayton Coleman d020ca00b8 Pass hostname to all kubelet config sources instead of os.Hostname()
Make applyDefaults be tied to the current config source.
2015-03-23 15:58:45 -04:00
Clayton Coleman b442f76961 Syntax errors in file_test were added right as validation became more strict 2015-03-23 14:43:09 -04:00
Victor Marmol 4e3c07543e Merge pull request #5784 from wojtek-t/applyDefaultsInTryDecode
Hide applyDefaults method under pkg/kubelet/config
2015-03-23 07:32:00 -07:00
Wojciech Tyczynski b395c40e19 Refactor pkg/kubelet/config 2015-03-23 10:29:46 +01:00
Clayton Coleman 65425f690c Move field errors to pkg/util/fielderrors
Allows pkg/api to take a reference to labels.Selector and fields.Selector
2015-03-22 17:43:34 -04:00
Wojciech Tyczynski 9c4ef28b2d Comments 2015-03-20 20:13:16 +01:00
Wojciech Tyczynski 3b367f8ab8 Refactor file_test.go 2015-03-20 20:13:16 +01:00
Wojciech Tyczynski 7a7e64331c Kubelet file read both ContainerManifest and Pod 2015-03-20 12:09:09 +01:00
Wojciech Tyczynski c5d8c391fb Refactor kubelet/config to share code 2015-03-20 09:40:52 +01:00
Victor Marmol 6f6485909e Merge pull request #5598 from wojtek-t/kubelet_http_read_pod
Kubelet read pods from http
2015-03-19 11:49:28 -07:00
Wojciech Tyczynski c512c549a1 Kubelet http read both ContainerManifest and Pod 2015-03-19 18:57:00 +01:00
Filip Grzadkowski f89f91b7bd Validate that there is at least one container in the pod 2015-03-19 12:31:53 +01:00
Yu-Ju Hong 05c61d2e47 Merge pull request #5622 from vmarmol/http
Add SelfLink to Kubelet http source.
2015-03-18 18:09:05 -07:00
Yu-Ju Hong 7b71780dfc kubelet/config/http_test: use versioned ContainerManifest 2015-03-18 17:40:40 -07:00
Victor Marmol ce96182cc3 Add SelfLink to Kubelet http source. 2015-03-18 16:38:41 -07:00
Filip Grzadkowski 1a352b74ba Periodically update pod status from kubelet. 2015-03-18 12:11:39 +01:00
Salvatore Dario Minonne 31ddefc347 Finalize fields.Selector 2015-03-17 22:55:43 +01:00
Yu-Ju Hong 929fb63b33 Sync static pods from Kubelet to the API server
Currently, API server is not aware of the static pods (manifests from
sources other than the API server, e.g. file and http) at all. This is
inconvenient since users cannot check the static pods through kubectl.
It is also sub-optimal because scheduler is unaware of the resource
consumption by these static pods on the node.

This change syncs the information back to the API server by creating a
mirror pod via API server for each static pod.

 - Kubelet creates containers for the static pod, as it would do
   normally.

 - If a mirror pod gets deleted, Kubelet will re-create one. The
   containers are sync'd to the static pods, so they will not be
   affected.

 - If a static pod gets removed from the source (e.g. manifest file
   removed from the directory), the orphaned mirror pod will be deleted.

Note that because events are associated with UID, and the mirror pod has
a different UID than the original static pod, the events will not be
shown for the mirror pod when running `kubectl describe pod
<mirror_pod>`.
2015-03-17 08:45:56 -07:00
Filip Grzadkowski 18b728ff44 Revert "Periodically update pod status from kubelet." 2015-03-17 13:51:45 +01:00
Filip Grzadkowski 336525a27d Periodically update pod status from kubelet. 2015-03-16 23:03:03 +01:00
Victor Marmol bdc1981eb5 Merge pull request #5433 from wojtek-t/remove_bound_pods
Remove BoundPods from Kubelet
2015-03-16 13:38:24 -07:00
Wojciech Tyczynski 5d95e9e671 Remove BoundPods from Kubelet 2015-03-16 19:17:21 +01:00