1. 30 Oct, 2016 17 commits
    • Kubernetes Submit Queue's avatar
      Merge pull request #35732 from fabianofranz/run_cant_dryrun_with_attach · 71ba8a90
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Better kubectl run validations
      
      Adds more validations to flags that must be mutually exclusive in `kubectl run`. For example, `--dry-run` must not be used with `--attach`, `--stdin` or `--tty`. Adds unit tests for these new validations and some previously existing ones.
      
      **Release note**:
      <!--  Steps to write your release note:
      1. Use the release-note-* labels to set the release note state (if you have access) 
      2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
      -->
      ```release-note
      NONE
      ```
      71ba8a90
    • Kubernetes Submit Queue's avatar
      Merge pull request #35326 from apprenda/kubeadm-unit-tests-pkg-preflight · 9e71a653
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      kubeadm: added unit test for app/preflight pkg
      
      Added unit test for kubeadm/app/preflight package testing functionality of checks.go.
      
      This PR is part of the ongoing effort to add tests (#35025)
      
      /cc @pires @jbeda
      9e71a653
    • Kubernetes Submit Queue's avatar
      Merge pull request #35843 from bulletRush/feature/pre-hostname-check · b4f8d88d
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      [kubeadm] pre-flight check hostname to ensure kubelet can launch static pods li…
      
      <!--  Thanks for sending a pull request!  Here are some tips for you:
      1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
      2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
      3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
      -->
      
      **What this PR does / why we need it**: pre-flight check hostname to ensure kubelet can launch static pods like kube-apiserver/kube-controller-manager
      
      **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # 
      
      **Special notes for your reviewer**:
      
      # what is the influence of this issue?
      
      kubelet will not create api server and kcm pod if your hostname is uncorrect. It complain the config files in "/etc/kubernetes/manifests" are invlid.
      
      # how to reproduce this issue?
      
      change your hostname by `hostnamectl set-hostname vm_81_12_centos`. then run `kubeadm init`. you will get this error log from kubelet:
      
      ```log
      Oct 27 11:12:57 vm_81_12_centos kubelet: I1027 11:12:57.279458    2695 file.go:123] Can't process config file "/etc/kubernetes/manifests/kube-controller-manager.json": invalid pod: [metadata.name: Invalid value: "kube-controller-manager-vm_81_12_centos": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com') spec.nodeName: Invalid value: "vm_81_12_centos": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com')]
      ```
      
      # where the error comes from in the code?
      
      `pkg/kubelet/config/file.go:144 sourceFile:extractFromDir`
      
      ```go
      func (s *sourceFile) extractFromDir(name string) ([]*api.Pod, error) {
      	dirents, err := filepath.Glob(filepath.Join(name, "[^.]*"))
      	if err != nil {
      		return nil, fmt.Errorf("glob failed: %v", err)
      	}
      
      	pods := make([]*api.Pod, 0)
      	if len(dirents) == 0 {
      		return pods, nil
      	}
      
      	sort.Strings(dirents)
      	for _, path := range dirents {
      		statInfo, err := os.Stat(path)
      		if err != nil {
      			glog.V(1).Infof("Can't get metadata for %q: %v", path, err)
      			continue
      		}
      
      		switch {
      		case statInfo.Mode().IsDir():
      			glog.V(1).Infof("Not recursing into config path %q", path)
      		case statInfo.Mode().IsRegular():
      			pod, err := s.extractFromFile(path)
      			if err != nil {
      -->				glog.V(1).Infof("Can't process config file %q: %v", path, err)
      			} else {
      				pods = append(pods, pod)
      			}
      		default:
      			glog.V(1).Infof("Config path %q is not a directory or file: %v", path, statInfo.Mode())
      		}
      	}
      	return pods, nil
      }
      ```
      
      # how to fix it?
      
      1. change hostname by `hostnamectl set-hostname <right host name>` or
      2. add `hostnameOverride` config. If hostnameOverride is set, then kubelet will use this value instead of system hostname.
      
      **Release note**:
      <!--  Steps to write your release note:
      1. Use the release-note-* labels to set the release note state (if you have access) 
      2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
      -->
      ```release-note
      ```
      
      …ke kube-apiserver/kube-controller-manager and so on.
      b4f8d88d
    • Kubernetes Submit Queue's avatar
      Merge pull request #35231 from apprenda/kubeadm-unit-tests-pkg-util · defb44a4
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Kubeadm added unit tests for pkg app/util
      
      Added unit tests for kubeadm/app/util package testing functionality of tokens.go, error.go, and kubeconfig.go.
      
      This PR is part of the ongoing effort to add tests (#35025)
      
      /cc @pires @jbeda
      defb44a4
    • Kubernetes Submit Queue's avatar
      Merge pull request #35733 from mikedanese/set-gen · 8a202edd
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      bazel: implement set-gen as a bazel genrule
      
      cc @caesarxuchao who is the gengo master until @lavalamp is back.
      8a202edd
    • bulletRush's avatar
    • Kubernetes Submit Queue's avatar
      Merge pull request #35050 from JacobTanenbaum/resource_fixes · bc5682bb
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      fixed some issues with kubectl set resources
      
      when using kubectl set resources it resets all resource fields that are not being set.
      
      for example
        # kubectl set resources deployments nginx --limits=cpu=100m
      
      followed by
      
        # kubectl set resources deployments nginx --limits=memory=256Mi
      
      would result in the nginx deployment only limiting memory at 256Mi with the previous
      limit placed on the cpu being wiped out. This behavior is corrected so that each invocation
      only modifies fields set in that command and changed the testing so that the desired behavior
      is checked.
      
      Also a typo:
      
       you must specify an update to requests or limits or  (in the form of --requests/--limits)
      
      corrected to
      
       you must specify an update to requests or limits (in the form of --requests/--limits)
      
       Implemented both the dry run and local flags.
      
      Added test cases to show that both flags are operating as intended.
      Removed the print statement "running in local mode" as in PR#35112
      bc5682bb
    • Kubernetes Submit Queue's avatar
      Merge pull request #35420 from soltysh/sj_replace_fix · 7d911417
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Remove Job also from .status.active for Replace strategy
      
      When iterating over list of Jobs we're removing each of them when strategy is replace. Unfortunately, the job reference was not removed from `.status.active` which cause the controller trying to remove it once again during next run and failed removing what was already removed during previous run. This was cause by not removing the reference previously. This PR fixes that and cleans logs a bit, in that controller.
      
      @erictune fyi
      @janetkuo ptal
      7d911417
    • Kubernetes Submit Queue's avatar
      Merge pull request #35664 from ymqytw/update_drain_test · 1ff0b422
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Update drain test
      
      Update how int convert to string in the kubectl drain test.
      It is safer to use `strconv.Itoa()` than `string()`.
      1ff0b422
    • Kubernetes Submit Queue's avatar
      Merge pull request #35390 from kargakis/update-eviction-comment · 8e213a4a
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      apis: update comment for Eviction resource
      8e213a4a
    • Kubernetes Submit Queue's avatar
      Merge pull request #35427 from fabianofranz/issues_35426 · 5f8dc216
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      kubectl commands must not use the factory out of Run
      
      Fixes https://github.com/kubernetes/kubernetes/issues/35426
      
      @smarterclayton PTAL
      5f8dc216
    • Kubernetes Submit Queue's avatar
      Merge pull request #35675 from liggitt/pv-secrets · 60dc2fa5
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Require PV provisioner secrets to match type
      
      In 1.5, PV provisioners are allowing targeting namespaced secrets via storageclass params. This adds a requirement that those secrets' type match the volume provisioner plugin name, to prevent targeting and extraction of arbitrary secrets
      
      Helps limit secret targeting issues mentioned in https://github.com/kubernetes/kubernetes/issues/34822
      60dc2fa5
    • Kubernetes Submit Queue's avatar
      Merge pull request #35454 from bowei/image-for-issue-32551 · 6343db83
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Add test image for networking related tests
      
      This test image is to support the e2e test for #32551
      6343db83
    • Kubernetes Submit Queue's avatar
      Merge pull request #33024 from juanvallejo/jvallejo/add-print-error-w-causes-cmdutil-helper · 7778ee21
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Add "PrintErrorWithCauses" cmdutil helper
      
      **Release note**:
      ```release-note
      NONE
      ```
      
      This patch adds a new helper function to `cmd/util/helpers.go` that
      handles errors containing collections of causes and prints each cause in
      a separate newline.
      7778ee21
    • Kubernetes Submit Queue's avatar
      Merge pull request #35611 from feiskyer/os-interface · 9f996271
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue
      
      Use osInterface for Create
      
      A small fix of using osInterface instead of os for `Create()`.
      
      cc/ @Random-Liu
      9f996271
    • Anirudh Ramanathan's avatar
      Merge pull request #35855 from caesarxuchao/fix-gke · 52cf3eae
      Anirudh Ramanathan authored
      Skip scheduleJob e2e test if it's not enabled on server
      52cf3eae
    • Chao Xu's avatar
      6d33edda
  2. 29 Oct, 2016 23 commits