Commit Graph

51078 Commits (f32b390cf08a9afd9f9899e0d97a90eb162b32a8)

Author SHA1 Message Date
Cao Shufeng f41eb67798 remove extra WriteHeader function
The deleted two functions will be called later in the function
SerializeObject(). Not necessary to call them twice.
2017-07-08 14:07:01 +08:00
Kubernetes Submit Queue 093dd52db2 Merge pull request #48337 from sakeven/fix/validation_test
Automatic merge from submit-queue

scheduler: fix validation test

Signed-off-by: sakeven <jc5930@sina.cn>



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

Without setting `Weight`, `ValidatePolicy` will report
```
Priority for extender http://127.0.0.1:8081/extender should have a positive weight applied to it
```

**Besides**, it seems it's not a good way to test ValidatePolicy by```if ValidatePolicy(extenderPolicy) == nil```, because we can't determine specific reason which causes error.

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-07-07 22:38:28 -07:00
Cao Shufeng bc94370e9c support json output for log backend of advanced audit 2017-07-08 11:25:28 +08:00
Chao Xu 65cedeeb43 update bazel 2017-07-07 19:04:26 -07:00
Chao Xu 016963b955 let scheduler use client-go's client when initilaizer leaderelection 2017-07-07 19:04:26 -07:00
Chao Xu 56de7e702e obvious fix 2017-07-07 19:04:26 -07:00
shiywang 9ac39849b9 add test resource carp and change name 2017-07-08 08:53:35 +08:00
Shiyang Wang da4a875ef8 Move pkg/apimachinery/test to apimachinery 2017-07-08 08:48:38 +08:00
Kubernetes Submit Queue 62ba00e4e7 Merge pull request #47123 from danwinship/networkpolicy-update
Automatic merge from submit-queue

Allow NetworkPolicy.spec updates

ValidateNetworkPolicyUpdate currently prohibits changes to `spec` in an existing NetworkPolicy. We were going to fix this for 1.7 but I forgot to submit this PR after the main PR merged. Too late for 1.7? @thockin @caseydavenport @cmluciano 

This only changes networking.NetworkPolicy validation at the moment... Should I change extensions.NetworkPolicy validation too?

Fixes #35911

We should add a test to the e2e NetworkPolicy test for this too if this is going to merge.

**Release note**:
```release-note
As part of the NetworkPolicy "v1" changes, it is also now
possible to update the spec field of an existing
NetworkPolicy. (Previously you had to delete and recreate a
NetworkPolicy if you wanted to change it.)
```
2017-07-07 17:45:41 -07:00
Chao Xu 24d5279c59 move leaderelection package to client-go 2017-07-07 17:01:04 -07:00
Kubernetes Submit Queue 95a4a5d6eb Merge pull request #48615 from sttts/sttts-sanity-check-godep-save
Automatic merge from submit-queue (batch tested with PRs 48374, 48524, 48519, 42548, 48615)

godep-save.sh: add sanity checks

Might prevent https://github.com/kubernetes/kubernetes/issues/48593.
2017-07-07 14:48:35 -07:00
Kubernetes Submit Queue 89136f64b9 Merge pull request #42548 from andrewrynhard/use_secrets
Automatic merge from submit-queue (batch tested with PRs 48374, 48524, 48519, 42548, 48615)

Use Secrets for files that self-hosted pods depend on

**What this PR does / why we need it**:
See https://github.com/kubernetes/kubeadm/issues/194

**Release note**:

```release-note
NONE
```

```
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf get pods -n kube-system
NAME                                                   READY     STATUS    RESTARTS   AGE
dummy-1628042694-6ghbq                                 1/1       Running   0          42m
kube-dns-1853130399-4nzx4                              3/3       Running   0          9m
kube-flannel-ds-mnq10                                  2/2       Running   2          12m
kube-flannel-ds-n3tl8                                  2/2       Running   0          42m
kube-proxy-lqpcb                                       1/1       Running   0          42m
kube-proxy-pw0pw                                       1/1       Running   0          12m
self-hosted-kube-apiserver-fkkwd                       1/1       Running   1          42m
self-hosted-kube-controller-manager-1387498942-mzg41   1/1       Running   1          42m
self-hosted-kube-scheduler-2588609441-cwhqb            1/1       Running   1          42m
```

### API Server
```
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-apiserver-fkkwd -n kube-system -- ls /etc/pki
ca-trust
java
nssdb
rpm-gpg
tls
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-apiserver-fkkwd -n kube-system -- ls /etc/ssl
certs
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-apiserver-fkkwd -n kube-system -- ls /etc/kubernetes/
pki
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-apiserver-fkkwd -n kube-system -- ls /etc/kubernetes/pki/
apiserver-kubelet-client.crt
apiserver-kubelet-client.key
apiserver.crt
apiserver.key
ca.crt
front-proxy-ca.crt
sa.pub
```

