Commit Graph

174 Commits

Author SHA1 Message Date
Sergiusz Urbaniak
9eae47c6e6 scheduler: implement role awareness 2015-11-23 17:27:14 +01:00
deads2k
a87d927588 update client.Config to use GroupVersion 2015-11-21 08:29:26 -05:00
k8s-merge-robot
a999c0fbe4 Merge pull request #13943 from mesosphere/static-pods
Auto commit by PR queue bot
2015-11-16 13:53:23 -08:00
Dr. Stefan Schimanski
2f45d5706b Add node status update controller 2015-11-16 11:48:04 +01:00
James DeFelice
3d3577b9f3 rewrite of static pod json zipper
- add busybox static pod to mesos-docker cluster
- customize static pods with binding annotations
- code cleanup
- removed hacky podtask.And func; support minimal resources for static pods when resource accounting is disabled
- removed zip archive of static pods, changed to gzip of PodList json
- pod utilities moved to package podutil
- added e2e test
- merge watched mirror pods into the mesos pod config stream
2015-11-13 23:30:26 +00:00
k8s-merge-robot
e88593d788 Merge pull request #14542 from vishh/kubelet-refactor
Auto commit by PR queue bot
2015-11-12 15:24:22 -08:00
Dr. Stefan Schimanski
ec582e736e Rename KubernetesMesosExecutor -> Executor 2015-11-12 01:33:50 +01:00
Dr. Stefan Schimanski
3601292cff Split MesosScheduler from actual Scheduler code holding the task registry
- rename types.Framework -> types.Scheduler
- rename MesosScheduler -> Framework
- transform MesosFramework into independent Scheduler glueing all scheduler
  components, implementing types.Scheduler and owning the task registry
2015-11-12 01:33:50 +01:00
Dr. Stefan Schimanski
60cc93fff8 Remove ExecutorInfo from podtask.T and create it with the TaskInfo 2015-11-12 01:33:50 +01:00
Dr. Stefan Schimanski
d4675f1dc3 Rename mesos_{scheduler ->}.go, {mesos ->}framework.go 2015-11-12 01:33:50 +01:00
Dr. Stefan Schimanski
518a7d5f3b Rename KubernetesMesosScheduler -> MesosScheduler 2015-11-12 01:33:50 +01:00
Dr. Stefan Schimanski
866a17d6d8 Rename KubernetesExecutor -> KubernetesMesosExecutor 2015-11-12 01:33:50 +01:00
Vishnu kannan
4ad3d6f5fe Move container manager into a separate package.
Inject container manager into Kubelet. This lets us stub out container
manager during integration testing.
2015-11-11 15:00:37 -08:00
Wojciech Tyczynski
d47e21f19f Reuse TCP connections in Reflector between resync periods. 2015-10-26 19:35:25 +01:00
eulerzgy
31c09bdcb8 Del capatical local packagename for cadvisorApi 2015-10-16 11:03:50 +08:00
Dr. Stefan Schimanski
1435077820 Set executor cpu resources to an integer to avoid rounding errors
This avoid that we either waste cpu resources due to rounding or that we report
to much to the kubelet such that the e2e tests think they can schedule more than
resources are available.

This fixes https://github.com/mesosphere/kubernetes-mesos/issues/437
2015-10-10 21:19:08 +02:00
Dr. Stefan Schimanski
ae7830b4be Pass Mesos cpu and mem values to cadvisor 2015-10-10 21:19:08 +02:00
Dr. Stefan Schimanski
0d8384c820 Replace all executor_test timeouts by util.ForeverTestTimeout 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
b629278d7d Set static pods dir to 0750 instead of world readible 0755 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
d74950cfb9 Re-use CreateAndInitKubelet 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
4ec703174b Simplify executorKubelet decorator and move to kubelet.go
- simplify
- rename kubeletExecutor -> executorKubelet
- move executorKubelet code into kubelet.go
- remove duplicated executorKubelet.ListenAndServe
- fix executorKubelet.Run comment
2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
0feb1bceb5 Re-use KubeletServer.KubeletConfig and KubeletServer.Run 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
dd5bafdba5 Decouple startup of executor and kubelet 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
a60df400fd Decouple executor initialization from kubelet
This patch reduces the dependencies of the executor from the kubelet. This
makes it possible launch the kubelet after the executor.

