Commit Graph

61081 Commits (230726ffbe0e01b68a4fad9ecbfade11ee2844f9)

Author SHA1 Message Date
Filipe Brandenburger 2f2d886734 Fix cross-build breakage after #58174 2018-01-31 09:46:36 -08:00
Kubernetes Submit Queue aa12b9b7cb
Merge pull request #58849 from cblecker/staging-speed
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Only run verify-staging-godeps if staging/godeps are touched

**What this PR does / why we need it**:
I had a lightbulb moment. On presubmit, we only verify godeps if one of the following is changed:
- The godep scripts
- The Godeps/ dir
- The vendor/ dir

The same should apply to verifying the staging godeps, adding in the staging dir itself. The logic being, if we don't touch Godeps/vendor, we don't touch the script that generates stuff, and we don't make changes to the staging dir itself (like adding/removing imports), then we don't need to verify godeps.

Note that post-submit CI jobs will still check these, as I'm copying the same logic that's in verify-godeps

This seems too easy, so *please* point out if I'm missing something.

**Release note**:
```release-note
NONE
```
2018-01-31 09:33:45 -08:00
Shyam Jeedigunta 9ddaeae2c6 Disable JUnit-style reporting for benchmark script 2018-01-31 18:33:21 +01:00
Mike Wilson 33dac2d0f3 Adding lower() to kubernetes master's usage of allow-privileged. 2018-01-31 12:20:37 -05:00
Davanum Srinivas a40e167f39 remove alpha when running cloud-controller-manager with hyperkube 2018-01-31 11:53:57 -05:00
Mike Wilson ec0bedbf43 Fixing issue with capitalization causing odd behaviors for allow-privileged configuration option. 2018-01-31 10:26:23 -05:00
Kubernetes Submit Queue 4ce4bdc82c
Merge pull request #59061 from nikhita/crds-is-a-thing
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add crds as CustomResourceDefinition shortname

See https://github.com/kubernetes/apiextensions-apiserver/issues/6#issuecomment-361539766.
Fixes kubernetes/apiextensions-apiserver#6

Before:

```
➜  kubectl get crds
the server doesn't have a resource type "crds"
```

After:

```
➜  kubectl get crds
No resources found.
```


**Release note**:

```release-note
 `crds` is added as a shortname for CustomResourceDefinition i.e. `kubectl get crds` can now be used.
```

/cc sttts deads2k soltysh pwittrock
2018-01-31 05:48:41 -08:00
Wojciech Tyczynski 617321e420 Expose etcd compaction time via environmental variable in GCE 2018-01-31 14:44:01 +01:00
hzxuzhonghu 2742d1e42d refactor kube-aggregator api group install 2018-01-31 21:38:47 +08:00
Kubernetes Submit Queue 65c0d55bba
Merge pull request #59073 from caesarxuchao/fix-client-ca-hook
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Let client ca post start hook use GET to check if the system namespace exists

This is a direct fix for #56761.

The original code tried to create a namespace unconditionally, it caused apiserver to fail to reboot if a webhook blocked namespaces creation.

In the long term, we should make the apiserver return 409 instead of 5xx in the case of conflicting POST, even if a webhook fails the POST.
2018-01-31 04:50:40 -08:00
NickrenREN 4b6a3439a3 Add policy for pv protection controller 2018-01-31 20:19:09 +08:00
NickrenREN 3fee293607 Add PV protection controller 2018-01-31 20:18:54 +08:00
Kubernetes Submit Queue a241087f99
Merge pull request #57457 from vfreex/fix-port-forward-ipv6
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

client-go: Fix broken TCP6 listen for port forwarding

