Commit Graph

16865 Commits (58b631fe77f8a85bb021b780085d9acf8aba836c)

Author SHA1 Message Date
Kubernetes Submit Queue 28d273c8b2 Merge pull request #36810 from gmarek/secrets
Automatic merge from submit-queue

Add ServiceAccounts to kubemark

cc @yujuhong
2016-11-16 06:01:30 -08:00
Kubernetes Submit Queue 193622b31f Merge pull request #36728 from feiskyer/sysctls-docs
Automatic merge from submit-queue

CRI: add docs for sysctls

#34830 adds `sysctls` features in CRI, it is based on sandbox annotations, this PR adds docs for it. 

@yujuhong @timstclair @jonboulle
2016-11-16 02:58:42 -08:00
Kubernetes Submit Queue f4a7b64bf1 Merge pull request #36542 from Random-Liu/clarify-cri-user
Automatic merge from submit-queue

CRI: Clarify User in CRI.

Addressed https://github.com/kubernetes/kubernetes/pull/36423#issuecomment-259343135.

This PR clarifies the user related fields in CRI.

One question is that:
What is the meaning of the `run_as_user` field in `LinuxSandboxSecurityContext`?
* **Is it user on the host?** Then it doesn't make sense, user shouldn't care about what users are on the host.
* **Is it user inside the infra container image?** This is how the field is currently used. However, Infra container is docker specific, I'm not sure whether we should expose this in CRI.
* **Is it the default user inside the pod?** It tells runtime that if there is a container (infra container, or some other helper containers like streaming container etc.), if their `user` is not specified, use the default "sandbox user". Then how can we guarantee that infra or helper container image have the `user`?
* **It doesn't make sense?** If we remove it, we are relying on the shim to set right user (maybe always root) for infra or helper containers (if there will be any in the future), I'm not sure whether this is what we expect.

@yujuhong @feiskyer @jonboulle @yifan-gu 
/cc @kubernetes/sig-node
2016-11-16 01:45:37 -08:00
Kubernetes Submit Queue fac05d9c81 Merge pull request #36174 from JacobTanenbaum/v2resource_fixes
Automatic merge from submit-queue

V2resource fixes

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

The original PR associated with these fixes where reverted due to causing a flake in hack/make-rules/test-cmd.sh, I gave the 'kubectl set resources' tests there own deployment and set the terminationGracePeriodSeconds to 0 and have run test-cmd.sh for hours without hitting the flake
2016-11-15 21:03:06 -08:00
Random-Liu 2ce5deb6fd Add separate username field in CRI and use it. 2016-11-15 16:50:02 -08:00
Random-Liu c79b8afe5b Clarify user fields in CRI 2016-11-15 16:50:02 -08:00
Kubernetes Submit Queue 0bd5bd60ac Merge pull request #36812 from jakub-d/master
Automatic merge from submit-queue

Change ScheduledJob POD name suffix from hash to Unix Epoch

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