This considerably reduces the complexity of the startup code.

Moreover, this work is a requirement to use a standalone kubelet some day.
2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
93ae257af4 Consolidate executor driver initialization code 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
efdd726027 Un-knot static pods creation in executor 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
686b767f28 Remove redundant kubelet dependency of executor 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
6af86cbaad Avoid panics during executor shutdown due to write to closed channel 2015-10-10 11:54:27 +02:00
Dr. Stefan Schimanski
9366ac4143 Pass PodLW to executor in tests 2015-10-10 11:54:27 +02:00
Mike Danese
392f33e417 Merge pull request #14054 from mikedanese/register-master
register master kubelet with the apiserver
2015-10-09 17:12:37 -07:00
Yu-Ju Hong
a3e60cc32e Rename imported package local name kubeletTypes to kubetypes
According to the naming guidelines, package name should not include mixedCaps.
2015-10-09 10:24:31 -07:00
k8s-merge-robot
b793c3edf1 Merge pull request #14700 from liggitt/kubelet_authz
Auto commit by PR queue bot
2015-10-09 03:01:43 -07:00
k8s-merge-robot
538cf72208 Merge pull request #15051 from feiskyer/kubelet/garbage-collection
Auto commit by PR queue bot
2015-10-09 02:11:47 -07:00
Jordan Liggitt
9d6b52881d Add authentication/authorization interfaces to kubelet, always include /metrics with /stats 2015-10-09 03:10:00 -04:00
Mike Danese
fa60bbe8e6 add flag to kubelet to ignore the cidr passed down by the apiserver on the master 2015-10-08 21:21:19 -07:00
feisky
43a654ed7b Refacotor gcPolicy in contrib/mesos 2015-10-09 06:57:10 +08:00
Yu-Ju Hong
098ab05997 kubelet: move common types to kubelet/types
This would faciliate tasks such as moving code in pkg/kubelet to sub packages.
2015-10-08 14:38:01 -07:00
Alex Robinson
c18d872f1a Merge pull request #15034 from mesosphere/jdef-fix-broken-master
MESOS: bugfix, configure oomAdjuster so that it gets passed on to the kubelet
2015-10-05 17:00:29 -07:00
Alex Robinson
fe185f5ea7 Merge pull request #14415 from mesosphere/sttts-code-dedup-kubelet-init
Preparation for Mesos kubelet code-deduplication
2015-10-05 14:43:06 -07:00
Alex Robinson
84f8f01d45 Merge pull request #14432 from mesosphere/sur-k8sm-492-launch-grace-period
MESOS make launchGracePeriod configurable
2015-10-05 13:27:12 -07:00
k8s-merge-robot
02f878cf5b Merge pull request #14553 from mesosphere/sttts-fix-daemonsets-on-mesos
Auto commit by PR queue bot
2015-10-02 19:16:08 -07:00
James DeFelice
e00a1b8e9e added missing forwarding of flags to KubeletConfig 2015-10-02 23:36:22 +00:00
James DeFelice
54e99d9f52 bugfix: configure oomAdjuster so that it gets passed on to the kubelet 2015-10-02 22:49:52 +00:00
Dr. Stefan Schimanski
10f9a9752d Use KubeletConfig.Builder in Mesos executor 2015-10-02 19:39:24 +02:00
k8s-merge-robot
6ca515c312 Merge pull request #14820 from gmarek/playground
Auto commit by PR queue bot
2015-10-02 07:37:45 -07:00
Sergiusz Urbaniak
42c84954fd executor,scheduler: make launchGracePeriod configurable 2015-10-02 07:43:49 +02:00
k8s-merge-robot
719cf5617e Merge pull request #14731 from mesosphere/sttts-remove-redirfd
Auto commit by PR queue bot
2015-10-01 19:34:13 -07:00
gmarek
fc79ce347e Allow usining FakeOOMAdjuster in Kubelet 2015-10-01 10:55:08 +02:00
Dr. Stefan Schimanski
74e57e85f1 Pass all changes of DeletionTimestamp and DeletionGracePeriodSeconds to kubelet 2015-10-01 06:50:07 +02:00
eulerzgy
71b96422f4 set capital in some files 2015-09-30 14:46:20 +08:00
Dr. Stefan Schimanski
67d5b8a258 Remove redirfd executable and support in the executor 2015-09-30 06:51:39 +02:00
k8s-merge-robot
b661cfd21e Merge pull request #14643 from liguangbo/change_Oom_to_OOM
Auto commit by PR queue bot
2015-09-29 18:54:22 -07:00
liguangbo
12299087da Change Oom to OOM 2015-09-28 18:18:04 +08:00
Dr. Stefan Schimanski
4d4ebe9f18 Add Mesos slave attributes as node labels
- pre-create node api objects from the scheduler when offers arrive
- decline offers until nodes a registered
- turn slave attributes as k8s.mesosphere.io/attribute-* labels
- update labels from executor Register/Reregister
- watch nodes in scheduler to make non-Mesos labels available for NodeSelector matching
- add unit tests for label predicate
- add e2e test to check that slave attributes really end up as node labels
2015-09-26 09:46:56 +02:00
Dr. Stefan Schimanski
9c24131b4e Remove unused Watch code in executor 2015-09-25 17:55:22 +02:00
Dr. Stefan Schimanski
61b7e682ce Fix zero MaxOpenFiles in Mesos executor 2015-09-24 11:59:16 +02:00
Dr. Stefan Schimanski
be57b2871e Watch pods in executor and tell kubelet about graceful terminations
- instantiate framework.Controller for pods in the executor using framework.NewInformer,
  in order to watch pod updates for pods on that host
