Commit Graph

41478 Commits (8ef690251641b7df6749f67abff86fa01c10b070)

Author SHA1 Message Date
Kubernetes Submit Queue 2cc9650e7e Merge pull request #39306 from hex108/oom_score_adj
Automatic merge from submit-queue (batch tested with PRs 38084, 39306)

Small improve for GetContainerOOMScoreAdjust

In `GetContainerOOMScoreAdjust`, make logic more clear for the case `oomScoreAdjust >= besteffortOOMScoreAdj`. If `besteffortOOMScoreAdj`  is defined to another value(e.g. 996), suppose `oomScoreAdjust` is 999, the function will return 998(which equals 999 - 1) instead of 995(996 -1).
2017-01-04 07:18:07 -08:00
Kubernetes Submit Queue bd100b3b80 Merge pull request #38084 from tanshanshan/fix-little1
Automatic merge from submit-queue

Fix comment and optimize code

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

Fix comment and optimize code.

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-01-04 06:56:32 -08:00
Kubernetes Submit Queue 38d57e5a71 Merge pull request #39355 from kargakis/update-rc-manager
Automatic merge from submit-queue

Share rc cache from the rc manager

@kubernetes/sig-apps-misc @hodovska
2017-01-04 05:18:29 -08:00
Kubernetes Submit Queue f143ce01e9 Merge pull request #39204 from peay/cronjob-active-forever
Automatic merge from submit-queue

Remove jobs that do not exist from active list of CronJob

**What this PR does / why we need it**: This PR modifies the controller for CronJob to remove from the active job list any job that does not exist anymore, to avoid staying blocked in active state forever. See #37957.

**Which issue this PR fixes**: fixes #37957 

**Special notes for your reviewer**:

**Release note**:

```
```
2017-01-04 03:16:37 -08:00
Kubernetes Submit Queue e3c3b2ad6d Merge pull request #39371 from php-coder/fix_local_up_cluster_msg
Automatic merge from submit-queue (batch tested with PRs 39405, 39371)

hack/local-up-cluster.sh: fix typo in error message

This commit fixes typo in error message and also removes stale comment from `hack/local-up-cluster.sh`.
2017-01-04 02:22:05 -08:00
Kubernetes Submit Queue 7d8f29b622 Merge pull request #39405 from gnufied/fix-kubefed-cluster-ip-bug
Automatic merge from submit-queue (batch tested with PRs 36087, 39405)

federation-apiserver doesn't needs cluster-ip range

This option has been removed from genericserver options
and it is not being used by federation-apiserver anyways.

Fixes - #39388
2017-01-04 02:19:06 -08:00
tanshanshan d1fd1d3516 fix comment and so on 2017-01-04 17:16:11 +08:00
Kubernetes Submit Queue 016133cf7d Merge pull request #36087 from ericchiang/plugin-auth-oidc-verify-email
Automatic merge from submit-queue

oidc auth-n plugin: enforce email_verified claim

This change causes the OpenID Connect authenticator to start
enforcing the 'email_verified' claim.

https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims

If the OIDC authenticator uses the 'email' claim as a user's username
and the 'email_verified' is not set to `true`, reject that authentication attempt.

cc @erictune @kubernetes/sig-auth @mlbiam

```release-note
When using OIDC authentication and specifying --oidc-username-claim=email, an `"email_verified":true` claim must be returned from the identity provider.
```
2017-01-04 00:50:31 -08:00
zdj6373 84316ad559 "Attach" function records information collation 2017-01-04 16:42:24 +08:00
Kubernetes Submit Queue 2bad7e6be1 Merge pull request #39219 from liggitt/swagger-discovery
Automatic merge from submit-queue

Include swaggerapi urls in system:discovery role

Used by client side API validation and for client schema generation
2017-01-04 00:09:41 -08:00
Kubernetes Submit Queue 9b726d6b8f Merge pull request #38687 from ivan4th/remove-dockerlegacyservice-comment-from-kubelet
Automatic merge from submit-queue

