Commit Graph

1466 Commits (1430597f7e5917c29fa068bc230eeaf8c97fc747)

Author SHA1 Message Date
Madhusudan.C.S caef02cf43 [Federation][init-06] Check for the availability of federation API server's service loadbalancer address before waiting.
This speeds up the tests. Otherwise tests end up unnecessarily waiting for the
poll interval/duration which is 5 seconds right now.
2016-11-04 00:12:11 -07:00
saadali 402116aed4 Revert "Merge pull request #35821 from vishh/gci-mounter-scope"
This reverts commit 973fa6b334, reversing
changes made to 41b5fe86b6.
2016-11-03 20:23:25 -07:00
Anirudh a5bdc5f509 Set reason and message on Pod during nodecontroller eviction
Pods which are evicted by the nodecontroller due to network
malfunction, or unresponsive kubelet should be differentiated
from termination initiated by other sources. The reason/message
are consumed by kubectl to provide a better summary using get/describe.
2016-11-03 13:47:03 -07:00
juanvallejo ccdbe2f79b update port validation message 2016-11-03 10:19:11 -04:00
Vishnu Kannan 414e4ae549 Revert "Adding a root filesystem override for kubelet mounter"
This reverts commit e861a5761d.
2016-11-02 15:18:09 -07:00
Vishnu Kannan 1ecc12f724 [Kubelet] Do not use custom mounter script for bind mounts, ext* and tmpfs mounts
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
2016-11-02 15:18:08 -07:00
Michail Kargakis 2491216222 Replica set/rc controller changes for Conditions 2016-11-02 10:30:09 +01:00
Michael Taufen a38566dac6 Add FeatureGates field to KubeletConfiguration 2016-11-01 14:53:50 -07:00
Kubernetes Submit Queue 44b684ad53 Merge pull request #33663 from pmorie/selinux-fixes
Automatic merge from submit-queue

SELinux Overhaul

Overhauls handling of SELinux in Kubernetes.  TLDR: Kubelet dir no longer has to be labeled `svirt_sandbox_file_t`.

Fixes #33351 and #33510.  Implements #33951.
2016-11-01 05:04:17 -07:00
xiangpengzhao 466fee8634 Optimize port_split_test test case. 2016-11-01 04:53:46 -04:00
Dr. Stefan Schimanski 7c5e354e82 Update bazel 2016-11-01 09:50:56 +01:00
Dr. Stefan Schimanski 5dc31d35a0 Add --tls-sni-cert-key to the apiserver for SNI support 2016-11-01 09:50:56 +01:00
Kubernetes Submit Queue a9b183db7f Merge pull request #32557 from asalkeld/an-ingress-docs
Automatic merge from submit-queue

Correct the article in generated documents

**What this PR does / why we need it**:
Fix the article in generated docs for "create/delete [article] [kind]"

**Which issue this PR fixes**
fixes #32305

**Special notes for your reviewer**:
None

**Release note**:

``` release-note
Correct the article in generated documents
```

For example:
  "a Ingress" > "an Ingress"
2016-10-31 23:16:46 -07:00
Jordan Liggitt 1a7f7c5399
Allow apiserver to choose preferred kubelet address type 2016-10-31 16:02:38 -04:00
Justin Santa Barbara cebfc821a4 Create simple version of ratelimit package
Allows for more testing.
2016-10-30 20:55:03 -04:00
Angus Salkeld 3a08cf0619 Correct the article in generated documents
For example:

  "a Ingress" > "an Ingress"
2016-10-31 09:46:29 +10:00
Kubernetes Submit Queue 8a202eddfe Merge pull request #35733 from mikedanese/set-gen
Automatic merge from submit-queue

bazel: implement set-gen as a bazel genrule

cc @caesarxuchao who is the gengo master until @lavalamp is back.
2016-10-30 08:43:41 -07:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Madhusudan.C.S 47e53f230e Implement package `triple` with utilities to generate certificate-key pairs for CA, server and clients. 2016-10-28 00:40:41 -07:00
Rod Cloutier 1027f35805 Added support for HOME environment variable on Windows 2016-10-27 20:50:07 -04:00
Kubernetes Submit Queue 9302dcb6fb Merge pull request #35721 from apprenda/fix_mounter_struct
Automatic merge from submit-queue

Fixes PR #35652

This is breaking the build. Fixes #35564

/cc @vishh @sjenning

Fixes PR #35652
2016-10-27 15:20:48 -07:00
Mike Danese 5dc7554ab2 bazel: implement set-gen as a bazel genrule 2016-10-27 15:16:30 -07:00
Paulo Pires 01adb460de
Fixes PR #35652 2016-10-27 15:55:01 -04:00
Vishnu kannan 7fd03c4b6e Fix source and target path with overriden rootfs in mount utility package
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-10-27 09:46:33 -07:00
Vishnu kannan e861a5761d Adding a root filesystem override for kubelet mounter
This is useful for supporting hostPath volumes via containerized
mounters in kubelet.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-10-26 21:42:59 -07:00
Paul Morie 7fb99442a6 Refactor pkg/util/selinux 2016-10-26 09:38:03 -04:00
Huamin Chen 758e8b8b8f add IsNotMountPoint() to mount_unsupported.go
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-10-25 20:20:17 -04:00
Jing Xu b02481708a Fix volume states out of sync problem after kubelet restarts
When kubelet restarts, all the information about the volumes will be
gone from actual/desired states. When update node status with mounted
volumes, the volume list might be empty although there are still volumes
are mounted and in turn causing master to detach those volumes since
they are not in the mounted volumes list. This fix is to make sure only
update mounted volumes list after reconciler starts sync states process.
This sync state process will scan the existing volume directories and
reconstruct actual states if they are missing.

This PR also fixes the problem during orphaned pods' directories. In
case of the pod directory is unmounted but has not yet deleted (e.g.,
interrupted with kubelet restarts), clean up routine will delete the
directory so that the pod directoriy could be cleaned up (it is safe to
delete directory since it is no longer mounted)

The third issue this PR fixes is that during reconstruct volume in
actual state, mounter could not be nil since it is required for creating
container.VolumeMap. If it is nil, it might cause nil pointer exception
in kubelet.

Details are in proposal PR #33203
2016-10-25 12:29:12 -07:00
Michael Taufen dba917c5b7 Include mount command in Kubelet mounter output 2016-10-24 05:50:24 -07:00
Mike Danese df713b478c fix tests by declaring testdata 2016-10-21 17:32:32 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Klaus Ma d2e18d6bd3 Added 'mounterPath' to Mounter interface in 'mount_unsupported.go'. 2016-10-21 16:33:43 +08:00
Jing Xu 34ef93aa0c Add mounterPath to mounter interface
In order to be able to use new mounter library, this PR adds the
mounterPath flag to kubelet which passes the flag to the mount
interface. If flag is empty, mount uses default mount path.
2016-10-20 14:15:27 -07:00
bprashanth 243bd5743b Flip the beta flag 2016-10-19 13:49:49 -07:00
Kubernetes Submit Queue 84aa5f695f Merge pull request #35038 from sjenning/nfs-nonblock-reader2
Automatic merge from submit-queue

kubelet: storage: don't hang kubelet on unresponsive nfs

