Commit Graph

17878 Commits (9b726d6b8f7e71bf67ea1ff4106a56738f3649f0)

Author SHA1 Message Date
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
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 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
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
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
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
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
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 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 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
Kubernetes Submit Queue d6dbd50909 Merge pull request #37093 from simonswine/fix-tolerate-unready-endpoints-pods-terminating
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

Endpoints with TolerateUnready annotation, should list Pods in state terminating

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

We are using preStop lifecycle hooks to gracefully remove a node from a cluster. This hook is potentially long running and after the preStop hook is fired, the DNS resolution of the soon to be stopped Pod is failing, which causes a failure there.

**Special notes for your reviewer**:

Would be great to backport that to 1.4, 1.3 

**Release note**:

```release-note
Endpoints, that tolerate unready Pods, are now listing Pods in state Terminating as well
```

@bprashanth
2017-01-03 09:45:24 -08:00
Kubernetes Submit Queue 49fe0bea97 Merge pull request #37380 from jsafrane/rbd-errors
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

Improve error reporting in Ceph RBD provisioner.

- We should report an error when user references a secret that cannot be found
- We should report output of rbd create/delete commands, logging "exit code 1"
  is not enough.


Before:
```
Events:
  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                            -------------   --------        ------                  -------
  33m           33m             1       {persistentvolume-controller }                  Warning         ProvisioningFailed      Failed to provision volume with StorageClass "cephrbdprovisioner": rbd: create volume failed, err: exit status 1
```

After:

```
Events:
  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                            -------------   --------        ------                  -------
  33m           33m             1       {persistentvolume-controller }                  Warning         ProvisioningFailed      Failed to provision volume with StorageClass "cephrbdprovisioner": failed to create rbd image: exit status 1, command output: rbd: couldn't connect to the cluster
```


@rootfs, PTAL
2017-01-03 09:45:22 -08:00
Kubernetes Submit Queue 7a9dddbbfc Merge pull request #39126 from xilabao/update-prompt-in-create-rolebinding/clusterrolebinding
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

update prompt in create rolebinding/clusterrolebinding
2017-01-03 09:45:20 -08:00
Michael Fraenkel 94866b3bee Generated code 2017-01-03 11:45:38 -05:00
Kubernetes Submit Queue f0f871f637 Merge pull request #39149 from deads2k/rbac-33-poststarthook
Automatic merge from submit-queue

retry RBAC initialization for up to 30 seconds, kill server on failure

RBAC initialization needs to complete in order to bootstrap a cluster.  When the bootstrapping fails (etcd not ready has happened in e2e runs), things fail badly and we don't even kill the API server to force it to retry.  This retries for up to 30 seconds and kills the server if it never succeeds.

Fixes https://github.com/kubernetes/kubernetes/issues/39108
2017-01-03 08:21:54 -08:00
Michael Fraenkel 2d803afc98 ConfigMaps populate environment variables 2017-01-03 11:02:15 -05:00
Kubernetes Submit Queue 63eec9608d Merge pull request #39353 from sttts/sttts-requestcontextmapper-move
Automatic merge from submit-queue (batch tested with PRs 39075, 39350, 39353)

Move pkg/api.{Context,RequestContextMapper} into pkg/genericapiserver/api/request

**Based on #39350**
2017-01-03 07:40:30 -08:00
Kubernetes Submit Queue 123026aa28 Merge pull request #39350 from sttts/sttts-pkg-apiserver-move
Automatic merge from submit-queue (batch tested with PRs 39075, 39350, 39353)

Move pkg/apiserver to pkg/genericapiserver/api
2017-01-03 07:40:28 -08:00
Kubernetes Submit Queue 85bf256709 Merge pull request #39075 from ChenLingPeng/github-waitfor
Automatic merge from submit-queue

no need to sleep for last retry

break for needless sleep
2017-01-03 07:26:00 -08:00
Dr. Stefan Schimanski 87dd990bb7 Move pkg/api.{Context,RequestContextMapper} into pkg/genericapiserver/api/request 2017-01-03 14:57:33 +01:00
Dr. Stefan Schimanski 2d58ffc129 Move pkg/{apiserver -> genericapiserver/api} 2017-01-03 14:54:03 +01:00
deads2k 90a7251394 retry RBAC initialization for up to 30 seconds, kill server on failure 2017-01-03 08:52:26 -05:00
Christian Simon b44de1ef27 Fix: With TolerateUnready set, endpoints are still listed for a Pod in state terminating
* Otherwise it prevents long running task in a preStop hook to succeed,
that require DNS resolution
2017-01-03 13:00:15 +00:00
Dr. Stefan Schimanski 23d3148ad7 Update bazel 2017-01-03 12:54:40 +01:00
Dr. Stefan Schimanski 680d02a3ec genericapiserver: extract CA cert from server cert and SNI cert chains 2017-01-03 12:54:40 +01:00
Kubernetes Submit Queue c73d2457b4 Merge pull request #38913 from jianhuiz/batch-job-validate-status-update
Automatic merge from submit-queue