Remove DockerLegacyService comment from kubelet
2017-01-03 23:28:22 -08:00
Kubernetes Submit Queue 819535b96a Merge pull request #36245 from fraenkel/env_configmap
Automatic merge from submit-queue (batch tested with PRs 38433, 36245)

Allow pods to define multiple environment variables from a whole ConfigMap

Allow environment variables to be populated from ConfigMaps

- ConfigMaps represent an entire set of EnvVars
- EnvVars can override ConfigMaps


fixes #26299
2017-01-03 23:28:09 -08:00
Kubernetes Submit Queue b202ebb7a5 Merge pull request #38433 from yuanying/remove-needless-config
Automatic merge from submit-queue (batch tested with PRs 38433, 36245)

Remove needless env var in OpenStack provider

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

If we use openstack provider to set up k8s cluster using kube-up script,
`TENANT_ID` environment variable is needed.
But to configure `TENANT_ID` is very annoying because this value is not static by each env.
This patch uses `TENANT_NAME` instead of `TENANT_ID`

**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
```

Since `TENANT_NAME` is unique if we use keystone v2 api,
so `TENANT_ID` is not needed if `TENANT_NAME` is provided
to configure OpenStack provider.
And also to set `TENANT_ID` is annoying to develop, because
`TENANT_ID` is not static by each environment.
This patch remove dependency of `TENANT_ID` and simply use
`TENANT_NAME`.
2017-01-03 23:28:07 -08:00
NickrenREN a3def9100e remove newAPIGroupVersion() and getAPIGroupVersion() second return value
Since newAPIGroupVersion() and getAPIGroupVersion() will never return err,we do not need that
2017-01-04 14:19:57 +08:00
Kubernetes Submit Queue dedec2d16d Merge pull request #39193 from xilabao/add-rules-failed-message
Automatic merge from submit-queue

add rules not allow message when authorize failed

old result:
```
# ./cluster/kubectl.sh --token=/test get po
Error from server (Forbidden): User "" cannot list pods in the namespace "default".: "<nil>" (get pods)
```
new result:
```
# ./cluster/kubectl.sh --token=/test get po
Error from server (Forbidden): User "" cannot list pods in the namespace "default".: "rules not allow" (get pods)
```

test.yaml
```
kind: Role
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: test
rules:
- apiGroups: ["*"]
  verbs: ["create"]
  resources: ["*"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: admin-resource-binding
subjects:
  - kind: Group
    name: test
roleRef:
  kind: Role
  name: test
```
2017-01-03 22:07:01 -08:00
Hemant Kumar b09c740fb7 federation-apiserver doesn't needs cluster-ip range
This option has been removed from genericserver options
and it is not being used by federation-apiserver anyways.

Fixes - #39388
2017-01-03 23:28:53 -05:00
xilabao 9b38eaf98e omit the reason if we don't have an error when using rbac 2017-01-04 11:41:43 +08:00
Kubernetes Submit Queue f95362f953 Merge pull request #39367 from jsafrane/sudo
Automatic merge from submit-queue (batch tested with PRs 39284, 39367)

e2e: Use sudo to start/stop kubelet service

It seems that user 'jenkins' does not have permissions to manage services. sudo is already used to e.g. check iptables in https://github.com/kubernetes/kubernetes/blob/master/test/e2e/service.go#L402

Fixes #37956
2017-01-03 19:20:10 -08:00
Kubernetes Submit Queue 064132d84a Merge pull request #39284 from bowei/remove-host-record
Automatic merge from submit-queue (batch tested with PRs 39284, 39367)

Remove HostRecord annotation (beta feature)

The annotation has made it to GA so this code should be deleted.

**Release note**:
```release-note
The 'endpoints.beta.kubernetes.io/hostnames-map' annotation is no longer supported.  Users can use the 'Endpoints.subsets[].addresses[].hostname' field instead.
```
2017-01-03 19:20:08 -08:00
xilabao a8b15492b4 fix wrong help message for taint 2017-01-04 11:14:25 +08:00
xilabao 78a0fb1e5a fix kubectl set selector 2017-01-04 10:34:24 +08:00
zhouhaibing089 a09fc73810 make discovery static when extensions/thirdpartyresources is not enabled 2017-01-04 10:27:15 +08:00
Kubernetes Submit Queue 3a26058298 Merge pull request #39313 from MrHohn/e2e-service-util
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

Moves e2e service util functions into service_util.go and cleans up

Basically moves codes into a central place for service util functions.

Some other codes are touched mostly only due to this migration. Also put a bunch of network reachability utils functions into network_utils.go. They seem somehow redundant, may consider combine they later.

@bowei @freehan
2017-01-03 18:25:16 -08:00
Kubernetes Submit Queue 834dda0342 Merge pull request #39390 from zmerlynn/fix-aws-certs
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

Fix AWS break injected by #39020

Shuffle the `download-cfssl` to `cluster/common.sh` (broken in #39020)
2017-01-03 18:25:14 -08:00
Kubernetes Submit Queue d0e160559d Merge pull request #39389 from mikedanese/kubeadm-fix
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

kubeadm: readd --api-port, accidentally removed during refactor.

this broke stuff
2017-01-03 18:25:12 -08:00
Kubernetes Submit Queue fe391d7bb0 Merge pull request #37350 from chentao1596/delete-meaningless-judgments
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

delete meaningless judgments

What this PR does / why we need it:
      Whether "err" is nil or not, "err" can be return, so the judgment "err !=nil " is unnecessary
2017-01-03 18:25:10 -08:00
Kubernetes Submit Queue 27850a79d9 Merge pull request #39280 from luxas/kubeadm_api_proto
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

Refactor the certificate and kubeconfig code in the kubeadm binary into two phases

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

First stab at refactoring kubeadm code into logically independent phases.
This defines two phases in the kubeadm init process:
 - certs: Takes some API values as input (the API will be refactored in a later PR), and generates certificates in the pki directory
 - kubeconfig: Takes the pki directory and the endpoint where the master is located and produces two kubeconfig files: admin.conf and kubelet.conf

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*:
Required long-term for graduating our API

**Special notes for your reviewer**:

### Old sample output
The earlier kubeconfig code had a bug in it; see this example:
_admin.conf:_
```yaml
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <data>
    server: https://192.168.200.x:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: admin
  name: admin@kubernetes
- context:
    cluster: kubernetes
    user: kubelet
  name: kubelet@kubernetes
current-context: admin@kubernetes
kind: Config
preferences: {}
users:
- name: admin
  user:
    client-certificate-data: <data>
    client-key-data: <data>
- name: kubelet
  user:
    client-certificate-data: <data>
    client-key-data: <data>
```
kubelet.conf:
```yaml
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <data>
    server: https://192.168.200.x:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: admin
  name: admin@kubernetes
- context:
    cluster: kubernetes
    user: kubelet
  name: kubelet@kubernetes
current-context: admin@kubernetes
kind: Config
preferences: {}
users:
- name: admin
  user:
    client-certificate-data: <data>
    client-key-data: <data>
- name: kubelet
  user:
    client-certificate-data: <data>
    client-key-data: <data>
```
```console
$ shasum /etc/kubernetes/*.conf
2b22b25cc4c97e5619ece6c43badf42b87c4970a  /etc/kubernetes/admin.conf
2b22b25cc4c97e5619ece6c43badf42b87c4970a  /etc/kubernetes/kubelet.conf
```

#### New output
admin.conf
```yaml
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <data>
    server: https://192.168.200.x:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: admin
  name: admin@kubernetes
current-context: admin@kubernetes
kind: Config
preferences: {}
users:
- name: admin
  user:
    client-certificate-data: <data>
    client-key-data: <data>
```
kubelet.conf
```yaml
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <data>
    server: https://192.168.200.x:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubelet
  name: kubelet@kubernetes
current-context: kubelet@kubernetes
kind: Config
preferences: {}
users:
- name: kubelet
  user:
    client-certificate-data: <data>
    client-key-data: <data>
```

**Release note**:

```release-note
Refactor the certificate and kubeconfig code in the kubeadm binary into two phases
```

PTAL @dgoodwin @jbeda @mikedanese @errordeveloper @pipejakob @lukemarsden
2017-01-03 18:25:08 -08:00
Kubernetes Submit Queue 9eaf1aa38f Merge pull request #39273 from NickrenREN/kubelet-node-status
Automatic merge from submit-queue (batch tested with PRs 39001, 39104, 35978, 39361, 39273)

delete SetNodeStatus() function and fix some function notes words
2017-01-03 17:18:12 -08:00
Kubernetes Submit Queue 8554599250 Merge pull request #39361 from zdj6373/util-log
Automatic merge from submit-queue (batch tested with PRs 39001, 39104, 35978, 39361, 39273)

Log error modification

controller_utils.go:  Log content is wrong, modify
2017-01-03 17:18:11 -08:00
Kubernetes Submit Queue a70ad9f4e6 Merge pull request #35978 from fabianofranz/cors_with_patch_method
Automatic merge from submit-queue (batch tested with PRs 39001, 39104, 35978, 39361, 39273)

Allow PATCH in an API CORS setup

Allows the PATCH method to be used in a REST API CORS setup.

**Release note**:

```release-note
NONE
```
2017-01-03 17:18:08 -08:00
Kubernetes Submit Queue 94d4ba7c82 Merge pull request #39104 from deads2k/api-57-admission-all-initializers
Automatic merge from submit-queue (batch tested with PRs 39001, 39104, 35978, 39361, 39273)

refactored admission to avoid internal client references

Refactored admission to avoid internal client references.  This required switching to plugin initializers for them.  And that required some rewiring of the plugin initializers. 

Technically I can decouple from the other two commits, but I'm optimistic that those will go through easy. This is slightly move invasive, but I'd like to shoot for pre-christmas to avoid new admission plugins coming through and breaking bits.

@sttts @derekwaynecarr
2017-01-03 17:18:06 -08:00
tianshapjq 2c2dba67fd modify the specifications 2017-01-04 09:12:24 +08:00
Kubernetes Submit Queue 34ea3a17af Merge pull request #39001 from xilabao/fix-group-in-create-clusterrolebinding
Automatic merge from submit-queue

fix group in create clusterrolebinding

group lost.

```
#kubectl create clusterrolebinding test --clusterrole=a --group=b
clusterrolebinding "test" created

#kubectl get clusterrolebinding test -o yaml
apiVersion: rbac.authorization.k8s.io/v1alpha1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: 2016-12-20T03:13:24Z
  name: test
  resourceVersion: "284"
  selfLink: /apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindingstest
  uid: 44d3476d-c662-11e6-a439-7427ea6f0fe3
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: a
subjects: null
```
2017-01-03 16:49:24 -08:00
Zihong Zheng e5944f56dc Moves e2e service util functions into service_util.go and cleans up test codes 2017-01-03 15:36:15 -08:00
Kubernetes Submit Queue 04d10d27d7 Merge pull request #30932 from derekwaynecarr/fix-30909
Automatic merge from submit-queue

Service with type=NodePort and clusterIP=None is not allowed

Fixes https://github.com/kubernetes/kubernetes/issues/30908
2017-01-03 15:25:29 -08:00
peay d8d69d1a36 Remove jobs that do not exist from active list of CronJob 2017-01-03 23:12:50 +00:00
Kubernetes Submit Queue 3951ae4e1d Merge pull request #38112 from juanvallejo/jvallejo/add-output-format-support-kubectl-create
Automatic merge from submit-queue

Add json,yaml output format support to kubectl create, kubectl apply

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

**Release note**:
```release-note
Added support for printing in all supported `--output` formats to `kubectl create ...` and `kubectl apply ...`
```

This patch adds the ability to specify an output format other than
"name" to `kubectl create ...`. It can be used in conjunction with the
`--dry-run` option. Converts unstructured objects into known types in
order to support all `--output` values.

The patch prints `*resource.Info`s returned by the server. If a resource does not yet exist (and the `--dry-run` option is not set), the resource is created and printed in the specified format.

@kubernetes/cli-review @fabianofranz
2017-01-03 14:18:33 -08:00
Zach Loafman a3b363000d Fix AWS break injected by kubernetes/kubernetes#39020 2017-01-03 13:52:02 -08:00
Lucas Käldström 720f3b45aa
Refactor the pki, cert, kubeconfig code in the kubeadm binary into two separate and logically independent phases 2017-01-03 23:40:07 +02:00
Mike Danese 0d6c029f7f kubeadm: readd --api-port, accidentally removed during refactor. 2017-01-03 13:38:21 -08:00
Lucas Käldström 733393d800
Add a PrivateKeyFromFile method to certutil for parsing a private key from a file 2017-01-03 23:36:23 +02:00
Kubernetes Submit Queue 7f9056dd07 Merge pull request #39309 from wojtek-t/register_necessary_object
Automatic merge from submit-queue

Register necessary objects in internal groups

Found during working on #39305
2017-01-03 12:59:10 -08:00
deads2k 2861509b6d refactored admission to avoid internal client references 2017-01-03 15:50:12 -05:00
Kubernetes Submit Queue 46d391e3b9 Merge pull request #39376 from metadave/newrelic_cluster_prefix_hostnames
Automatic merge from submit-queue

Update New Relic sample docs with dynamic hostname info

This PR shows how to set extra environment variables for the New Relic DaemonSet that can be generated at runtime. I'm using this technique to prepend cluster names to host names as they are reported to New Relic.
2017-01-03 12:07:05 -08:00
Dave Parfitt d429f11a9f Update New Relic sample docs with dynamic hostname info 2017-01-03 13:45:11 -05:00
Kubernetes Submit Queue 8623fdf0b1 Merge pull request #39344 from spxtr/boilerplate_test
Automatic merge from submit-queue (batch tested with PRs 39022, 39331, 39070, 39344)

Add a build rule for the boilerplate unit test.

We recently added unit tests that just run whenever you run `hack/verify_boilerplate.sh`, which really isn't the right time to do that. This adds a build rule instead.
2017-01-03 10:32:23 -08:00
Kubernetes Submit Queue 2a89179046 Merge pull request #39070 from shiywang/remove_unused_param
Automatic merge from submit-queue (batch tested with PRs 39022, 39331, 39070, 39344)

remove unused parameter
2017-01-03 10:32:22 -08:00
Kubernetes Submit Queue 1d8297ce92 Merge pull request #39331 from thockin/makefile-simplify-go-list
Automatic merge from submit-queue (batch tested with PRs 39022, 39331, 39070, 39344)

Makefile speedup on generated code

This has been languishing in a  branch for a long time.  It makes the build more consistent wrt GOPATH (I still hope to enforce GOPATH at some point) and it removes a `go list` from each codegen.

I verified manually that the files that this emits as part of the make are only change in safe ways (ordering, _test files removed, etc).
2017-01-03 10:32:20 -08:00
Kubernetes Submit Queue 533aa1cd7d Merge pull request #39022 from sttts/sttts-cert-as-ca-only-with-IsCA
Automatic merge from submit-queue

genericapiserver: extract CA cert from server cert and SNI cert chains

Without this PR a matching server cert or SNI cert is directly used as CA cert in the loopback client config. This fails if the cert is no CA cert.

With this PR the loopback client setup code walks through the chains of the server cert and the SNI certs to find a `CA:TRUE` cert. This is then used as the CA in the loopback client config.
2017-01-03 10:25:38 -08:00
Kubernetes Submit Queue 1cee8c45d6 Merge pull request #39237 from NickrenREN/pod-manager
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

Add unit test function to test DeletePod
2017-01-03 09:45:26 -08:00