**What this PR does / why we need it**:
The IPV6 loopback address `::1` is enclosed in square brackets twice,
which cause a failure to listen on the TCP6 port.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix an issue where port forwarding doesn't forward local TCP6 ports to the pod
```
/area ipv6
/sig cli
2018-01-31 04:06:46 -08:00
NickrenREN b99580ba3f existing PV controller changes 2018-01-31 20:02:01 +08:00
NickrenREN cbfa0cc85a reuse PVC protection admission plugin for PV protection 2018-01-31 20:02:01 +08:00
NickrenREN 2a2f88b939 Rename PVCProtection feature gate so that PV protection can share the feature gate with PVC protection 2018-01-31 20:02:01 +08:00
Kubernetes Submit Queue 8f71d6d840
Merge pull request #58598 from WanLinghao/rbac_improve
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add a comment on specical  case on authorization  

In file /staging/src/k8s.io/apiserver/pkg/endpoints/filters/authorization.go, 
function WithAuthorization() returns DecisionAllow before error check.
It is intentional to avoid leaking authorization errors to attackers.
This patch add a comment here to give a hint



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-31 03:23:16 -08:00
NickrenREN d7ffadd6b3 Change feature gate PreRelease to Beta 2018-01-31 18:46:20 +08:00
NickrenREN 7b9d2c046f Use v1beta1 VolumeAttachment 2018-01-31 18:46:11 +08:00
NickrenREN 8915e275c0 update all 2018-01-31 18:45:49 +08:00
Kubernetes Submit Queue 9719607849
Merge pull request #59104 from nikhita/sample-controller-apps-v1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

sample-controller: document minimum kubernetes version

In https://github.com/kubernetes/kubernetes/pull/58446, the sample-controller started using `apps/v1` deployments since they became GA in 1.9.

This means that sample-controller does not support versions below 1.9.

Fixes kubernetes/sample-controller#9

**Release note**:

```release-note
NONE
```

/assign sttts munnerz
2018-01-31 02:39:25 -08:00
Kubernetes Submit Queue f404c15453
Merge pull request #59048 from cblecker/godep-fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix installation and use of vendored godep

**What this PR does / why we need it**:
Fixes the installation of the vendored godep to ensure that the binary ends up in the path when it's done.

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

**Special notes for your reviewer**:
It looks like this broke in https://github.com/kubernetes/kubernetes/pull/51766, but didn't matter because our pinned version was the same as the latest version (so we didn't notice). This fixes it in my local env -- hopefully it will in CI too.

**Release note**:
```release-note
NONE
```
2018-01-31 02:39:10 -08:00
pospispa 52a43b19d8 PVC Protection E2E Tests for Failed Scheduling
The PR [2] introduced a change into a scheduler that causes that scheduling of pods that use PVC that is being deleted fail.

That's why E2E test for the PR [2] is added. This E2E test also addresses the review comment [1].

[1] https://github.com/kubernetes/kubernetes/pull/56931#pullrequestreview-82564849
[2] https://github.com/kubernetes/kubernetes/pull/55957
2018-01-31 10:49:11 +01:00
Nikhita Raghunath 1fd07e1978 sample-controller: document minimum kube version
The sample-controller uses apps/v1 deployments
since they became GA in 1.9. This means that
sample-controller does not support versions below 1.9.
2018-01-31 15:16:41 +05:30
NickrenREN d45a41807e Add Beta VolumeAttachment API 2018-01-31 17:38:11 +08:00
Kubernetes Submit Queue f3942e7ded
Merge pull request #58817 from karlhungus/bugfix_yaml_decoder_short_buf
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add test/fix for ErrShortBuffer edgecase

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

Found a bug with YAMLToJSONDecoder where subsequent reads after `io.ErrShortBuffer` would return values from the next yaml section, rather than the rest of the section I was reading.

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

https://github.com/kubernetes/kubernetes/issues/59055

**Special notes for your reviewer**:

**Release note**:

```release-note
YAMLDecoder Read now tracks rest of buffer on io.ErrShortBuffer
```
2018-01-31 00:18:03 -08:00
Dong Liu 68f03d4e78 Add call to addCredentialProviderFlags 2018-01-31 16:10:46 +08:00
Chris Glass 5a6de4d22a Do not use ifupdown commands
The ifupdown commands (ifup and ifdown) are not useful on many modern
distributions. Instead, the "ip link set" set of commands are standard
linux utilities and should be available everywhere (see
http://baturin.org/docs/iproute2/).

ipupdown utilities have the added quirk that they return 0 on failure,
which makes the changed line fail silently in case ifdown didn't bring
the network down.

After the interface was brought back up, renew DHCP requests to ensure
the network is actually useable.

Signed-off-by: Chris Glass <chris.glass@canonical.com>
2018-01-31 08:33:43 +01:00
Kubernetes Submit Queue 494664a736
Merge pull request #59086 from feiskyer/typo
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix typo and comments

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

Fix typo across the azure package.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-30 22:51:42 -08:00
Tim Zhang 8154689a27
fix the format for github error 2018-01-31 14:49:29 +08:00
WanLinghao 983435bdce modified: staging/src/k8s.io/apiserver/pkg/endpoints/filters/authorization.go 2018-01-31 14:21:42 +08:00
Kubernetes Submit Queue b3115df40b
Merge pull request #58799 from lichuqiang/cleanup
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unused func in FakeConfigurator of scheduler

**What this PR does / why we need it**:
Current scheduler `Configurator` interface looks like this:
```
type Configurator interface {
	GetPriorityFunctionConfigs(priorityKeys sets.String) ([]algorithm.PriorityConfig, error)
	GetPriorityMetadataProducer() (algorithm.PriorityMetadataProducer, error)
	GetPredicateMetadataProducer() (algorithm.PredicateMetadataProducer, error)
	GetPredicates(predicateKeys sets.String) (map[string]algorithm.FitPredicate, error)
	GetHardPodAffinitySymmetricWeight() int32
	GetSchedulerName() string
	MakeDefaultErrorFunc(backoff *util.PodBackoff, podQueue core.SchedulingQueue) func(pod *v1.Pod, err error)

	// Needs to be exposed for things like integration tests where we want to make fake nodes.
	GetNodeLister() corelisters.NodeLister
	GetClient() clientset.Interface
	GetScheduledPodLister() corelisters.PodLister

	Create() (*Config, error)
	CreateFromProvider(providerName string) (*Config, error)
	CreateFromConfig(policy schedulerapi.Policy) (*Config, error)
	CreateFromKeys(predicateKeys, priorityKeys sets.String, extenders []algorithm.SchedulerExtender) (*Config, error)
}
```
Funcs `ResponsibleForPod` and  `Run` once existed have been removed, so the funcs in `FakeConfigurator` should be removed accordingly.

**Special notes for your reviewer**:
/kind cleanup
/sig scheduling

**Release note**:

```release-note
NONE
```
2018-01-30 22:08:45 -08:00
Kubernetes Submit Queue c817765b0e
Merge pull request #58445 from hanxiaoshuai/typo
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix some typos in comments

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

Fixes # fix some typos in comments
2018-01-30 19:44:44 -08:00
Pengfei Ni 6e453d7d31 Fix typo and comments 2018-01-31 10:55:41 +08:00
Kubernetes Submit Queue 7595560a0c
Merge pull request #59077 from rramkumar1/ingress-upgrade-test-patch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixes ci-ingress-gce-upgrade-e2e

**What this PR does / why we need it**:
This PR fixes the broken ci-ingress-gce-upgrade-e2e job. The issue was that the ingress was being deleted by the test framework before the upgraded ingress could properly sync. Therefore, the resources were never cleaned up, which caused test failure. 

```release-note
None
```

cc @MrHohn 
/assign @bowei
2018-01-30 18:45:51 -08:00
Pengfei Ni 7682e27245 Ensure IP is set for Azure internal loadbalancer 2018-01-31 10:27:27 +08:00
hzxuzhonghu b9308355a6 fix some typos in filters 2018-01-31 09:37:02 +08:00
Kubernetes Submit Queue 84408378f9
Merge pull request #58174 from filbranden/ipcs1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixes for HostIPC tests to work when Docker has SELinux support enabled.

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

Fixes for HostIPC tests to work when Docker has SELinux support enabled.

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

N/A

**Special notes for your reviewer**:

The core of the matter is to use `ipcs` from util-linux rather than the one from busybox. The typical SELinux policy has enough to allow Docker containers (running under svirt_lxc_net_t SELinux type) to access IPC information by reading the contents of the files under /proc/sysvipc/, but not by using the shmctl etc. syscalls.

The `ipcs` implementation in busybox will use `shmctl(0, SHM_INFO, ...)` to detect whether it can read IPC info (see source code [here](https://git.busybox.net/busybox/tree/util-linux/ipcs.c?h=1_28_0#n138)), while the one in util-linux will prefer to read from the /proc files directly if they are available (see source code [here](https://github.com/karelzak/util-linux/blob/v2.27.1/sys-utils/ipcutils.c#L108)).

It turns out the SELinux policy doesn't allow the shmctl syscalls in an unprivileged container, while access to it through the /proc interface is fine. (One could argue this is a bug in the SELinux policy, but getting it fixed on stable OSs is hard, and it's not that hard for us to test it with an util-linux `ipcs`, so I propose we do so.)

This PR also contains a refactor of the code setting IpcMode, since setting it in the "common options" function is misleading, as on containers other than the sandbox, it ends up always getting overwritten, so let's only set it to "host" in the Sandbox.

It also has a minor fix for the `ipcmk` call, since support for size suffix was only introduced in recent versions of it.

**Release note**:

```release-note
NONE
```
2018-01-30 17:18:52 -08:00
Rohit Ramkumar 4976cb9218 Fixes ci-ingress-gce-upgrade-e2e 2018-01-30 16:55:08 -08:00
Chao Xu 83d535aa6c Client ca post start hook now checks if the system namespace already exists
before creating it.

This avoids apiserver crashloops if a webhook rejects namespace
creation when the apiserver is rebooted.
2018-01-30 16:19:33 -08:00
Kubernetes Submit Queue 8b9aa35d4e
Merge pull request #59070 from jaxxstorm/u/jaxxstorm/manifest_perms
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Change manifest file perms to remove execute

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

Currently, the manifests generated by kubeadm have permission 0700. The kubernetes CIS benchmarks state the perms should be 0644 or better, so this change sets the file permissions to 0600, as they are static files, and don't need to be executable.

**Which issue(s) this PR fixes** *: Fixes # https://github.com/kubernetes/kubeadm/issues/678

**Special notes for your reviewer**:
None

**Release note**:
```release-note
NONE
```
2018-01-30 16:06:09 -08:00
jrperritt f8c8ec612b cloudprovider/openstack: fix bug the tries to use octavia client to query flip 2018-01-30 18:05:04 -06:00
Kubernetes Submit Queue a18f086220
Merge pull request #59020 from brendandburns/kubelet-hang
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove setInitError.

**What this PR does / why we need it**:
Removes setInitError, it's not sure it was ever really used, and it causes the kubelet to hang and get wedged.

**Which issue(s) this PR fixes** 
Fixes #46086

**Special notes for your reviewer**:
If `initializeModules()` in `kubelet.go` encounters an error, it calls `runtimeState.setInitError(...)`

47d61ef472/pkg/kubelet/kubelet.go (L1339)

The trouble with this is that `initError` is never cleared, which means that `runtimeState.runtimeErrors()` always returns this `initError`, and thus pods never start sync-ing.

In normal operation, this is expected and desired because eventually the runtime is expected to become healthy, but in this case, `initError` is never updated, and so the system just gets wedged.

47d61ef472/pkg/kubelet/kubelet.go (L1751)

We could add some retry to `initializeModules()` but that seems unnecessary, as eventually we'd want to just die anyway. Instead, just log fatal and die, a supervisor will restart us.

Note, I'm happy to add some retry here too, if that makes reviewers happier.

**Release note**:
```release-note
Prevent kubelet from getting wedged if initialization of modules returns an error.
```

@feiskyer @dchen1107 @janetkuo 

@kubernetes/sig-node-bugs
2018-01-30 14:56:28 -08:00
Lee Briggs ff607743a3
Change manifest file perms to remove execute 2018-01-30 14:28:26 -08:00
Kubernetes Submit Queue 7fe25af6b1
Merge pull request #59005 from hyperbolic2346/mwilson/node-name-fix
Automatic merge from submit-queue (batch tested with PRs 59053, 59005). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Forcing get_node_name to continue searching for a node name.

There was a race condition where the kubelet was restarting and we were querying the api server for this node. In that case, we may get a valid list of nodes that doesn't include our node. This would cause the code to just raise an exception. Now we wait the full timeout before raising the exception.



**What this PR does / why we need it**:
Fixes a race condition on the get_node_name function inside the kubernetes-worker charm.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixed a race condition inside kubernetes-worker that would result in a temporary error situation.
```
2018-01-30 13:57:29 -08:00
Kubernetes Submit Queue 2517345595
Merge pull request #59053 from DirectXMan12/bug/e2e-deferred-disco-reset
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Reset DeferredDiscoveryRESTMapper before use