There is a bug in a ScheduledJob POD suffix hash function (#34447). If you generate more than ~20 PODs you will start having collisions. Here is the code which proves that:
```
package main

import "fmt"
import "time"
import "hash/adler32"
import hashutil "k8s.io/kubernetes/pkg/util/hash"

func main() {
        start_time, _ := time.Parse("2006-Jan-02", "2016-Nov-14")
        var hits map[uint32]int = make(map[uint32]int)
        fmt.Println("| Date | Epoch | Hash | Hits |")
        fmt.Println("| --------------- | ---------- | --- | ---- |")
        for i:=0; i<30; i++ {
                dt:=start_time.Add(time.Duration(i*5)*time.Minute)
                hdt:=getTimeHash(dt)
                _, ok := hits[hdt]
                if ! ok {
                        hits[hdt]=0
                }
                hits[hdt]++
                fmt.Printf("| %s | %d | %d | %d  |\n",dt.Format(time.Stamp), dt.Unix(), hdt, hits[hdt])
        }
}

func getTimeHash(tm time.Time) uint32 {
        timeHasher := adler32.New()
        hashutil.DeepHashObject(timeHasher, tm)
        return timeHasher.Sum32()
}
```

The ouptut is:

| Date | Epoch | Hash | Hits |
| --------------- | ---------- | --- | ---- |
| Nov 14 00:00:00 | 1479081600 | 4175643772 | 1  |
| Nov 14 00:05:00 | 1479081900 | **4209853567** | 1  |
| Nov 14 00:10:00 | 1479082200 | **4141499513** | 1  |
| Nov 14 00:15:00 | 1479082500 | 4175709308 | 1  |
| Nov 14 00:20:00 | 1479082800 | 4209919103 | 1  |
| Nov 14 00:25:00 | 1479083100 | 4244128898 | 1  |
| Nov 14 00:30:00 | 1479083400 | 4072621171 | 1  |
| Nov 14 00:35:00 | 1479083700 | 4106830966 | 1  |
| Nov 14 00:40:00 | 1479084000 | 4141040761 | 1  |
| Nov 14 00:45:00 | 1479084300 | 4072686707 | 1  |
| Nov 14 00:50:00 | 1479084600 | 4106896502 | 1  |
| Nov 14 00:55:00 | 1479084900 | 4141106297 | 1  |
| Nov 14 01:00:00 | 1479085200 | 4072752243 | 1  |
| Nov 14 01:05:00 | 1479085500 | 4106962038 | 1  |
| Nov 14 01:10:00 | 1479085800 | 4141171833 | 1  |
| Nov 14 01:15:00 | 1479086100 | 4175381628 | 1  |
| Nov 14 01:20:00 | 1479086400 | 4107027574 | 1  |
| Nov 14 01:25:00 | 1479086700 | 4141237369 | 1  |
| Nov 14 01:30:00 | 1479087000 | 4175447164 | 1  |
| Nov 14 01:35:00 | 1479087300 | 4107093110 | 1  |
| Nov 14 01:40:00 | 1479087600 | 4141302905 | 1  |
| Nov 14 01:45:00 | 1479087900 | 4175512700 | 1  |
| Nov 14 01:50:00 | 1479088200 | 4107158646 | 1  |
| Nov 14 01:55:00 | 1479088500 | 4141368441 | 1  |
| Nov 14 02:00:00 | 1479088800 | 4175578236 | 1  |
| Nov 14 02:05:00 | 1479089100 | 4209788031 | 1  |
| Nov 14 02:10:00 | 1479089400 | 4141433977 | 1  |
| Nov 14 02:15:00 | 1479089700 | 4175643772 | 2  |
| Nov 14 02:20:00 | 1479090000 | **4209853567** | 2  |
| Nov 14 02:25:00 | 1479090300 | **4141499513** | 2  |

This PR is a proposal to abandon hashes and use Unix Epoch times instead.
Cons:
* It's easy to sort PODs this way
* The length of the Epoch time stamp is the same as the length of the current hash
* As it's epoch - we won't have collisions

**Which issue this PR fixes**
fixes #34447
2016-11-15 16:08:55 -08:00
Kubernetes Submit Queue 98c68947ee Merge pull request #36549 from cjcullen/closetunnel
Automatic merge from submit-queue

Close tunnels after failed healthchecks.

When we fail an ssh-tunnel healthcheck, we currently leak a file descriptor keeping the SSH connection open.

This closes the underlying tunnel before removing our pointer to it. It is possible that the tunnel was functional, but the healthcheck failed for some other reason (e.g. kubelet healthz down), which could close an in-use tunnel, but I think that is acceptable.
2016-11-15 10:42:53 -08:00
Kubernetes Submit Queue 2110f72e4c Merge pull request #36800 from mdshuai/update-cgroups-per-qos
Automatic merge from submit-queue

[kubelet]update some --cgroups-per-qos to --experimental-cgroups-per-qos

Follow https://github.com/kubernetes/kubernetes/pull/36767, there are some fields still need update in docs or hack/local-up-cluster.sh
2016-11-15 08:54:29 -08:00
Dlugolecki, Jakub d1896a695f Change ScheduledJob POD name suffix from hash to Unix Epoch 2016-11-15 17:25:32 +01:00
gmarek 7439a956ef Add ServiceAccounts to Kubemark 2016-11-15 16:03:48 +01:00
Kubernetes Submit Queue 2bd8bb2699 Merge pull request #34873 from k82cn/k8s_34633
Automatic merge from submit-queue

Set non-zero exit code on failures for kubectl

fixes #34633 

/cc @AdoHe
2016-11-15 03:40:53 -08:00
Kubernetes Submit Queue b2cd67c31f Merge pull request #36756 from gmarek/contention
Automatic merge from submit-queue

Add a flag allowing contention profiling of the API server

Useful for performance debugging.

cc @smarterclayton @timothysc @lavalamp

```release-note
Add a flag allowing contention profiling of the API server
```
2016-11-15 03:04:27 -08:00
mdshuai 2189acdd4f [kubelet]update --cgroups-per-qos to --experimental-cgroups-per-qos 2016-11-15 15:55:47 +08:00
Kubernetes Submit Queue 79fc0a95a0 Merge pull request #35543 from philips/improve-version
Automatic merge from submit-queue

kubectl: add less verbose version

The kubectl version output is very complex and makes it hard for users
and vendors to give actionable information. For example during the
recent Kubernetes 1.4.3 TLS security scramble I had to write a one-liner
for users to get out the version number to give to figure out if they
are vulnerable:

```
$ kubectl version | grep -i Server | sed  -n 's%.*GitVersion:"\([^"]*\).*%\1%p'
```

Instead this patch outputs simply output by default

```
./kubectl version
Client Version: v1.4.3
Server Version: v1.4.3
```

Adding the `--verbose` flag will output the old format.
2016-11-14 22:39:21 -08:00
Kubernetes Submit Queue 3245e8b355 Merge pull request #36767 from vishh/rename-cgroups-flags
Automatic merge from submit-queue

[kubelet] rename --cgroups-per-qos to --experimental-cgroups-per-qos

This reflects the true nature of "cgroups per qos" feature.

```release-note
 * Rename `--cgroups-per-qos` to `--experimental-cgroups-per-qos` in Kubelet
```
2016-11-14 17:35:19 -08:00
Kubernetes Submit Queue 9be1191aba Merge pull request #36686 from rkouj/check-gluster-fs-binaries
Automatic merge from submit-queue

Implement CanMount() for gfsMounter for linux

**What this PR does / why we need it**:
To implement CanMount() check for glusterfs. If mount binaries are not present on the underlying node, the mount will not proceed and return an error message stating so.

Related to issue : https://github.com/kubernetes/kubernetes/issues/36098


Related to similar change for NFS : 
https://github.com/kubernetes/kubernetes/pull/36280

**Release note**:
`Check binaries for GlusterFS on the underlying node before doing mount`





Sample output from testing in GCE/GCI:

rkouj@rkouj0:~/go/src/k8s.io/kubernetes$ kubectl describe pods
Name:		glusterfs
Namespace:	default
Node:		e2e-test-rkouj-minion-group-kjq3/10.240.0.3
Start Time:	Fri, 11 Nov 2016 17:22:04 -0800
Labels:		<none>
Status:		Pending
IP:		
Controllers:	<none>
Containers:
  glusterfs:
    Container ID:	
    Image:		gcr.io/google_containers/busybox
    Image ID:		
    Port:		
    QoS Tier:
      cpu:	Burstable
      memory:	BestEffort
    Requests:
      cpu:		100m
    State:		Waiting
      Reason:		ContainerCreating
    Ready:		False
    Restart Count:	0
    Environment Variables:
Conditions:
  Type		Status
  Initialized 	True 
  Ready 	False 
  PodScheduled 	True 
Volumes:
  glusterfs:
    Type:		Glusterfs (a Glusterfs mount on the host that shares a pod's lifetime)
    EndpointsName:	glusterfs-cluster
    Path:		kube_vol
    ReadOnly:		true
  default-token-2zcao:
    Type:	Secret (a volume populated by a Secret)
    SecretName:	default-token-2zcao
Events:
  FirstSeen	LastSeen	Count	From						SubobjectPath	Type		Reason		Message
  ---------	--------	-----	----						-------------	--------	------		-------
  8s		8s		1	{default-scheduler }						Normal		Scheduled	Successfully assigned glusterfs to e2e-test-rkouj-minion-group-kjq3
  7s		4s		4	{kubelet e2e-test-rkouj-minion-group-kjq3}			Warning		FailedMount	Unable to mount volume kubernetes.io/glusterfs/6bb04587-a876-11e6-a712-42010af00002-glusterfs (spec.Name: glusterfs) on pod glusterfs (UID: 6bb04587-a876-11e6-a712-42010af00002). Verify that your node machine has the required components before attempting to mount this volume type. Required binary /sbin/mount.glusterfs is missing
2016-11-14 15:40:45 -08:00
Kubernetes Submit Queue c5c461df38 Merge pull request #36664 from yujuhong/fix_comments
Automatic merge from submit-queue

dockershim: clean up comments
2016-11-14 14:26:51 -08:00
Vishnu kannan 9066253491 [kubelet] rename --cgroups-per-qos to --experimental-cgroups-per-qos to reflect the true nature of that feature
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-11-14 14:06:39 -08:00
Kubernetes Submit Queue 61a5d23e0f Merge pull request #36603 from fabianofranz/fix_lists_in_convert
Automatic merge from submit-queue

Fix handling lists in kubectl convert

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

When handling multiple objects in `kubectl convert` (for example in `kubectl convert -f .` with multiple files in current directory) the objects must be managed as a list instead of individually, otherwise `-o yaml|json` will generate invalid format (just multiple json/yaml objects concatenated) which can't be fed to `kubectl create` like in `kubectl convert -f . | kubectl create -f -`.


```release-note
NONE
```
2016-11-14 12:21:16 -08:00
rkouj b85ac95143 Implement CanMount() for gfsMounter for linux 2016-11-14 12:18:06 -08:00
Yu-Ju Hong b73dfe02b5 dockershim: clean up comments 2016-11-14 12:03:00 -08:00
Kubernetes Submit Queue c76fe8dcda Merge pull request #31169 from pweil-/userns-experimental
Automatic merge from submit-queue

Default host user namespace via experimental flag

@vishh @ncdc @pmorie @smarterclayton @thockin 

Initial thought on the implementation https://github.com/kubernetes/kubernetes/pull/30684#issuecomment-241523425 wasn't quite right.  Since we need to dereference a PVC in some cases the defaulting code didn't fit nicely in the docker manager code (would've coupled it with a kube client and would've been messy).  I think passing this in via the runtime config turned out cleaner.  PTAL
2016-11-14 11:04:48 -08:00
gmarek c97633b1f5 Add a flag allowing contention profiling of the API server 2016-11-14 17:38:26 +01:00
deads2k baa2418b11 let printer update unstructured list 2016-11-14 10:42:28 -05:00
pweil- d0d78f478c experimental host user ns defaulting 2016-11-14 10:16:03 -05:00
Kubernetes Submit Queue 5c21cc892c Merge pull request #36581 from wojtek-t/fix_service_alloc
Automatic merge from submit-queue

Fix TestServiceAlloc test

Fix #32028
2016-11-14 05:35:00 -08:00
Kubernetes Submit Queue 38cc6df7b3 Merge pull request #36712 from hongchaodeng/e5
Automatic merge from submit-queue

cacher test: fix leftover v2 test server

I think this was dismissed in #30890

@timothysc @wojtek-t
2016-11-14 01:58:18 -08:00
Kubernetes Submit Queue c964641fb3 Merge pull request #36635 from hongchaodeng/e2
Automatic merge from submit-queue

etcd3: remove stale comments in test
2016-11-14 01:15:20 -08:00
Wojciech Tyczynski 03b9be982f Fix TestServiceAlloc test 2016-11-14 10:11:37 +01:00
Kubernetes Submit Queue d5014c3f21 Merge pull request #36696 from brendandburns/azure
Automatic merge from submit-queue

Add support for service load balancer source ranges to Azure load balancers.

@colemickens @kubernetes/sig-network
2016-11-13 21:00:38 -08:00
Pengfei Ni 38955897f7 CRI: add docs for sysctls 2016-11-14 12:19:52 +08:00
Hongchao Deng 32a96b7dc0 pkg/storage: update bazel 2016-11-13 18:34:55 -08:00
Hongchao Deng 1972270f7b cacher test: fix leftover v2 test server 2016-11-13 16:22:24 -08:00
Brendan Burns 610f38cb4a Add support for service address ranges to Azure load balancers. 2016-11-12 20:59:45 -08:00
Hongchao Deng 5da4028aff etcd3: remove stale comments in test 2016-11-12 14:41:47 -08:00
Klaus Ma fec8793b5f Set non-zero exit code on failures for kubectl. 2016-11-12 07:40:54 -05:00
Kubernetes Submit Queue 68a7c2c6b5 Merge pull request #36678 from ymqytw/fix_bug_in_patch
Automatic merge from submit-queue

fix bug when compare version

Fix a small bug when compare version in `patch` which is introduced by my PR #35647 today.

This blocks #36672.

cc: @janetkuo
2016-11-11 23:12:13 -08:00
Kubernetes Submit Queue 76f99d726c Merge pull request #36561 from liggitt/etcd3-watch-zero
Automatic merge from submit-queue

Fix watching from resourceVersion=0 in etcd3 watcher

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

* Makes etcd3 consistent with watch cache behavior (all synthetic events sent for the initial list of items result in ADDED events)
* Fixes errors if previous values of initial items had been compacted away
* Removes fan-out Get() for previous values of initial items

Should be fixed before making etcd3 the default (https://github.com/kubernetes/kubernetes/pull/36229)
2016-11-11 22:33:20 -08:00
Kubernetes Submit Queue b85acd957a Merge pull request #36579 from kargakis/restore-events-for-tests
Automatic merge from submit-queue

Restore event messages for replica sets in the deployment controller

Needed to unblock release upgrade tests (see https://github.com/kubernetes/kubernetes/issues/36453)

@kubernetes/deployment ptal
2016-11-11 15:50:31 -08:00
ymqytw af8fbc327d fix bug when compare version 2016-11-11 15:20:15 -08:00
Kubernetes Submit Queue 3e169be887 Merge pull request #35647 from ymqytw/patch_primitive_list
Automatic merge from submit-queue

Fix strategic patch for list of primitive type with merge sementic

Fix strategic patch for list of primitive type when the patch strategy is `merge`.
Before: we cannot replace or delete an item in a list of primitive, e.g. string, when the patch strategy is `merge`. It will always append new items to the list.
This patch will generate a map to update the list of primitive type.
The server with this patch will accept either a new patch or an old patch.
The client will found out the APIserver version before generate the patch.

Fixes #35163, #32398

cc: @pwittrock @fabianofranz 

``` release-note
Fix strategic patch for list of primitive type when patch strategy is `merge` to remove deleted objects.
```
2016-11-11 14:36:44 -08:00
Kubernetes Submit Queue 2822e4fd78 Merge pull request #36651 from mwielgus/evict-from-b1
Automatic merge from submit-queue

Switch pod eviction client from v1alpha1 to v1beta

Generated client 1.5 has a function to evict a pod. The function uses v1alpha1.Eviction object instead of v1beta1. This pr changes the api version that is being used.

cc: @davidopp @caesarxuchao
2016-11-11 12:22:34 -08:00
Kubernetes Submit Queue 8b37baa926 Merge pull request #36616 from jingxu97/Nov/reconstruct-fix
Automatic merge from submit-queue

fix issue in reconstruct volume data when kubelet restarts

During state reconstruction when kubelet restarts, outerVolueSpecName
cannot be recovered by scanning the disk directories. But this
information is used by volume manager to check whether pod's volume is
mounted or not. There are two possible cases:
1. pod is not deleted during kubelet restarts so that desired state
should have the information. reconciler.updateState() will use this
inforamtion to update.
2. pod is deleted during this period, reconciler has to use
InnerVolumeSpecName, but it should be ok since this information will not
be used for volume cleanup (umount)
2016-11-11 11:38:59 -08:00
Jordan Liggitt 7f61d37996
Fix watching from resourceVersion=0 in etcd3 watcher 2016-11-11 11:35:53 -08:00
Marcin 324368ea98 Switch pod eviction client from v1alpha1 to v1beta. 2016-11-11 19:34:29 +01:00
CJ Cullen 1fdb3ee902 Close tunnels after failed healthchecks. 2016-11-11 09:51:51 -08:00
Kubernetes Submit Queue 868f6e1c5c Merge pull request #36585 from jszczepkowski/hpa-unittest2
Automatic merge from submit-queue

More unittests for HPA.
2016-11-11 09:17:06 -08:00
Kubernetes Submit Queue a0dadf16f9 Merge pull request #36316 from derekwaynecarr/pvc_quota_use_informers
Automatic merge from submit-queue

Improve quota performance for pvc by using shared informer

This avoids a list call for each namespace in the resource quota controller when syncing quota.
2016-11-11 05:34:30 -08:00
Michail Kargakis 9afe2c3a7c Do not emit event for AlreadyExists errors 2016-11-11 10:49:05 +01:00