### Scheduler
```
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-scheduler-2588609441-cwhqb -n kube-system -- ls /etc/kubernetes/
scheduler.conf
```

### Controller Manager
```
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-controller-manager-1387498942-mzg41 -n kube-system -- ls /etc/ssl
certs
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-controller-manager-1387498942-mzg41 -n kube-system -- ls /etc/pki
ca-trust
java
nssdb
rpm-gpg
tls
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-controller-manager-1387498942-mzg41 -n kube-system -- ls /etc/kubernetes/
controller-manager.conf
pki
bash-4.2# kubectl --kubeconfig /etc/kubernetes/admin.conf exec self-hosted-kube-controller-manager-1387498942-mzg41 -n kube-system -- ls /etc/kubernetes/pki/
ca.crt
ca.key
sa.key
```

/cc @luxas @liggitt @pires @timothysc
2017-07-07 14:48:33 -07:00
Kubernetes Submit Queue 8df63201d9 Merge pull request #48519 from smarterclayton/kube_deps
Automatic merge from submit-queue (batch tested with PRs 48374, 48524, 48519, 42548, 48615)

Kubelet run() should accept partial KubeletDeps

This is used by integrators that want to perform partial overrides of
key interfaces. Refactors the run() method to fit the existing style and
preserve the existing behavior, but allow (for instance) client
bootstrap and cert refresh even when some dependencies are injected.

@derekwaynecarr hit while reviewing client bootstrap code
2017-07-07 14:48:31 -07:00
Kubernetes Submit Queue f0964b2063 Merge pull request #48524 from freehan/udp-service-flush
Automatic merge from submit-queue (batch tested with PRs 48374, 48524, 48519, 42548, 48615)

flush conntrack for udp service when # of backend changes from 0

fixes: #48370
2017-07-07 14:48:29 -07:00
Kubernetes Submit Queue 4f8d9af1db Merge pull request #48374 from mml/etcd-node-test
Automatic merge from submit-queue (batch tested with PRs 48374, 48524, 48519, 42548, 48615)

Add a node upgrade test for etcd statefulset with a PDB.

Tests for #38336
2017-07-07 14:48:27 -07:00
Clayton Coleman edc12aafe2
Unify generic proxy code in apimachinery
Make the utility package truly generic, consolidate all generic proxy in
apimachinery.
2017-07-07 16:26:29 -04:00
Kubernetes Submit Queue 823f31ec91 Merge pull request #47713 from ravisantoshgudimetla/scheduler_perf_test_fix
Automatic merge from submit-queue

Small fix for number of pods and nodes in test function

**What this PR does / why we need it**:
Small fix to have correct pods and nodes in test function.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:
Scheduler perf, nodes and pods number fix for 100 nodes 3k pods.
**Release note**:

```release-note
NONE
```
2017-07-07 13:04:41 -07:00
Clayton Coleman 2e33a2f0bc
Record 429 and timeout errors to prometheus
Allows gathering of load being shed.
2017-07-07 15:50:49 -04:00
Zihong Zheng a4e359aa12 Make kube-proxy's MetricsBindAddress configurable via flag 2017-07-07 12:46:20 -07:00
Dr. Stefan Schimanski 918721078f godep-save.sh: add sanity checks 2017-07-07 21:16:34 +02:00
Maru Newby d6b2ec2ca8 fed: Remove flakey and redundant replicaset unit test 2017-07-07 10:57:06 -07:00
Dan Williams 8a58f62fe0 proxy/userspace: honor listen IP address as host IP if given
Allows the proxier to be used on an interface that's not the default route,
otherwise hostIP gets set to the default route interface even if that's
not what the user intended.

If listen IP isn't given, falls back to previous behavior.
2017-07-07 11:17:17 -05:00
Mik Vyatskov 01df7090cb Fix Stackdriver Logging e2e soak tests 2017-07-07 15:18:51 +02:00
deads2k 0801ded425 remove dead code 2017-07-07 09:12:29 -04:00
Paul Michali 78ae9a57df IPv6 support for getting IP from default route
This is part 2 of the effort to update ChoseHostInterface() to support IPv6
addresses (as part of issue 44848). This changeset includes:

- Supports finding IPv6 host addresses from default routes (but currently only
  provided with IPv4 default routes).
- getRoutes() filters for default routes.
- getFinalIP() checks that IP is in requested family. Uses IsGlobalUnicast(),
  instead of explicit tests for loopback, multicast, and link-local IPs.