fix swapped new/old job obj for validating object meta update

@nikhiljindal
2017-01-03 03:08:47 -08:00
Kubernetes Submit Queue 8088ea426d Merge pull request #39157 from lukaszo/ds-generation
Automatic merge from submit-queue

DaemonSet ObservedGeneration

Extracting ObserverdGeneration part from #31693. It also implements #7328 for DaemonSets.

cc @kargakis
2017-01-03 02:29:57 -08:00
Kubernetes Submit Queue ed5a236525 Merge pull request #39322 from luxas/remove_reconcile_cidr
Automatic merge from submit-queue (batch tested with PRs 39351, 39322)

Remove the deprecated --reconcile-cidr flag from kubelet

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

Removes the `--reconcile-cidr` flag that has been deprecated since v1.5

**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
The `--reconcile-cidr` kubelet flag was removed since it had been deprecated since v1.5
```
@thockin
2017-01-03 00:22:20 -08:00
zdj6373 95e8d9d20c Log content is wrong, modify 2017-01-03 12:44:06 +08:00
NickrenREN fd336cde07 drop SetNodeStatus() function and fix some function notes words
drop SetNodeStatus() Since it is never called now. klet.defaultNodeStatusFuncs() is set to klet.setNodeStatusFuncs now and setNodeStatus() function is called by other functions.
2017-01-03 11:26:50 +08:00
NickrenREN 2fa0935c19 Add unit test function to test DeletePod
Add unit test function to test DeletePod() of podManager
2017-01-03 11:08:39 +08:00
Kubernetes Submit Queue 76dfee04f5 Merge pull request #38615 from jsafrane/worker-thread
Automatic merge from submit-queue (batch tested with PRs 39150, 38615)

Add work queues to PV controller

PV controller should not use Controller.Requeue, as as it is not available in
shared informers. We need to implement our own work queues instead, where we
can enqueue volumes/claims as we want.
2017-01-02 08:04:29 -08:00
Kubernetes Submit Queue cfc3c4b9aa Merge pull request #39150 from kargakis/ignore-deleted-pods-in-rolling-updater
Automatic merge from submit-queue

kubectl: ignore deleted pods in the rolling updater

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

The Deployment controller already ignores deleted pods or more precisely the ReplicaSet controller ignores deleted pods ([pod classification](a30b6e2d16/pkg/controller/replicaset/replica_set.go (L600)) ignores [deleted pods](a30b6e2d16/pkg/controller/controller_ref_manager.go (L63))) and the Deployment controller reuses what's in the ReplicaSet status.

@kubernetes/sig-apps-misc @kubernetes/sig-cli-misc
2017-01-02 07:34:19 -08:00
Jan Safranek 0fd5f2028d Add work queues to PV controller
PV controller should not use Controller.Requeue, as as it is not available in
shared informers. We need to implement our own work queues instead where we
can enqueue volumes/claims as we want.
2017-01-02 15:17:24 +01:00
Kubernetes Submit Queue cc0b17eaa1 Merge pull request #38574 from k82cn/k8s_38542
Automatic merge from submit-queue

Add default imagePullPolicy for initContainers.

fixes #38542
2017-01-02 06:03:05 -08:00
Łukasz Oleś a36a978781 Generated part for ObservedGeneration 2017-01-02 15:00:05 +01:00
Łukasz Oleś 9c0d28e359 Add ObservedGeneration to DaemonSet status 2017-01-02 14:47:16 +01:00
Kubernetes Submit Queue 3fe288d74e Merge pull request #36221 from pospispa/86-5-add-checks-and-documentation-about-template-pods-for-recycling
Automatic merge from submit-queue (batch tested with PRs 37959, 36221)

Recycle Pod Template Check

The kube-controller-manager has two command line arguments (--pv-recycler-pod-template-filepath-hostpath and --pv-recycler-pod-template-filepath-nfs) that specify a recycle pod template. The recycle pod template may not contain the volume that shall be recycled.

A check is added to make sure that the recycle pod template contains at least a volume.

cc: @jsafrane
2017-01-02 05:08:30 -08:00
Michail Kargakis 6cb946eab9 extensions: generated changes for readyReplicas 2017-01-02 11:59:15 +01:00
Michail Kargakis ce04ee6170 extensions: add readyReplicas in Deployments 2017-01-02 11:59:15 +01:00
Jeff Grafton fae627dd65 Update generated for 2017 2017-01-01 23:11:09 -08:00