DeferredDiscoveryRESTMapper won't automatically `Reset` itself before its
initial use, since actually trying to construct the delegate will error
out before it gets a chance to `Reset` itself.  Ergo, we have to
manually call `Reset` before use.

Fixes #59043 

```release-note
NONE
```
2018-01-30 13:27:54 -08:00
Bobby (Babak) Salamat 74706546e9 Autogenerated files 2018-01-30 13:13:57 -08:00
Bobby (Babak) Salamat 384a86caa9 Add NominatedNodeName to PodStatus 2018-01-30 13:13:57 -08:00
Kubernetes Submit Queue c244994af7
Merge pull request #58997 from Random-Liu/eviction-manager-use-cri
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make eviction manager work with CRI container runtime.

Previously, eviction manager uses a function `HasDedicatedImageFs` in `pkg/kubelet/cadvisor` to detect whether image fs and root fs are on the same device.

However, it doesn't work with CRI container runtime which provides container/image stats through CRI. Thus all eviction tests for containerd are failing now. https://k8s-testgrid.appspot.com/sig-node-containerd#node-e2e-flaky

This PR makes it work with CRI container runtime.

@kubernetes/sig-node-pr-reviews 
@yujuhong @yguo0905 @feiskyer @mrunalp @abhi @dashpole 
Signed-off-by: Lantao Liu <lantaol@google.com>



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```
2018-01-30 12:43:30 -08:00
Mike Wilson 17f8f18f6f Fixing upgrade charm failing if upgrading from an old enough charm(pre Nov 2017). 2018-01-30 14:52:57 -05:00