- getIPFromInterace() checks for family requested.
- chooseHostInterfaceFromRoute()
    * Quickly exits, if no default routes.
    * Since only getting default routes, no check here.
    * Searches all default routes for IPv4 addresses, and then searches all
      default routes for IPv6 addresses (for backwards compatibility).
- More coverage in UTs (87.8% vs 62.6%).
- Better testing of error conditions/results.
- Tests for IPv6 IPs, throughout functions.
- Reduced duplicate testing for items tested at lower levels.

Commit has been rebased on top of PR46044.
2017-07-07 12:52:21 +00:00
Dr. Stefan Schimanski b34464241d client-go: remove TPR example 2017-07-07 14:13:46 +02:00
gmarek 55880e6b4b Move metrics_grabbert to test/e2e 2017-07-07 13:13:44 +02:00
FengyunPan d2ebb60438 Check opts of cloud config file
Fix #48347
Check opts when register OpenStack CloudProvider rather than
returning error when use opts to create/use cloud resource.
2017-07-07 17:05:21 +08:00
Andrew Rynhard 38c6e83033 Use Secrets for files that self-hosted pods depend on 2017-07-06 20:36:18 -07:00
xilabao 0ba41e7285 fix parse resource in setting selector 2017-07-07 10:36:29 +08:00
Nick Sardo 62d13f1379 Use API that utilizes networkProjectId 2017-07-06 18:13:02 -07:00
Kubernetes Submit Queue a9bf44101b Merge pull request #48539 from dims/volunteer-openstack-provider
Automatic merge from submit-queue

Volunteer to help with OpenStack provider reviews

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

I'd like to help with keeping the OpenStack cloud provider up-to-date

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-06 17:41:34 -07:00
Nick Sardo 06e328627c Use network project id for firewall/route mgmt and zone listing 2017-07-06 16:58:27 -07:00
Minhan Xia 68a2749b28 fix unit tests 2017-07-06 16:01:03 -07:00
Minhan Xia 46d3e83caf refactor updateEndpointMap and updateServiceMap results 2017-07-06 16:00:57 -07:00
Minhan Xia 25ac521f88 flush conntrack entry for udp service when # of backend changes from 0 to non-0 2017-07-06 15:12:44 -07:00
Kubernetes Submit Queue 7df2bce1ec Merge pull request #48269 from FengyunPan/add-gc-metric
Automatic merge from submit-queue (batch tested with PRs 48518, 48525, 48269)

Update comment for garbagecollector

Update comment for garbagecollector, update not exist func.

**Release note**:
```release-note
NONE
```
2017-07-06 13:34:46 -07:00
Kubernetes Submit Queue 3863f39588 Merge pull request #48525 from FengyunPan/cleanup-metric
Automatic merge from submit-queue (batch tested with PRs 48518, 48525, 48269)

Cleanup useless metrics.go for garbagecollector

The metrics of garbagecollector are already published with the
workqueue metrics, so metrics.go is useless, let's cleanup it.
See https://github.com/kubernetes/client-go/blob/master/util/workqueue/metrics.go.

**Release note**:

```release-note
NONE
```
2017-07-06 13:34:44 -07:00
Kubernetes Submit Queue 50c6211850 Merge pull request #48518 from smarterclayton/separate_cert_man
Automatic merge from submit-queue (batch tested with PRs 48518, 48525, 48269)

Move the kubelet certificate management code into a single package

Code is very similar and belongs together. Will allow future cert callers to potentially make this more generic, as well as to make it easier reuse code elsewhere.
2017-07-06 13:34:42 -07:00
Kubernetes Submit Queue 4e276d49b9 Merge pull request #46044 from pmichali/issue44848a
Automatic merge from submit-queue (batch tested with PRs 47435, 46044)

IPv6 support for getting node IP

As part of ChooseHostInterface(), it will call a function to try to get the
global IP for the host, by looking at all the system interfaces and select
the first IP that is not a loopback, link-local, or point-to-point IP.

This commit does the following:

- Allows IPv6 non-local IPs to be selected.
- IPv4 takes priority (checks all interfaces for IPv4 addresses and
  then checks all interfaces for IPv6), for backward compatibility.
- Adds UTs for code coverage (was no coverage of underlying function),
  increasing from 62% to 85%.
- Improved logging and reporting for error conditions.
- Minor renaming of functions and variables for readability.



**What this PR does / why we need it**:
This will be part of several PRs to add IPv6 support in apimachinery area for use by Kubernetes. It partially fixes the issue.

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