- forwards updates like graceful termination to the kubelet.

  This might also be the preparation for other updates which are supported by the
  kubelet.
2015-09-22 16:41:43 +02:00
k8s-merge-robot
3713cbc912 Merge pull request #14169 from mesosphere/sttts-fix-kubelet-writer-npe
Auto commit by PR queue bot
2015-09-21 13:04:25 -07:00
k8s-merge-robot
1ad9aad8ab Merge pull request #14259 from mesosphere/sttts-cleanup-task-lost
Auto commit by PR queue bot
2015-09-21 07:11:48 -07:00
k8s-merge-robot
0525e6e1e6 Merge pull request #14121 from mesosphere/sttts-extract-suicide-code
Auto commit by PR queue bot
2015-09-21 01:14:00 -07:00
Dr. Stefan Schimanski
132f8892ed Move task-lost message prefix into messages module 2015-09-21 09:51:05 +02:00
Dr. Stefan Schimanski
9d8d0ed075 Fix missing volume writer in executor kubelet instantiation 2015-09-21 09:23:47 +02:00
Dr. Stefan Schimanski
a9d7acea39 Move suicide logic into its own file 2015-09-18 16:54:56 +02:00
Alex Mohr
bdfd469a85 Merge pull request #14137 from caesarxuchao/13823
rebase 13823
2015-09-17 15:25:52 -07:00
Kris
f4ad00d9ae Moving Status object to a common package 2015-09-17 14:09:53 -07:00
Filip Grzadkowski
7fe34f2050 Introduce nsenter writer for volume plugins 2015-09-17 16:40:29 +02:00
gmarek
4b8ddf3d7e Add information about ports opened by Kubelet to API 2015-09-15 14:24:55 -04:00
k8s-merge-robot
bfc60709b1 Merge pull request #13468 from yifan-gu/rkt_doc
Auto commit by PR queue bot
2015-09-10 20:32:08 -07:00
Daniel Smith
b225c1d47a Run gofmt (separate commit for easy rebases) 2015-09-10 17:17:59 -07:00
Daniel Smith
15b30b8b09 Move version agnostic parts of client
pkg/client/unversioned/cache -> pkg/client/cache
pkg/client/unversioned/record -> pkg/client/record
2015-09-10 17:17:59 -07:00
Yifan Gu
e7b9c50ba1 kubelet/rkt: add support for different stage1 image.
Also enable grace stop for service files.
2015-09-10 14:58:03 -07:00
jiangyaoguo
1460a1fb9e Rate limit events in kubelet
1. Add EvnetRecordQps and EventBurst parameter in kubelet.
2. If  EvnetRecordQps and EventBurst was set, rate limit events in kubelet
with a independent ratelimiter as setted.
2015-09-09 16:57:21 +08:00
Chao Xu
9fc79e9d99 refactor testapi and test scripts to prepare for multiple API groups. 2015-09-04 18:01:32 -07:00
Abhi Shah
c9f2d3151b Merge pull request #13155 from derekwaynecarr/enforce_limits
Map cpu limits to cpu-quota in docker run
2015-09-03 16:28:04 -07:00
k8s-merge-robot
d1c7a5f04e Merge pull request #13362 from mesosphere/proxy-runtime
Auto commit by PR queue bot
2015-09-03 15:26:56 -07:00
Dr. Stefan Schimanski
216865b80a Switch to incremental pod config notification
This fixes https://github.com/mesosphere/kubernetes-mesos/issues/463, i.e.
https://github.com/kubernetes/kubernetes/pull/13003 which broke contrib/mesos.
2015-09-03 22:49:02 +02:00
derekwaynecarr
5dc74e8dbf Add support for CFS quota in kubelet 2015-09-03 13:44:28 -04:00
James DeFelice
7fbd290167 moved cgroup-root detection to minion service; kube proxy now configured to run in mesos container 2015-09-02 06:13:26 +00:00
Pedro Roque Marques
99b1da848d Add kubelet '--resolv-conf' flag.
Allow the user to specify the resolver configuration file that is used
to determine the default DNS parameters. This defaults to the system's
/etc/resolv.conf.
2015-08-26 15:41:36 -07:00
Yu-Ju Hong
b906e34576 kubelet: trigger pod workers independently
Currently, whenever there is any update, kubelet would force all pod workers to
sync again, causing resource contention and hence performance degradation.