Fixes #31272 

Currently, due to the nature of nfs, an unresponsive nfs volume in a pod can wedge the kubelet such that additional pods can not be run.

The discussion thus far surrounding this issue was to wrap the `lstat`, the syscall that ends up hanging in uninterruptible sleep, in a goroutine and limiting the number of goroutines that hang to one per-pod per-volume.

However, in my investigation, I found that the callsites that request a listing of the volumes from a particular volume plugin directory don't care anything about the properties provided by the `lstat` call.  They only care about whether or not a directory exists.

Given that constraint, this PR just avoids the `lstat` call by using `Readdirnames()` instead of `ReadDir()` or `ReadDirNoExit()`

### More detail for reviewers
Consider the pod mounted nfs volume at `/var/lib/kubelet/pods/881341b5-9551-11e6-af4c-fa163e815edd/volumes/kubernetes.io~nfs/myvol`.  The kubelet wedges because when we do a `ReadDir()` or `ReadDirNoExit()` it calls `syscall.Lstat` on `myvol` which requires communication with the nfs server.  If the nfs server is unreachable, this call hangs forever.

However, for our code, we only care what about the names of files/directory contained in `kubernetes.io~nfs` directory, not any of the more detailed information the `Lstat` call provides.  Getting the names can be done with `Readdirnames()`, which doesn't need to involve the nfs server.

@pmorie @eparis @ncdc @derekwaynecarr @saad-ali @thockin @vishh @kubernetes/rh-cluster-infra
2016-10-18 12:37:31 -07:00
Kubernetes Submit Queue e62a8b9167 Merge pull request #34962 from deads2k/cotnroller-08-rs-controller
Automatic merge from submit-queue

convert replica set controller to shared informer

Switches the replicaset to a shared informer.

@kargakis fyi
2016-10-18 07:20:37 -07:00
Seth Jennings da3683e2b7 kubelet: storage: don't hang kubelet on unresponsive nfs 2016-10-18 08:45:40 -05:00
Kubernetes Submit Queue 6e2f5f8f6d Merge pull request #28742 from jessfraz/test-go1.7rc1
Automatic merge from submit-queue

Update to go 1.7

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

Closes #33070
Closes #32999

```release-note
Updated Go to 1.7
```


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

This is to test go version 1.7
2016-10-18 05:59:04 -07:00
deads2k b471398f1f convert replica set controller to shared informer 2016-10-18 08:13:37 -04:00
Kubernetes Submit Queue c19569f03f Merge pull request #34502 from fabianofranz/cli_usability_improvements
Automatic merge from submit-queue

Improvements to CLI usability and maintainability

Improves `kubectl` from an usability perspective by