**Special notes for your reviewer**:
The intent is to break up the PR 45116 into multiple PRs to take on this change a piece at a time.

**Release note**:

```release-noteNONE
```
2017-07-06 12:43:42 -07:00
Kubernetes Submit Queue b00df7eb89 Merge pull request #47435 from luxas/kubeadm_new_selfhosting
Automatic merge from submit-queue (batch tested with PRs 47435, 46044)

kubeadm: Make self-hosting work and split it out to a phase

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

 - Removes the old self-hosting code
 - Puts the new self-hosting code in `phases/selfhosting`
   - The new code reads manifests from disk (static pods)...
   - ...mutates the PodSpec as necessary...
   - ...and posts the DaemonSet to the API Server...
   - ...and waits for it to come up
 - Uses DaemonSets for all control plane components
 - Creates a `kubeadm alpha phase selfhosting` command that can be invoked against any kubeadm-cluster after install.

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

fixes: https://github.com/kubernetes/kubeadm/issues/127
(large part of at least)

**Special notes for your reviewer**:

Please only review the fourth commit, based on https://github.com/kubernetes/kubernetes/pull/47345

**Release note**:

```release-note
kubeadm: Make self-hosting work by using DaemonSets and split it out to a phase that can be invoked via the CLI
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @jbeda
2017-07-06 12:43:39 -07:00
Clayton Coleman 01c9b6ce8f
Kubelet run() should accept partial KubeletDeps
This is used by integrators that want to perform partial overrides of
key interfaces. Refactors the run() method to fit the existing style and
preserve the existing behavior, but allow (for instance) client
bootstrap and cert refresh even when some dependencies are injected.
2017-07-06 15:06:25 -04:00
Kubernetes Submit Queue 756a814042 Merge pull request #43674 from shiywang/fixjsonpath
Automatic merge from submit-queue (batch tested with PRs 48538, 43674)

fix JSONPath parser will not filter strings containing parentheses

Fixes https://github.com/kubernetes/client-go/issues/158
@mtaufen  @daizuozhuo @caesarxuchao
2017-07-06 11:21:28 -07:00
Lucas Käldström 9f1c5a6f0f
kubeadm self-hosting: unit tests and bazel 2017-07-06 20:54:47 +03:00
Lucas Käldström d14478f27a
kubeadm: Make self-hosting work and split out to a phase 2017-07-06 20:54:15 +03:00
Kubernetes Submit Queue 14cd03aed6 Merge pull request #48538 from GheRivero/kubeadm_nodename
Automatic merge from submit-queue

Add node-name flag to `join` phase

**What this PR does / why we need it**: Allow to specify a node-name instead of relaying in `os.Hostname()`
This is useful where kubelet use the name given by the cloud-provider to
register the node.


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

**Special notes for your reviewer**:

**Release note**:
```release-note
Added new flag to `kubeadm join`: --node-name, that lets you specify the name of the Node object that's gonna be created
```
2017-07-06 10:52:41 -07:00
Kubernetes Submit Queue aef4010592 Merge pull request #46228 from jayunit100/scheduler_perf_owners
Automatic merge from submit-queue

Add ownership for the future of scheduler_perf and kubemark

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

The scheduler_perf project is cross-cutting with the other goals of the performance and scale initiatives, so, I've put together a list of interested parties who have been running, using, and contributing to it.

cc @kubernetes/sig-scheduling-pr-reviews @ravisantoshgudimetla @sjug
2017-07-06 10:02:21 -07:00
Kubernetes Submit Queue c75170ad8e Merge pull request #46848 from zjj2wry/err_message
Automatic merge from submit-queue

Fix some err message

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-06 10:02:03 -07:00
Kubernetes Submit Queue f177389436 Merge pull request #48536 from CaoShuFeng/application/json
Automatic merge from submit-queue

Fix invalid Content-Type for 403 error

https://github.com/kubernetes/kubernetes/pull/47384 makes 403 errors return Status Object. However the Content-Type is still "text/plain"
This change fixes it.

Before this change:
kubectl get pods --as=tom
Error from server (Forbidden): {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \"\" is forbidden: User \"tom\" cannot list pods in the namespace \"default\".","reason":"Forbidden","details":{"kind":"pods"},"code":403} (get pods)

After this change:
$ kubectl get pods --as=tom
Error from server (Forbidden): pods "" is forbidden: User "tom" cannot list pods in the namespace "default".



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

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

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-07-06 08:52:09 -07:00
Davanum Srinivas 927a4a0a68 Volunteer to help with OpenStack provider reviews
I'd like to help with keeping the OpenStack cloud provider up-to-date
2017-07-06 08:43:43 -04:00