This commit flips kubelet to use incremental updates (as opposed to snapshots).
This allows us to know what pods have changed and send updates to those pod
workers only. The `SyncPods` function has been replaced with individual
handlers, each handling an operation (ADD, REMOVE, UPDATE). Pod workers are
still triggered periodically, and kubelet performs periodic cleanup as well.

This commit also spawns a new goroutine solely responsible for killing pods.
This is necessary because pod killing could hold up the sync loop for
indefinitely long amount of time now user can define the graceful termination
period in the container spec.
2015-08-25 17:52:01 -07:00
caogaojin
60cb4406e9 Cleanup deprecated Forever function
Since util.Forever function has been deprecated, we should cleanup these
pieces of code.
2015-08-24 10:31:59 +08:00
Saad Ali
9b01580946 Merge pull request #12872 from runningwild/master
Fix several problems with using rkt on gce
2015-08-20 15:46:16 -07:00
Wojciech Tyczynski
e794e36a32 Merge pull request #12861 from mesosphere/empty-kubelet-container-vars
MESOS: Stop the kubelet from taking control over cgroups and other processes
2015-08-20 09:02:19 +02:00
Dr. Stefan Schimanski
d6feca1885 Set the kubelet cgroup to <executor-cgroup>/kubelet
In contrast to the docker and system containers (= cgroup path) this has no
undesired consequence, only that the kubelet itself will be in its own cgroup
below the executor cgroup.
2015-08-19 20:36:21 +02:00
Jonathan Wills
80e799fc0c Allow configuring the rkt binary in a kubelet with a flag.
This is necessary because coreos comes with rkt installed, and if we want to use a different version
we need some way to avoid the default one.
2015-08-19 09:42:13 -04:00
Kris Rousey
ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00
Dr. Stefan Schimanski
8ddcb222e9 Stop the kubelet from taking control over cgroups and other processes 2015-08-18 17:42:58 +02:00
Alex Robinson
11fcd3bb39 Merge pull request #12478 from eparis/use-pflag-network
Use pflags for net.IP and net.IPNet instead of custom flag types
2015-08-10 11:55:54 -07:00
Eric Paris
fe6b633e2a Convert for util.IP to just use a net.IP
pflag can handle IP addresses so use the pflag code instead of doing it
ourselves. This means our code just uses net.IP and we don't have all of
the useless casting back and forth!
2015-08-10 10:15:05 -04:00
Veres Lajos
9f77e49109 typofix - https://github.com/vlajos/misspell_fixer 2015-08-08 22:31:48 +01:00
Ananya Kumar
6ef3de1d5f Add QoS support on node 2015-08-07 11:18:16 -07:00
Mike Danese
17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese
8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Dr. Stefan Schimanski
76dc61bcfb Revert "Revert "Add Mesos hyperkube minion server ""
This reverts commit 8372b0d927.
2015-07-31 20:33:04 +02:00
Mike Danese
8372b0d927 Revert "Add Mesos hyperkube minion server " 2015-07-31 10:47:42 -07:00
Mike Danese
464e208f95 Merge pull request #11928 from mesosphere/km-minion
Add Mesos hyperkube minion server
2015-07-31 10:25:21 -07:00
Dr. Stefan Schimanski
2b1ecd28f0 Add Mesos hyperkube minion server
The minion server will
- launch the proxy and executor
- relaunch them when they terminate uncleanly
- logrotate their logs.