1. Fixing how we handle terminal width in help. Some sections like the flags use the entire available width, while others like long descriptions breaks lines but don't follow a well established max width (screenshot below). This PR adds a new responsive writer that will adjust to terminal width and set 80, 100, or 120 columns as the max width, but not more than that given POSIX best practices and recommendations for better readability.
![terminal_width](https://cloud.githubusercontent.com/assets/158611/19253184/b23a983e-8f1f-11e6-9bae-667dd5981485.png)
2. Adds our own normalizers for long descriptions and cmd examples which allows us better control about how things like lists, paragraphs, line breaks, etc are printed. Features markdown support. Looks like `templates.LongDesc` and `templates.Examples` instead of `dedent.Dedend`.
3. Allows simple reordering and reuse of help and usage sections.
3. Adds `verify-cli-conventions.sh` which intends to run tests to make sure cmd developers are using what we propose as [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md). Just a couple simple tests for now but the framework is there and it's easy to extend.
4. Update [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md) to use our own normalizers instead of `dedent.Dedent`.

**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
Improves how 'kubectl' uses the terminal size when printing help and usage.
```

@kubernetes/kubectl
2016-10-17 23:41:23 -07:00
Kubernetes Submit Queue f98c06b1bb Merge pull request #33901 from jmcarp/issue-31984
Automatic merge from submit-queue

Escape special characters in jsonpath field names.

There may be a better way to do this, but this seemed like the simplest possible version.

Example: `{.items[*].metadata.labels.kubernetes\.io/hostname}`

[Resolves #31984]
2016-10-17 18:29:31 -07:00
Fabiano Franz 6d6aeb0027 Add responsive writers which adjust to terminal sizes 2016-10-17 11:31:34 -02:00
Kubernetes Submit Queue 88d6d7a677 Merge pull request #34807 from luxas/kubeadm_reset
Automatic merge from submit-queue

Implement kubeadm reset

@kubernetes/sig-cluster-lifecycle
2016-10-15 06:10:36 -07:00
Kubernetes Submit Queue c526657a2a Merge pull request #32434 from smarterclayton/diff_improvements
Automatic merge from submit-queue

ObjectReflectDiff needs a few more checks for nil
2016-10-15 03:33:08 -07:00
Lucas Käldström ecdaa7195a Implement kubeadm reset 2016-10-15 11:58:06 +03:00
Jędrzej Nowak 7a7c36261e fixed absense to absence 2016-10-14 16:28:46 +02:00
Kubernetes Submit Queue 9adbbf2324 Merge pull request #34587 from resouer/stringflag
Automatic merge from submit-queue

Merge string flag into util flag

Continuing my work on https://github.com/kubernetes/kubernetes/issues/15634

This refactoring is expected to be completely finished and then I will add a verify scripts in `hack`
2016-10-14 04:22:11 -07:00
Joshua Carp b48deebc7a Run gofmt. 2016-10-14 00:35:44 -04:00
Jess Frazelle db33b491cc
update generated protobuf
Signed-off-by: Jess Frazelle <acidburn@google.com>
2016-10-13 21:22:59 -07:00
Jess Frazelle 20db0ad0ab
fix unit test for TLS and linted packages
Signed-off-by: Jess Frazelle <acidburn@google.com>
2016-10-13 21:19:18 -07:00
Devan Goodwin 4231c046dd Fix errors and improve output in kubeadm pre-flight checks.
Add skip-preflight-checks to known flags.
Fix bug with preflight checks not returning system is-active as errors.
Fix error handling to use correct function.
2016-10-13 11:10:19 -03:00
Derek McQuay 16b159c12b kubeadm implement preflight checks
Includes checks for verifying services exist and are enabled, ports are
open, directories do not exist or are empty, and required binaries are
in the path.

Checks that user running kubeamd init and join is root and will only execute
command if user is root. Moved away from using kubectl error handling to
having kubeadm handle its own errors. This should allow kubeadm to have
more meaningful errors, exit codes, and logging for specific kubeadm use
cases.
2016-10-13 10:09:36 -03:00
mbohlool 5ba06cf2bc Make Kubernetes OpenAPI operation IDs unique 2016-10-12 14:54:12 -07:00
mbohlool 221a620a14 Move Trie to util package 2016-10-12 12:57:50 -07:00
Harry Zhang eb81ef6023 Merge string flag into util flag 2016-10-11 23:28:59 -04:00
Kubernetes Submit Queue 538915c037 Merge pull request #34297 from AdoHe/fix_yaml_decoder
Automatic merge from submit-queue

fix yaml decode issue

fix #33588

@janetkuo @smarterclayton ptal.
2016-10-09 17:46:03 -07:00
AdoHe 919bb01b04 fix yaml decode issue 2016-10-07 11:22:44 +08:00
Kubernetes Submit Queue 808ed6bfd0 Merge pull request #34139 from liggitt/fix-jitter-until
Automatic merge from submit-queue

Fix wait.JitterUntil

https://github.com/kubernetes/kubernetes/pull/29743 changed a util method to cause process exits if a handler function panics.

Utility methods should not make process exit decisions. If a process (like the controller manager) wants to exit on panic, appending a panic handler or setting `ReallyCrash = true` is the right way to do that (discussed [here](https://github.com/kubernetes/kubernetes/pull/29743#r75509074)).

This restores the documented behavior of wait.JitterUntil
2016-10-06 13:40:08 -07:00
Kubernetes Submit Queue 42e5f95a6b Merge pull request #34024 from deads2k/controller-06-deployment-controller
Automatic merge from submit-queue

update deployment and replicaset listers

Updates the deployment lister to avoid copies and updates the deployment controller to use shared informers.

Pushing WIP to see which tests are broken.
2016-10-06 00:02:34 -07:00
Kubernetes Submit Queue 45e5719c2c Merge pull request #33792 from caesarxuchao/decouple-workqueue-prometheus
Automatic merge from submit-queue

decouple workqueue metrics from prometheus

<!--  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**:
We want to include the workqueue in client-go, but do not want to having to import Prometheus. This PR decouples the workqueue from prometheus.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Partially address https://github.com/kubernetes/kubernetes/issues/33497
User requested for `workqueue` in client-go: https://github.com/kubernetes/client-go/issues/4#issuecomment-249444848

**Special notes for your reviewer**:

**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
The implicit registration of Prometheus metrics for workqueue has been removed, and a plug-able interface was added. If you were using workqueue in your own binaries and want these metrics, add the following to your imports in the main package: "k8s.io/pkg/util/workqueue/prometheus".
```
2016-10-05 22:10:11 -07:00
Jordan Liggitt 3b5c3c286c
Fix wait.JitterUntil 2016-10-05 16:29:06 -04:00
deads2k c30b2efc46 update replicaset lister 2016-10-05 15:20:27 -04:00
Joshua Carp 6787b67152 Factor advance logic into helper function.
h/t @brendandburns
2016-10-03 22:43:22 -04:00
Chao Xu feb0d1daa8 decouple workqueue metrics from prometheus 2016-10-03 11:02:06 -07:00
Joshua Carp be3f556b77 Escape special characters in jsonpath field names.
Example: `{.items[*].metadata.labels.kubernetes\.io/hostname}`

[Resolves #31984]
2016-10-02 23:54:13 -04:00
Kubernetes Submit Queue 347d448180 Merge pull request #33831 from rustyrobot/print-cert-info
Automatic merge from submit-queue

Kubeadm: print information about certificates

Prints basic information about certificates to the user.

Example of `kubeadm init` output:
```
<master/pki> generated Certificate Authority key and certificate:
Issuer: CN=kubernetes | Subject: CN=kubernetes | CA: true
Not before: 2016-09-30 11:19:19 +0000 UTC Not After: 2026-09-28 11:19:19 +0000 UTC
Public: /etc/kubernetes/pki/ca-pub.pem
Private: /etc/kubernetes/pki/ca-key.pem
Cert: /etc/kubernetes/pki/ca.pem
<master/pki> generated API Server key and certificate:
Issuer: CN=kubernetes | Subject: CN=kube-apiserver | CA: false
Not before: 2016-09-30 11:19:19 +0000 UTC Not After: 2017-09-30 11:19:19 +0000 UTC
Alternate Names: [172.18.76.239 10.0.0.1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local]
Public: /etc/kubernetes/pki/apiserver-pub.pem
Private: /etc/kubernetes/pki/apiserver-key.pem
Cert: /etc/kubernetes/pki/apiserver.pem
<master/pki> generated Service Account Signing keys:
Public: /etc/kubernetes/pki/sa-pub.pem
Private: /etc/kubernetes/pki/sa-key.pem
```

Example of `kubeadm join` command:
```
<node/csr> received signed certificate from the API server:
Issuer: CN=kubernetes | Subject: CN=system:node:minion | CA: false
Not before: 2016-09-30 11:28:00 +0000 UTC Not After: 2017-09-30 11:28:00 +0000 UTC
```

Fixes #33642
cc @kubernetes/sig-cluster-lifecycle
2016-10-01 11:31:25 -07:00
Evgeny L 12f8c979ba kubeadm: user-friendly certificates formatting 2016-10-01 04:57:30 +00:00
bprashanth 06cbb36a1f Proxier unittests 2016-09-29 17:35:43 -07:00
Clayton Coleman e2df0d81d9
ObjectReflectDiff needs a few more checks for nil
Catches even more diffs correctly
2016-09-29 16:26:49 -04:00
Doug Davis 9d5bac6330 Change minion to node
Contination of #1111

I tried to keep this PR down to just a simple search-n-replace to keep
things simple.  I may have gone too far in some spots but its easy to
roll those back if needed.

I avoided renaming `contrib/mesos/pkg/minion` because there's already
a `contrib/mesos/pkg/node` dir and fixing that will require a bit of work
due to a circular import chain that pops up. So I'm saving that for a
follow-on PR.

I rolled back some of this from a previous commit because it just got
to big/messy. Will follow up with additional PRs

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-09-28 10:53:30 -07:00
Kubernetes Submit Queue c1e8c6d878 Merge pull request #32559 from guangxuli/k8s_lock
Automatic merge from submit-queue

the lockfile should be handled after function return
2016-09-28 01:46:56 -07:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Kubernetes Submit Queue 4d9581345e Merge pull request #32449 from smarterclayton/defend_get
Automatic merge from submit-queue

Unwrap aggregates of size 1 when writing errors

Our special error logic was being defeated by aggregates.

Also, only use aggregate in get when we actually are dealing with
multiple errors.

@kubernetes/kubectl

For other kubectl reviewers - no one should use an aggregate unless you are ranging over a list, and even then ask yourself whether you really care about returning all errors.
2016-09-27 03:09:00 -07:00
Kubernetes Submit Queue e02b73ff67 Merge pull request #33464 from liggitt/terminating-namespace-check
Automatic merge from submit-queue

Fix cache expiration check

The check for whether an entry in the `forceLiveLookup` cache had expired was backwards. Fixed the logic and added tests
2016-09-26 21:51:34 -07:00
Clayton Coleman 9bfa63dbba
Unwrap aggregates of size 1 when writing errors
Also, only use aggregate in get when we actually are dealing with
multiple errors.
2016-09-26 15:56:38 -04:00
Timothy St. Clair d5e3832bc0 Revert "Revert "Follow on for 1.4 to default HTTP2 on by default""
This reverts commit 8cb799c789.
2016-09-26 10:09:26 -05:00
Jordan Liggitt 6cb0db2651
Allow testing LRUExpireCache with fake clock 2016-09-26 10:16:08 -04:00
Kubernetes Submit Queue 7144f54d78 Merge pull request #32390 from liggitt/ecdhe
Automatic merge from submit-queue

Remove duplicated ECDHE key handling

This PR removes the duplicated ECDHE private key handling. `x509.CreateCertificateRequest` picks the signature type for ECDHE keys already (see https://golang.org/src/crypto/x509/x509.go `signingParamsForPublicKey`). Only the RSA key signature needed customization.

It also defers to `CreateCertificateRequest` to return errors on unknown private key types.
2016-09-23 01:53:20 -07:00
Daniel Smith db3e549bd1 more usages of go2idl 2016-09-22 13:42:46 -07:00
Jordan Liggitt ec200a9edf
Remove duplicated ECDHE key handling 2016-09-22 14:52:10 -04:00
Kubernetes Submit Queue a8053c7c59 Merge pull request #33238 from mbohlool/openapi
Automatic merge from submit-queue

Move openapi common code to genericapiserver/openapi/common

a follow up to #32622

Reference: #13414
2016-09-22 10:20:48 -07:00
Kubernetes Submit Queue 5af04d1dd1 Merge pull request #32876 from errordeveloper/more-cert-utils
Automatic merge from submit-queue

Refactor cert utils into one pkg, add funcs from bootkube for kubeadm to use

**What this PR does / why we need it**:

We have ended-up with rather incomplete and fragmented collection of utils for handling certificates. It may be worse to consider using `cfssl` for doing all of these things, but for now there is some functionality that we need in `kubeadm` that we can borrow from bootkube. It makes sense to move the utils from bookube into core, as discussed in #31221.

**Special notes for your reviewer**: I've taken the opportunity to review names of existing funcs and tried to make some improvements in that area (with help from @peterbourgon).

**Release note**:

```release-note
NONE
```
2016-09-22 01:29:46 -07:00
Kubernetes Submit Queue fee69eedbf Merge pull request #33141 from liggitt/tls-config-mutation
Automatic merge from submit-queue

don't mutate original master->kubelet TLS config

fixes https://github.com/kubernetes/kubernetes/issues/33140

```release-note
Resolves x509 verification issue with masters dialing nodes when started with --kubelet-certificate-authority
```
2016-09-21 19:22:46 -07:00
mbohlool c25ecc43ab Move openapi common code to genericapiserver/openapi/common 2016-09-21 17:01:54 -07:00
Jordan Liggitt f3c80048f6
don't mutate original client TLS config 2016-09-21 00:57:20 -04:00
Michail Kargakis 59da5385e0 controller: enhance timeout error message for Recreate deployments 2016-09-20 15:53:24 +02:00
Ilya Dmitrichenko 386fae4592
Refactor utils that deal with certs
- merge `pkg/util/{crypto,certificates}`
- add funcs from `github.com/kubernetes-incubator/bootkube/pkg/tlsutil`
- ensure naming of funcs is fairly consistent
2016-09-19 09:03:42 +01:00
Vish Kannan a1fe3adbc7 Revert "Revert "[kubelet] Fix oom-score-adj policy in kubelet"" 2016-09-16 16:32:58 -07:00
Vish Kannan 492ca3bc9c Revert "[kubelet] Fix oom-score-adj policy in kubelet" 2016-09-15 19:28:59 -07:00
guangxuli 05d0c720f1 the lockfile should be handled after function return 2016-09-15 21:02:55 +08:00
Vishnu kannan e4acad7afb Fix oom-score-adj policy in kubelet.
Docker daemon and kubelet needs to be protected by setting oom-score-adj to -999.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-09-14 11:56:10 -07:00
Kubernetes Submit Queue 804de8a149 Merge pull request #32244 from tksm/fix-cache-race
Automatic merge from submit-queue

LRUExpireCache#Get requires write lock

**What this PR does / why we need it**:

[LRUExpireCache#Get](dbfad789e3/pkg/util/cache/lruexpirecache.go (L48)) requires write lock since [groupcache/lru#Get](a6b377e340/lru/lru.go (L74)) needs to manipulate its list to track recently used item. Currently it uses read lock so it may introduce race condition.

- [test code which introduces race condition with current LRUExpireCache#Get](https://gist.github.com/tksm/17c7a610ed0574c165e6f6edeca351b7#file-lru_race_test-go)

**Which issue this PR fixes** #31081
2016-09-13 14:36:26 -07:00
Kubernetes Submit Queue 6ffd30c2df Merge pull request #31468 from mbohlool/master
Automatic merge from submit-queue

Improvements on OpenAPI spec generation

- Generating models using go2idl library (no reflection anymore)
- Remove dependencies on go-restful/swagger
- Generate one swagger.json file for each web-service
- Bugfix: fixed a bug in trie implementation

Reference: #13414


**Release note**:

```release-note
Generate separate OpenAPI spec for each API GroupVersion on /<Group>/<Version>/swagger.json
```
2016-09-13 01:56:23 -07:00
Kubernetes Submit Queue 630c7532c6 Merge pull request #32274 from ping035627/ping035627-patch-0908
Automatic merge from submit-queue

Change all jsonmerge to strategicpatch

Implement all jsonmerge changed to strategicpatch in edit.go.
2016-09-13 01:15:52 -07:00
mbohlool 8153267ea8 Update generated proto and swagger docs 2016-09-12 18:47:03 -07:00
mbohlool 6ba271b9ae Customize OpenAPI definition types
customize intstr, unversioned.time, and quantity OpenAPI definitions.
2016-09-12 18:47:03 -07:00
deads2k 385831825b update error handling for daemoncontroller 2016-09-12 11:01:46 -04:00
Kubernetes Submit Queue dceb33d120 Merge pull request #32097 from brendandburns/dev
Automatic merge from submit-queue

Don't return an error if a file doesn't exist for IsPathDevice(...)

Fixes https://github.com/kubernetes/kubernetes/issues/30455

@saad-ali @thockin fyi, since linux devices and storage.
2016-09-09 01:37:40 -07:00
Kubernetes Submit Queue 3651765077 Merge pull request #31714 from smarterclayton/sync
Automatic merge from submit-queue

Allow missing keys in jsonpath
2016-09-08 22:22:16 -07:00
PingWang 121f6fb289 change all jsonmerge to strategicpatch
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update preconditions define

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-09-09 08:28:10 +08:00
Takashi Kusumi 0bd475676b LRUExpireCache#Get requires write lock 2016-09-08 00:22:07 +09:00
Clayton Coleman 4189062a03
Feature gate is not stable sorted - docs change each gen 2016-09-06 23:36:24 -04:00
Kubernetes Submit Queue c9fde2ba8a Merge pull request #32082 from gmarek/namespace
Automatic merge from submit-queue

Make ExponentialFailureRateLimiter slightly slower and cap the backof…

Fix #27503

cc @deads2k @derekwaynecarr @ncdc @wojtek-t

For the context of this change see: https://github.com/kubernetes/kubernetes/issues/27503#issuecomment-244741161
2016-09-06 10:34:49 -07:00
Kubernetes Submit Queue 2a7d0df30d Merge pull request #30727 from asalkeld/iptables-caps
Automatic merge from submit-queue

Clean up IPTables caps i.e.: sed -i "s/Iptables/IPTables/g"

Fixes #30651
2016-09-06 09:01:27 -07:00
gmarek 0b8aeaf500 Make ExponentialFailureRateLimiter slightly slower and cap the backoff 2016-09-06 15:53:52 +02:00
Brendan Burns 07c8f9a173 Don't return an error if a file doesn't exist for IsPathDevice(...) 2016-09-05 20:45:22 -07:00
m1093782566 90bf34cafd fix errors.NewAggregate nil pointer panic
Change-Id: I82b376898f9170d237a3bd1a1ac898cc6c636d12
2016-09-02 15:37:42 +08:00
Clayton Coleman bcea2c8a4e
Allow missing keys in jsonpath
It is common in constrained circumstances to prefer an empty string
result from JSONPath templates for missing keys over an error. Several
other implementations provide this (the canonical JS and PHP, as well as
the Java implementation).  This also mirrors gotemplate, which allows
Options("missingkey=zero").

Added simple check and simple test case.
2016-08-30 13:06:26 -04:00
Tim St. Clair 68e0f01043
AppArmor was flipped to beta, update feature gate 2016-08-29 10:22:05 -07:00
Angus Salkeld f785f3d3ef Clean up IPTables caps i.e.: sed -i "s/Iptables/IPTables/g" 2016-08-29 10:34:42 +10:00
Kubernetes Submit Queue cefc4c3027 Merge pull request #31473 from timstclair/aa-gate
Automatic merge from submit-queue

Add AppArmor feature gate

Add option to disable AppArmor via a feature gate. This PR treats AppArmor as Beta, and thus depends on https://github.com/kubernetes/kubernetes/pull/31471 (I will remove `do-not-merge` once that merges).

Note that disabling AppArmor means that pods with AppArmor annotations will be rejected in validation. It does not mean that the components act as though AppArmor was never implemented. This is by design, because we want to make it difficult to accidentally run a Pod with an AppArmor annotation without AppArmor protection.

/cc @dchen1107
2016-08-26 21:04:42 -07:00
Kubernetes Submit Queue eeac23282d Merge pull request #31446 from liggitt/log-streaming
Automatic merge from submit-queue

Fix hang/websocket timeout when streaming container log with no content

When streaming and following a container log, no response headers are sent from the kubelet `containerLogs` endpoint until the first byte of content is written to the log. This propagates back to the API server, which also will not send response headers until it gets response headers from the kubelet. That includes upgrade headers, which means a websocket connection upgrade is not performed and can time out.

To recreate, create a busybox pod that runs `/bin/sh -c 'sleep 30 && echo foo && sleep 10'`

As soon as the pod starts, query the kubelet API:
```
curl -N -k -v 'https://<node>:10250/containerLogs/<ns>/<pod>/<container>?follow=true&limitBytes=100'
```

or the master API:
```
curl -N -k -v 'http://<master>:8080/api/v1/<ns>/pods/<pod>/log?follow=true&limitBytes=100'
```

In both cases, notice that the response headers are not sent until the first byte of log content is available.

This PR:
* does a 0-byte write prior to handing off to the container runtime stream copy. That commits the response header, even if the subsequent copy blocks waiting for the first byte of content from the log.
* fixes a bug with the "ping" frame sent to websocket streams, which was not respecting the requested protocol (it was sending a binary frame to a websocket that requested a base64 text protocol)
* fixes a bug in the limitwriter, which was not propagating 0-length writes, even before the writer's limit was reached
2016-08-26 06:09:43 -07:00
Kubernetes Submit Queue d3ecad111e Merge pull request #28717 from freehan/ebtable
Automatic merge from submit-queue

Filter duplicate network packets in promiscuous bridge mode (with ebtables)

also fixes: #30783
2016-08-25 19:12:09 -07:00
Tim St. Clair 9bde6f0770
Add AppArmor feature gate 2016-08-25 17:40:18 -07:00
Kubernetes Submit Queue 75fba4c953 Merge pull request #31445 from pmorie/goroutinemap-godoc
Automatic merge from submit-queue

Improve godoc for goroutinemap

Improves the godoc of goroutinemap; found while preparing to use this type in another PR.

@saad-ali
2016-08-25 14:07:08 -07:00
Jordan Liggitt ebd44347a5
Make limitWriter respect 0-byte writes until limit is reached 2016-08-25 14:27:17 -04:00
Paul Morie 1294267450 Improve godoc for goroutinemap 2016-08-25 14:25:05 -04:00
Jordan Liggitt 8b1a00b6d9
Send ping frame using specified encoding
If base-64 encoding was requested, send the ping frame as a 0-length text frame, rather than as a 0-length binary frame.
2016-08-25 14:24:59 -04:00
Kubernetes Submit Queue c63cd8fc20 Merge pull request #31396 from foxish/integer-overflow
Automatic merge from submit-queue

Fixed integer overflow bug in rate limiter.

```release-note
Fix overflow issue in controller-manager rate limiter
```

This PR fixes a bug in the delayed work-queue used by some controllers.
The integer overflow bug would previously cause hotlooping behavior after a few failures 
as `time.Duration(..)` on values larger than MaxInt64 behaves unpredictably, and 
after a certain value returns 0 always.

cc @bprashanth @pwittrock
2016-08-25 11:17:38 -07:00
Anirudh 00e41888b0 Fixed integer overflow bug in rate limiter. 2016-08-24 18:55:28 -07:00
Jeff Lowdermilk fe643590ba Update/fix feature-gate comments 2016-08-24 13:04:25 -07:00
Jeff Lowdermilk 991b07e60d Add a feature gate for alpha dynamic volume provisioning
Enabled by default to avoid breaking people, since this was
turned on in 1.3.
2016-08-24 13:02:42 -07:00
Kubernetes Submit Queue 448a133e97 Merge pull request #31352 from mtaufen/revert-revert-30090-with-fix
Automatic merge from submit-queue

Revert revert 30090 with fix

This reverts #31297 (which originally reverted #30090) and applies a fix to stop the fd leak that was exposed by #30090.
2016-08-24 11:37:59 -07:00
Minhan Xia 87ab70d6ef add ebtables util 2016-08-24 10:17:41 -07:00
Kubernetes Submit Queue 94666b4a4e Merge pull request #31112 from wojtek-t/set_unsorted_list
Automatic merge from submit-queue

Avoid sorting lists when unnecessary

I've seen ThreadSafeMap::List consuming ~30% of whole CPU usage, spending the whole time in sorting (while it is in fact completely unneded).
2016-08-24 10:11:36 -07:00
Michael Taufen 2e989a3c38 Revert "Merge pull request #31297 from mikedanese/revert-kubelet"
This reverts the revert of #30090 and #31282.
2016-08-24 09:06:12 -07:00
Kubernetes Submit Queue 189a870ec8 Merge pull request #30376 from justinsb/kubenet_mtu
Automatic merge from submit-queue

Add kubelet --network-plugin-mtu flag for MTU selection

* Add network-plugin-mtu option which lets us pass down a MTU to a network provider (currently processed by kubenet)
* Add a test, and thus make sysctl testable
2016-08-23 21:54:50 -07:00
Girish Kalele b82c028f77 GCE Cloud provider changes for ESIPP
Add feature gate (ExternalTrafficLocalOnly) for alpha feature
2016-08-23 16:16:39 -07:00
Mike Danese 0a735b7886 Revert "Merge pull request #30090 from mtaufen/dynamic-kubelet-restart"
This reverts commit fe808ec2a4, reversing
changes made to f297ea966e.
2016-08-23 14:11:48 -07:00
Kubernetes Submit Queue fe808ec2a4 Merge pull request #30090 from mtaufen/dynamic-kubelet-restart
Automatic merge from submit-queue

[Kubelet] Optionally consume configuration from <node-name> named config maps

This extends the Kubelet to check the API server for new node-specific config, and exit when it finds said new config.

/cc @kubernetes/sig-node @mikedanese @timstclair @vishh

**Release note**:
```
Extends Kubelet with Alpha Dynamic Kubelet Configuration. Please note that this alpha feature does not currently work with cloud provider auto-detection.
```
2016-08-23 09:25:22 -07:00
Kubernetes Submit Queue ec5b204573 Merge pull request #28816 from xiangpengzhao/add_test_comment
Automatic merge from submit-queue

Unset https_proxy before roundtripper_test

When running `hack/test-go.sh`, if the testing env is behind a https proxy, roundtripper_test will fail randomly.

After `unset https_proxy`, the testing works well. So, add a comment to be a troubleshooting tip.

Fail info:

```
--- FAIL: TestRoundTripAndNewConnection (0.12s)
	roundtripper_test.go:319: proxied http->http: shouldError=false, got true: Get http://127.0.0.1:46711: unexpected EOF
FAIL
FAIL	k8s.io/kubernetes/pkg/util/httpstream/spdy	0.148s
```

```
--- FAIL: TestRoundTripAndNewConnection (0.12s)
	roundtripper_test.go:319: proxied https with auth (valid hostname + RootCAs) -> http: shouldError=false, got true: Get http://127.0.0.1:41028: unexpected EOF
FAIL
FAIL	k8s.io/kubernetes/pkg/util/httpstream/spdy	0.146s
```
2016-08-23 00:19:37 -07:00
Michael Taufen 35a63d956b Implement Alpha Dynamic Kubelet Configuration
See Issue #27980 and Proposal PR #29459
2016-08-22 22:42:51 -07:00
Justin Santa Barbara 2c103af2b6 Create testable implementation of sysctl
This is so we can test kubenet Init, which calls sysctl
2016-08-23 01:42:37 -04:00
Kubernetes Submit Queue 25ce84b34e Merge pull request #31140 from thockin/feature-gate-fixes
Automatic merge from submit-queue

Make 'allAlpha' a special feature gate

Rather than making all caller check both allAlpha and their own flag, make `allAlpha` set all of the alpha gates explicitly.

This is hard to test because of the globalness.  I will follow this commit with a new one to add some way to test, but I wanted to float this design
2016-08-22 21:06:29 -07:00
Tim Hockin 34bd1e391e Don't panic if the feature-gate flag was not used 2016-08-22 17:41:25 -07:00
Kubernetes Submit Queue 54ca389012 Merge pull request #30802 from MHBauer/ensure-mounter
Automatic merge from submit-queue

ensure pkg/util/mount compiles & crosses

<!--  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**:
osx doesn't build
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #30795

**Special notes for your reviewer**:

**Release note**:
```release-note-none
```

 - move compile time check from linux code to generic code
 - remove duplication of #30724 and #30666 to resolve #30795
2016-08-22 17:40:16 -07:00
Tim Hockin f77576bc2b Capitalize feature gates
Also rename variables for clarity
2016-08-22 13:57:35 -07:00
Tim Hockin 6c75bd8be5 Make 'allAlpha' a special feature gate
Rather than making all caller check both allAlpha and their own flag, make
allAlpha set the alpha gates explicitly, iff they were not already set.
2016-08-22 13:57:35 -07:00
Wojciech Tyczynski 3cfd3c236c Support UnsortedList() in auto-generated sets. 2016-08-22 15:05:37 +02:00
Morgan Bauer 92a043e833
ensure pkg/util/mount compiles & crosses
- move compile time check from linux code to generic code
2016-08-21 17:47:24 -07:00
Jordan Liggitt 6483f55733
Close websocket stream when client closes 2016-08-21 13:38:47 -04:00
Kubernetes Submit Queue a41e6e3817 Merge pull request #30922 from yifan-gu/tls_bootstrap_refactor
Automatic merge from submit-queue

Implement TLS bootstrap for kubelet using `--experimental-bootstrap-kubeconfig`  (2nd take)

Ref kubernetes/features#43 (comment)

cc @gtank @philips @mikedanese @aaronlevy @liggitt @deads2k @errordeveloper @justinsb 


Continue on the older PR https://github.com/kubernetes/kubernetes/pull/30094 as there are too many comments on that one and it's not loadable now.
2016-08-21 03:47:07 -07:00
bindata-mockuser e792d4117d Add return code support to kubectl-exec and -run 2016-08-20 15:58:47 +02:00
bindata-mockuser 6dcb0c9130 Rectify kubectl error output 2016-08-20 15:58:10 +02:00
bindata-mockuser ce7f003f57 Add protocol versions to pkg/util/wsstream 2016-08-20 15:58:10 +02:00
Kubernetes Submit Queue 010c976ce8 Merge pull request #30468 from jlowdermilk/feature-config
Automatic merge from submit-queue

Feature gates for kube-system components

Implements [this proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/runtimeconfig.md). Adds `--feature-gates` to apiserver, scheduler, controller-manager and proxy.

cc @lavalamp @adityakali
2016-08-19 18:15:19 -07:00
Jordan Liggitt 26a6623261 kubelet: '--experimental-bootstrap-kubeconfig' refactor.
Move bootstrap functions to separate files.
Split some of the functions into small sub-functions for reusability.
Other cleanups
2016-08-19 15:27:23 -07:00
Kubernetes Submit Queue 96cbed4b5f Merge pull request #30887 from johscheuer/fix-osx-kublet
Automatic merge from submit-queue

Fixes #30886

This PR fixes https://github.com/kubernetes/kubernetes/issues/30886

```
make WHAT=pkg/kubelet
+++ [0818 17:03:21] Generating bindata:
    /Users/jscheuermann/inovex/workspace/kubernetes-clone/test/e2e/framework/gobindata_util.go
+++ [0818 17:03:22] Building the toolchain targets:
    k8s.io/kubernetes/hack/cmd/teststale
+++ [0818 17:03:22] Building go targets for darwin/amd64:
    pkg/kubelet

```
2016-08-19 14:34:36 -07:00
Yifan Gu 2e631d811c crypto.go: Rename ShouldGenSelfSignedCerts() to FoundCertOrKey().
Since the function only tests whether the files are on the disk,
the original name is a little bit misleading.
2016-08-19 13:51:34 -07:00
Yifan Gu 26babd4eba kubelet: Add --bootstrap-kubeconfig to get TLS client cert.
Add --bootstrap-kubeconfig flag to kubelet. If the flag is non-empty
and --kubeconfig doesn't exist, then the kubelet will use the bootstrap
kubeconfig to create rest client and generate certificate signing request
to request a client cert from API server.

Once succeeds, the result cert will be written down to
--cert-dir/kubelet-client.crt, and the kubeconfig will be populated with
certfile, keyfile path pointing to the result certificate file, key file.
(The key file is generated before creating the CSR).
2016-08-19 13:51:33 -07:00
Jeff Lowdermilk 51198f59da Add --feature-gates to kube-system components
apiserver,scheduler,controller-manager,proxy,kubelet all get
flag. Using one variable to plumb through config via salt/init
scripts for GCE and GKE
2016-08-19 09:07:43 -07:00
Tamer Tas fe039573b7 pkg/util/mount: remove method redeclaration
Fix the `GetDeviceNameFromMount` method thats declared twice.
2016-08-19 16:49:28 +03:00
Chao Xu 65d1dbe8d9 fix memory leak in gc 2016-08-18 21:54:44 -07:00
George Tankersley 5801fa5f4d util/certificates: Add CSR utility function. 2016-08-18 11:25:21 -07:00
Johannes Scheuermann 5eef6b8d91 Fixes #30886 2016-08-18 17:01:03 +02:00
Kubernetes Submit Queue dc588e4451 Merge pull request #30257 from timstclair/aa-psp-annotations
Automatic merge from submit-queue

Add annotations to the PodSecurityPolicy Provider interface

@pweil- is this what you were thinking in terms of API changes? I really like to avoid functions with more than 2 return values, but couldn't think of a cleaner approach in this case.
2016-08-18 07:12:45 -07:00
Kubernetes Submit Queue f0db50a7da Merge pull request #30723 from yujuhong/procfs_fix
Automatic merge from submit-queue

Fix building pkg/util/procfs on non-linux platforms

This partially fixes https://github.com/kubernetes/test-infra/issues/393

/cc @ixdy @krousey @dims
2016-08-17 20:50:01 -07:00
Yu-Ju Hong a2824bb7a3 Fix building pkg/util/procfs on non-linux platforms 2016-08-17 11:57:44 -07:00
Kubernetes Submit Queue 2bc5414de6 Merge pull request #30666 from feiskyer/fix-mount
Automatic merge from submit-queue

Fix pkg/util/mount for osx

Fix #30665.
2016-08-17 11:37:53 -07:00
Tim St. Clair d4ea444277
Add utility package for dealing with common map types 2016-08-17 10:14:33 -07:00
Andy Goldstein 8b171081d1 Add newline to printf to fix junit 2016-08-17 10:40:27 -04:00
Kubernetes Submit Queue 7b49d0c19d Merge pull request #23265 from AdoHe/big_yaml
Automatic merge from submit-queue

use Reader.ReadLine instead of bufio.Scanner to support bigger yaml

@smarterclayton ptal. Also refer #19603 #23125 for more details.
2016-08-17 02:26:46 -07:00
Kubernetes Submit Queue 90f3a95700 Merge pull request #30724 from jingxu97/reconcile-8-16
Automatic merge from submit-queue

Add GetDeviceNameFromMount in mount_unsupported.go
2016-08-17 01:35:05 -07:00
Jing Xu 89de4f2f55 Add GetDeviceNameFromMount in mount_unsupported.go
Add GetDeviceNameFromMount in mount_unsupported.go
2016-08-16 16:34:10 -07:00
Kubernetes Submit Queue 096dd4df50 Merge pull request #26510 from AdoHe/patch_test
Automatic merge from submit-queue

update strategic patch test for merge list of maps

Refer #26418 for more details. @janetkuo the test case is added, ptal.
2016-08-15 20:38:22 -07:00
Pengfei Ni 12d7c4f380 Fix mount for osx 2016-08-16 08:26:15 +08:00
Kubernetes Submit Queue 79ed7064ca Merge pull request #27970 from jingxu97/restartKubelet-6-22
Automatic merge from submit-queue

Add volume reconstruct/cleanup logic in kubelet volume manager

Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.

Fixes https://github.com/kubernetes/kubernetes/issues/27653
2016-08-15 13:48:43 -07:00
Kubernetes Submit Queue 69419a145a Merge pull request #29802 from jfrazelle/fix-go-vet-errors
Automatic merge from submit-queue

fix go vet errors

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
```

This fixes the `go vet` errors brought about by go 1.7 testing re (#28742).

The are all pretty trivial and mostly related to literal composites.

also related to #16086
2016-08-15 13:10:08 -07:00
Jing Xu f19a1148db This change supports robust kubelet volume cleanup
Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.
2016-08-15 11:29:15 -07:00
AdoHe 2d06408300 use Reader.ReadLine instead of bufio.Scanner to support bigger yaml 2016-08-14 16:02:43 +08:00
Kubernetes Submit Queue 96655d7578 Merge pull request #30087 from dims/remove-pkill-dependency
Automatic merge from submit-queue

Remove kubelet pkill dependency

Issue #26093 identified pkill as one of the dependencies of kublet
which could be worked around.  Build on the code introduced for pidof
and regexp for the process(es) we need to send a signal to.

Related to #26093
2016-08-12 18:38:38 -07:00
Davanum Srinivas 24e8e12b04 Fix TestPidOf {procfs} - Take #2
We should not bailout when we get an error. We should continue
processing other files/directories. We were returning the
err passed in which was causing the processing to stop.

Fixes #30377
2016-08-11 17:36:04 -04:00
Kubernetes Submit Queue 342aac2ffd Merge pull request #30402 from dims/fix-issue-30377
Automatic merge from submit-queue

Fix intermittent failures in TestPidOf {procfs}

Bailout if WalkFunc is called with an error.

Fixes #30377

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30402)
<!-- Reviewable:end -->
2016-08-11 06:47:45 -07:00
Kubernetes Submit Queue 035ec518af Merge pull request #28387 from caesarxuchao/gc-latency-measure
Automatic merge from submit-queue

[GarbageCollector] measure latency

First commit is #27600.

In e2e tests, I measure the average time an item spend in the eventQueue(~1.5 ms), dirtyQueue(~13ms), and orphanQueue(~37ms). There is no stress test in e2e yet, so the number may not be useful.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/28387)
<!-- Reviewable:end -->
2016-08-11 02:33:55 -07:00
Jess Frazelle 7e9d82129e
fix go vet errors
Signed-off-by: Jess Frazelle <jessfraz@google.com>

fix composites

Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-10 16:45:41 -07:00
Davanum Srinivas e1ad642da0 Fix intermittent failures in TestPidOf {procfs}
Bailout if WalkFunc is called with an error.

Fixes #30377
2016-08-10 17:23:58 -04:00
Davanum Srinivas ce93cb9d9c Remove kubelet dependency on pkill
Issue #26093 identified pkill as one of the dependencies of kublet
which could be worked around.  Build on the code introduced for pidof
and regexp for the process(es) we need to send a signal to.

Related to #26093
2016-08-10 17:14:49 -04:00
Chao Xu 41572cb22d add metrics to gc 2016-08-10 12:45:06 -07:00
Kubernetes Submit Queue a40d2cd92e Merge pull request #30296 from deads2k/wq-metrics
Automatic merge from submit-queue

add metrics for workqueues

Adds prometheus metrics to work queues and enables them for the resourcequota controller.  It would be easy to add this to all other workqueue based controllers and gather basic responsiveness metrics.

@kubernetes/rh-cluster-infra helps debug quota controller responsiveness problems.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30296)
<!-- Reviewable:end -->
2016-08-10 11:13:13 -07:00
deads2k b981ea1a70 add metrics for workqueues 2016-08-10 09:28:42 -04:00
Kubernetes Submit Queue 70d6d165d5 Merge pull request #30002 from dims/remove-pidof-dependency
Automatic merge from submit-queue

Remove kubelet dependency on pidof

Issue #26093 identified pidof as one of the dependencies of kublet
which could be worked around. In this PR, we just look at /proc
to construct the list of pids we need for a specified process
instead of running "pidof" executable

Related to #26093

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30002)
<!-- Reviewable:end -->
2016-08-09 23:32:51 -07:00
Kubernetes Submit Queue f53a35fb76 Merge pull request #29147 from caesarxuchao/cut-client-repo-staging
Automatic merge from submit-queue

Cut the client repo, staging it in the main repo

Tracking issue: #28559
ref: https://github.com/kubernetes/kubernetes/pull/25978#issuecomment-232710174

This PR implements the plan a few of us came up with last week for cutting client into its own repo:
1. creating "_staging" (name is tentative) directory in the main repo, using a script to copy the client and its dependencies to this directory
2. periodically publishing the contents of this staging client to k8s.io/client-go repo
3. converting k8s components in the main repo to use the staged client. They should import the staged client as if the client were vendored. (i.e., the import line should be `import "k8s.io/client-go/<pacakge name>`). This requirement is to ease step 4.
4. In the future, removing the staging area, and vendoring the real client-go repo.

The advantage of having the staging area is that we can continuously run integration/e2e tests with the latest client repo and the latest main repo, without waiting for the client repo to be vendored back into the main repo. This staging area will exist until our test matrix is vendoring both the client and the server.

In the above plan, the tricky part is step 3. This PR achieves it by creating a symlink under ./vendor, pointing to the staging area, so packages in the main repo can refer to the client repo as if it's vendored. To prevent the godep tool from messing up the staging area, we export the staged client to GOPATH in hack/godep-save.sh so godep will think the client packages are local and won't attempt to manage ./vendor/k8s.io/client-go.

This is a POC. We'll rearrange the directory layout of the client before merge.

@thockin @lavalamp @bgrant0607 @kubernetes/sig-api-machinery

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29147)
<!-- Reviewable:end -->
2016-08-09 17:12:14 -07:00
Davanum Srinivas 1fdcea28e5 Remove kubelet dependency on pidof
Issue #26093 identified pidof as one of the dependencies of kublet
which could be worked around. In this PR, we just look at /proc
to construct the list of pids we need for a specified process
instead of running "pidof" executable

Related to #26093
2016-08-09 19:55:24 -04:00
Timothy St. Clair 24993b0343 Update generated files due to dependency shift.
Also minor bug fix in federation api.
2016-08-09 10:41:09 -05:00
Tamer Tas 81fb8e1e11 pkg/util/exec: don't specify paths for echo
`ex.Command()` already searches the binary in PATH, no need to manually
specify it. `pkg/util/exec` tests fail in non-conventional environments
due to this (e.g. NixOS).
2016-08-08 16:17:25 +03:00
Chao Xu a771578a1c move pkg/util/ files to their own package to reduce client-go dependencies 2016-08-05 23:32:02 -07:00
Kubernetes Submit Queue 2537f66f0e Merge pull request #29230 from luxas/goimport
Automatic merge from submit-queue

Run goimport for the whole repo

While removing GOMAXPROC and running goimports, I noticed quite a lot of other files also needed a goimport format. Didn't commit `*.generated.go`, `*.deepcopy.go` or files in `vendor`

This is more for testing if it builds.
The only strange thing here is the gopkg.in/gcfg.v1 => github.com/scalingdata/gcfg replace.
cc @jfrazelle @thockin
2016-08-05 16:22:01 -07:00
Kubernetes Submit Queue b1f8ba9ddf Merge pull request #30014 from dims/remove-uname-dependency
Automatic merge from submit-queue

Remove kubelet dependency on uname

Let's avoid exec'ing stuff we don't have to.

Related to #26093
2016-08-04 21:22:25 -07:00
Kubernetes Submit Queue d10e47b891 Merge pull request #29928 from dubstack/bump-libcontainer
Automatic merge from submit-queue

Bump Libcontainer to latest head

@Random-Liu or @yujuhong Can any one of you please do a quick review.

I updated libcontainer in a previous PR but  #29492 reverted those changes. This is needed for #27204. 

Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-08-04 15:12:13 -07:00
Kubernetes Submit Queue 0410c33995 Merge pull request #29204 from aledbf/ingress-wildcard-hosts
Automatic merge from submit-queue

Allow leading * in ingress hostname

fixes #29043
2016-08-04 14:38:24 -07:00
Buddha Prakash 49201f6923 Update Libcontainer's Cgroup Config: AllowAllDevices to be Nil 2016-08-04 10:05:30 -07:00
Kubernetes Submit Queue 92518a8a32 Merge pull request #30036 from caesarxuchao/README-to-doc
Automatic merge from submit-queue

convert README.md to doc.go

It seems the convention is to use a doc.go, not a README.md.

I needed to work around this README.md when in #29147, see https://github.com/kubernetes/kubernetes/pull/29147#discussion-diff-73239124R73.
2016-08-03 23:28:55 -07:00
Manuel de Brito Fontes 60f4fbf4f2 Allow leading * in ingress hostname 2016-08-03 20:16:58 -04:00
Chao Xu 4c7514be13 convert README.md to doc.go 2016-08-03 16:38:29 -07:00
bindata-mockuser 832363442d Remove kubelet dependency on uname 2016-08-03 17:46:02 -04:00
Kubernetes Submit Queue 67c7401fd8 Merge pull request #26688 from asalkeld/more-unittests-util-env
Automatic merge from submit-queue

Increase the unit test coverage in pkg/util

These are easy to test, so lets increase coverage.
2016-08-03 13:43:28 -07:00
Kubernetes Submit Queue 24216fe02f Merge pull request #26958 from resouer/util-line
Automatic merge from submit-queue

Refactoring runner resource container linedelimiter to it's own pkg

Continuing my work ref #15634

Anyone is ok to review this fix.
2016-08-03 02:26:12 -07:00
Kubernetes Submit Queue 1edf254efb Merge pull request #25458 from errm/env-var-style-config-keys
Automatic merge from submit-queue

Allow Secret & ConfigMap keys to contain caps, dots, and underscores

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

Re: #23722

This makes loosens the regex used in in Secrets and ConfigMap,
in order to make environment variable style keys valid
2016-08-02 21:00:52 -07:00
k8s-merge-robot 7a62b9c8d1 Merge pull request #29523 from fraenkel/service_names_rfc1035
Automatic merge from submit-queue

Allow service names up to 63 characters (RFC 1035)

fixes #3752
2016-08-02 10:33:16 -07:00
k8s-merge-robot 68632db799 Merge pull request #27562 from 7ing/ipt
Automatic merge from submit-queue

improve iptables-restore implementation #27559

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
fixes #27559
- improve restoreInternal implementation in iptables
- add SetStdin and SetStdout functions to Cmd interface
- modify kubelet/prober and some tests in order to work with Cmd interface
2016-08-02 08:02:32 -07:00