1. 17 Jan, 2017 23 commits
    • deads2k's avatar
      remove files moved to apimachinery · 67fac70e
      deads2k authored
      67fac70e
    • Kubernetes Submit Queue's avatar
      Merge pull request #39447 from gyliu513/patch1 · 0bd13332
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Corrected a typo in scheduler factory.go.
      
      **What this PR does / why we need it**:
      
      **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
      
      **Special notes for your reviewer**:
      
      **Release note**:
      
      ```release-note
      ```
      0bd13332
    • Kubernetes Submit Queue's avatar
      Merge pull request #39601 from mqliang/upstream-tolerates-taints-bugfix · b1506004
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue (batch tested with PRs 39945, 39601)
      
      bugfix for PodToleratesNodeTaints
      
      `PodToleratesNodeTaints`predicate func should return true if pod has no toleration annotations and node's taint effect is `PreferNoSchedule`
      b1506004
    • Kubernetes Submit Queue's avatar
      Merge pull request #39945 from sttts/sttts-cutoff-pkg-serviceaccount-dep · f0b0cd03
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      genericapiserver: cut off pkg/serviceaccount dependency
      
      **Blocked** by pkg/api/validation/genericvalidation to be split up and moved into apimachinery.
      f0b0cd03
    • Kubernetes Submit Queue's avatar
      Merge pull request #39997 from soltysh/cronjob_leftovers · 550f8be7
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue (batch tested with PRs 39948, 39997)
      
      Fix ScheduledJob -> CronJob rename leftovers
      
      I found a few leftovers from the rename I did some time ago.
      
      @kubernetes/sig-apps-misc ptal
      550f8be7
    • Kubernetes Submit Queue's avatar
      Merge pull request #39948 from sttts/sttts-move-pkg-api-rest-into-genericapiserver · 3b4e2221
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Move pkg/api/rest into genericapiserver
      
      **What this PR does / why we need it**:
      
      **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
      
      **Special notes for your reviewer**:
      
      **Release note**:
      
      ```release-note
      ```
      3b4e2221
    • Dr. Stefan Schimanski's avatar
    • Kubernetes Submit Queue's avatar
      Merge pull request #39608 from peay/cronjob-too-many-times-to-list · 9d2fce7c
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Do not list CronJob unmet starting times beyond deadline
      
      **What this PR does / why we need it**:
      
      See #36311. `getRecentUnmetScheduleTimes` gives up after 100 unmet times to avoid wasting too much CPU or memory generating all the times, as it generates them sequentially.
      
      When concurrency is forbidden, this is conceptually un-necessary: we only need the last unmet start time. This suggests that when concurrency is forbidden, we could generate times by going backward in time from now. This is not very practical as CronJob currently relies on a package that only provides `Next` and no `Prev`. Hand-cooking a `Prev` does not seem like a good idea. I could submit a PR to the cron library to add a `Prev` method, and use that when concurrency is forbidden through something like `getLastUnmetScheduleTime`. This would be `O(1)` and there would be no limit involved.
      
      (edit: actually, even for the other concurrency settings, we only start the last unmet start times -- there is a `TODO` in the controller to actually start all of them, but that is not implemented at the moment. This means the solution would apply, at least temporarily, to all concurrency settings).
      
      cc @soltysh what do you think?
      
      In the meantime, I would suggest to do something simple. Currently, the user has no way to configure anything to ensure that his CronJob will not get stuck if one job takes more that 100 unmet times.
      
       `getRecentUnmetScheduleTimes` starts with an initial time corresponding to the last start (or to the creation of the CronJob, if nothing has started yet). However, when `StartingDeadlineSeconds` is set, the controller will not start anything that is older than the deadline, so if the last start is way beyond the deadline, we are generating potentially lots of unmet start times that will not be considered by the scheduler for scheduling anyway.
      
      Consider a job running every minute, where the last instance has taken 120 minutes. This means there are more than 100 unmet times when we start counting from the last start time.
      
      **The PR makes `getRecentUnmetScheduleTimes` only consider times that do not fall beyond the deadline.** Here, the CronJob can be configured with a `StartingDeadlineSeconds` of, say, 10 minutes. After the 120min job has run, `getRecentUnmetScheduleTimes` will only consider the times in the last 10 minutes from now, and will not get stuck.
      
      As a side note on the max. number of unmet times to use as limits in terms of CPU used by the controller: I have run a quick benchmark on my i7 mac. Schedules corresponding to "once a week" tend to be more expensive to generate unmet times for. Just FYI.
      
      ```
      +--------------+---------------+--------------+
      |   SCHEDULE   | MISSED STARTS |    TIMING    |
      +--------------+---------------+--------------+
      | */1 * * * ?  |           100 | 383.645µs    |
      | */30 * * * ? |           100 | 354.765µs    |
      | 30 1 * * ?   |           100 | 1.065124ms   |
      | 30 1 * * 0   |           100 | 1.80034ms    |
      | */1 * * * ?  |           500 | 1.341365ms   |
      | */30 * * * ? |           500 | 1.814441ms   |
      | 30 1 * * ?   |           500 | 8.475012ms   |
      | 30 1 * * 0   |           500 | 10.020613ms  |
      | */1 * * * ?  |          1000 | 2.551697ms   |
      | */30 * * * ? |          1000 | 4.075813ms   |
      | 30 1 * * ?   |          1000 | 17.674945ms  |
      | 30 1 * * 0   |          1000 | 19.149324ms  |
      | */1 * * * ?  |         10000 | 25.725531ms  |
      | */30 * * * ? |         10000 | 87.520022ms  |
      | 30 1 * * ?   |         10000 | 174.29216ms  |
      | 30 1 * * 0   |         10000 | 196.565748ms |
      +--------------+---------------+--------------+
      ```
      
      using
      
      ```.go
      package main
      
      import (
          "fmt"
          "time"
          "os"
          "strconv"
      
          "github.com/robfig/cron"
          "github.com/olekukonko/tablewriter"
      )
      
      func timeSchedule(schedule string, iterations int) (time.Duration) {
          sched, err := cron.ParseStandard(schedule)
      
          if err != nil {
              panic(fmt.Sprintf("Unparseable schedule: %s", err))
          }
      
          start := time.Now()
          t := time.Now()
      
          for i := 1; i <= iterations; i++ {
              t = sched.Next(t)
          }
      
          return time.Since(start)
      }
      
      func main() {
          table := tablewriter.NewWriter(os.Stdout)
          table.SetHeader([]string{"Schedule", "Missed starts", "Timing"})
      
          schedules := []string{"*/1 * * * ?", "*/30 * * * ?", "30 1 * * ?", "30 1 * * 0"}
          iteration_nums := []int{100, 500, 1000, 10000}
      
          for _, iterations := range iteration_nums {
              for _, schedule := range schedules {
                  table.Append([]string{schedule,
                                        strconv.Itoa(iterations),
                                        timeSchedule(schedule, iterations).String()})
              }
          }
          table.Render()
      }
      ```
      
      **Which issue this PR fixes**: fixes #36311
      
      **Special notes for your reviewer**:
      
      **Release note**:
      
      ```release-note
      ```
      9d2fce7c
    • Dr. Stefan Schimanski's avatar
    • Dr. Stefan Schimanski's avatar
      1c4849c4
    • Dr. Stefan Schimanski's avatar
      Update bazel · 8fe0958b
      Dr. Stefan Schimanski authored
      8fe0958b
    • Dr. Stefan Schimanski's avatar
      Fix imports · 5c88b7d0
      Dr. Stefan Schimanski authored
      5c88b7d0
    • Dr. Stefan Schimanski's avatar
    • Maciej Szulik's avatar
      4a0c9fa5
    • Kubernetes Submit Queue's avatar
      Merge pull request #39968 from timothysc/sched_owners · 7b471136
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue (batch tested with PRs 37680, 39968)
      
      Update Owners for Scheduler
      
      Update Owners file for scheduler component to spread the reviews around. 
      
      /cc @davidopp  per previous sig-mtg.
      7b471136
    • Kubernetes Submit Queue's avatar
      Merge pull request #37680 from mfojtik/report-pod-name · d270ec0e
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Report the Pod name and namespace when kubelet fails to sync the container
      
      This helps debugging problems with SELinux (and other problems related to the Docker failed to run the container) as currently only the UUID of the Pod is reported:
      
      ```
      Error syncing pod 670f607d-b5a8-11a4-b673-005056b7468b, skipping: failed to "StartContainer" for "deployment" with RunContainerError: "runContainer: Error response from daemon: Relabeling content in /usr is not allowed."
      ```
      
      Here it would be useful to know what pod in which namespace is trying to mount the "/usr".
      d270ec0e
    • Kubernetes Submit Queue's avatar
      Merge pull request #39993 from k82cn/pod_anti_affinity_issue · e1900f70
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Fixed pod anti-affinity bugs.
      
      Broken by https://github.com/kubernetes/kubernetes/pull/39478/files#diff-fa4312d87a8e13262ade8a784ada4693R1036
      
      /cc @timothysc @rrati
      e1900f70
    • Klaus Ma's avatar
      Fixed pod anti-affinity bugs. · c184fef6
      Klaus Ma authored
      c184fef6
    • Kubernetes Submit Queue's avatar
      Merge pull request #39853 from xingzhou/typo · 4937b05a
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Fixed typo.
      4937b05a
    • Kubernetes Submit Queue's avatar
      Merge pull request #38272 from xingzhou/kube-38143 · 73c900b5
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Added validation for API server's 'apiserver-count' flag.
      
      Added validation for API server's 'apiserver-count' flag. The value of this flag should be a positive number, otherwise, will cause error while reconciling endpoints in MasterCountEndpointsReconciler. 
      
      Fixed #38143
      73c900b5
    • Kubernetes Submit Queue's avatar
      Merge pull request #38094 from yarntime/fix_update_typo · f74b4bbb
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      fix typos
      
      fix typos.
      f74b4bbb
    • Timothy St. Clair's avatar
      Update Owners for Scheduler · 78574926
      Timothy St. Clair authored
      78574926
    • Kubernetes Submit Queue's avatar
      Merge pull request #39916 from smarterclayton/generate_for_staging · adbf7137
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Generate changes for staged repos (apimachinery, apiserver)
      
      Restores OpenAPI types, deepcopy, and bazel for meta/v1 types.
      
      Fixes #39912
      adbf7137
  2. 16 Jan, 2017 17 commits