It is a replacement for a full-blown init process like s6 which is not necessary
in this case.
2015-07-31 12:28:40 +02:00
Dr. Stefan Schimanski
1200125137 Share KM_* constants 2015-07-31 11:27:52 +02:00
Dr. Stefan Schimanski
f59b5f503b Use BindingHostKey annotation to detect scheduled pods in k8sm-scheduler
Before NodeName in the pod spec was used. Hence, pods with a fixed, pre-set
NodeName were never scheduled by the k8sm-scheduler, leading e.g. to a failing
e2e intra-pod test.

Fixes mesosphere/kubernetes-mesos#388
2015-07-31 10:22:20 +02:00
Dr. Stefan Schimanski
a2fa41b73f Implement resource accounting for pods with the Mesos scheduler
This patch

- set limits (0.25 cpu, 64 MB) on containers which are not limited in pod spec
  (these are also passed to the kubelet such that it uses them for the docker
  run limits)
- sums up the container resource limits for cpu and memory inside a pod,
- compares the sums to the offered resources
- puts the sums into the Mesos TaskInfo such that Mesos does the accounting
  for the pod.
- parses the static pod spec and adds up the resources
- sets the executor resources to 0.25 cpu, 64 MB plus the static pod resources
- sets the cgroups in the kubelet for system containers, resource containers
  and docker to the one of the executor that Mesos assigned
- adds scheduler parameters --default-container-cpu-limit and
  --default-container-mem-limit.

The containers themselves are resource limited the Docker resource limit which
the kubelet applies when launching them.

Fixes mesosphere/kubernetes-mesos#68 and mesosphere/kubernetes-mesos#304
2015-07-30 21:18:04 +02:00