Commit Graph

4502 Commits (29f8ff32c221d1f3d7d59bc4675fda3a3a011c59)

Author SHA1 Message Date
Chao Xu ab71a6ec60 fix conversion-gen 2017-06-07 16:23:25 -07:00
Kubernetes Submit Queue 69342bd1df Merge pull request #43005 from cmluciano/cml/consolidatesysctl
Automatic merge from submit-queue (batch tested with PRs 43005, 46660, 46385, 46991, 47103)

Consolidate sysctl commands for kubelet

**What this PR does / why we need it**:
These commands are important enough to be in the Kubelet itself.
By default, Ubuntu 14.04 and Debian Jessie have these set to 200 and
20000. Without this setting, nodes are limited in the number of
containers that they can start.

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

**Special notes for your reviewer**:
I had a difficult time writing tests for this. It is trivial to create a fake sysctl for testing, but the Kubelet does not have any tests for the prior settings.
**Release note**:

```release-note
```
2017-06-07 13:30:54 -07:00
Lucas Käldström b7700ef4dd
kubeadm: Enable the Node Authorizer in v1.7 and fix some small bugs related to the enablement 2017-06-07 21:07:49 +03:00
Lucas Käldström 1b93a6a10e
kubeadm: Make the creation of the RBAC rules phase idempotent 2017-06-07 17:39:26 +03:00
Kubernetes Submit Queue f89d2493f1 Merge pull request #47121 from sttts/sttts-kube-apiserver-owner
Automatic merge from submit-queue

kube-apiserver: add myself to OWNERS
2017-06-07 04:48:08 -07:00
Dr. Stefan Schimanski d2a257a077 kube-apiserver: add myself to OWNERS 2017-06-07 12:43:38 +02:00
Cao Shufeng cf8e3ccf19 Add Validate() function for audit options 2017-06-07 16:53:02 +08:00
Kubernetes Submit Queue 0613ae5077 Merge pull request #46669 from kow3ns/statefulset-update
Automatic merge from submit-queue (batch tested with PRs 46235, 44786, 46833, 46756, 46669)

implements StatefulSet update

**What this PR does / why we need it**:
1. Implements rolling update for StatefulSets
2. Implements controller history for StatefulSets.
3. Makes StatefulSet status reporting consistent with DaemonSet and ReplicaSet.

https://github.com/kubernetes/features/issues/188

**Special notes for your reviewer**:

**Release note**:
```release-note
Implements rolling update for StatefulSets. Updates can be performed using the RollingUpdate, Paritioned, or OnDelete strategies. OnDelete implements the manual behavior from 1.6. status now tracks 
replicas, readyReplicas, currentReplicas, and updatedReplicas. The semantics of replicas is now consistent with DaemonSet and ReplicaSet, and readyReplicas has the semantics that replicas did prior to this release.
```
2017-06-07 00:27:53 -07:00
Kubernetes Submit Queue f33a5f8bff Merge pull request #44125 from amacneil/kubeadm-instructions
Automatic merge from submit-queue

kubeadm: improve quickstart instructions

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

Improves instructional output following setup of a kubernetes master with kubeadm.

This helps prevent unnecessary support overhead such as: https://github.com/kubernetes/kubeadm/issues/212#issuecomment-292015402

**Example current output**:

```
To start using your cluster, you need to run (as a regular user):

  sudo cp /etc/kubernetes/admin.conf $HOME/
  sudo chown $(id -u):$(id -g) $HOME/admin.conf
  export KUBECONFIG=$HOME/admin.conf
```

**Example new output**:

```
To start using your cluster, you need to run (as a regular user):

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config
```

**Release note**:

```release-note
NONE
```
2017-06-06 15:01:23 -07:00
Kenneth Owens 1a784ef86f Auto generated code for StatefulSet update 2017-06-06 13:47:19 -07:00
Kubernetes Submit Queue 4a01f44b73 Merge pull request #46988 from p0lyn0mial/rename_some_admission_pkg
Automatic merge from submit-queue (batch tested with PRs 46718, 46828, 46988)

Simply changed the names of packages of some admission plugins.

**What this PR does / why we need it**:
This PR simply changes the names of packages of some admission plugins so that they are not in conflict with admission pkg.

**Release note**:

```release-note
NONE
```
2017-06-06 11:43:20 -07:00
Kubernetes Submit Queue 6ed4bc7b97 Merge pull request #46828 from cblecker/links-update
Automatic merge from submit-queue (batch tested with PRs 46718, 46828, 46988)

Update docs/ links to point to main site

**What this PR does / why we need it**:
This updates various links to either point to kubernetes.io or to the kubernetes/community repo instead of the legacy docs/ tree in k/k
Pre-requisite for #46813

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

@kubernetes/sig-docs-maintainers @chenopis @ahmetb @thockin
2017-06-06 11:43:18 -07:00
Adrian Macneil 4a2cd62080 kubeadm: improve quickstart instructions 2017-06-06 07:56:32 -07:00
Kubernetes Submit Queue 04477ff90c Merge pull request #46775 from sttts/sttts-rename-kube-apiext-server
Automatic merge from submit-queue

Rename {kube- ->}apiextensions-{-> api}server

Completely mechanical renaming, as preparation of the repo sync. This repo is generic, the prefix does not make sense.

Part of issue https://github.com/kubernetes/kubernetes/issues/46702

TODOs
- [ ] Waiting for the submit queue to settle, then rebase.
2017-06-06 06:46:34 -07:00
zhengjiajin 92d1706903 controller-manager: fix horizontal-pod-autoscaler-use-rest-clients flag help info 2017-06-06 20:33:38 +08:00
Kubernetes Submit Queue c35b44bc94 Merge pull request #46875 from pipejakob/idem-rbac
Automatic merge from submit-queue (batch tested with PRs 46897, 46899, 46864, 46854, 46875)

kubeadm: Idempotent service account creation.

**What this PR does / why we need it**:
During `kubeadm init`, ignore errors for duplicates when creating service accounts.

https://github.com/kubernetes/kubeadm/issues/278

Fixes: https://github.com/kubernetes/kubeadm/issues/288

**Release note**:

```release-note
NONE
```
2017-06-06 05:22:49 -07:00
Kubernetes Submit Queue f04a774297 Merge pull request #46864 from luxas/kubeadm_fix_v16_csrs
Automatic merge from submit-queue (batch tested with PRs 46897, 46899, 46864, 46854, 46875)

kubeadm: Make kubeadm use the right CSR approver for the right version

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

fixes regression caused in: https://github.com/kubernetes/kubernetes/pull/45619

**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/289

**Special notes for your reviewer**:

cc @pipejakob our e2e CI should probably go green after this change

**Release note**:

```release-note
NONE
```
@mikedanese @pipejakob @timothysc @liggitt
2017-06-06 05:22:45 -07:00
Dr. Stefan Schimanski 33e50da9f4 Rename {kube- ->}apiextensions-{-> api}server 2017-06-06 12:06:31 +02:00
Kubernetes Submit Queue f091722c38 Merge pull request #46819 from pipejakob/idem-config
Automatic merge from submit-queue (batch tested with PRs 46787, 46876, 46621, 46907, 46819)

kubeadm: Only create bootstrap configmap if not exists.

**What this PR does / why we need it**:
The fact that this method was not idempotent was breaking kubeadm upgrades.

https://github.com/kubernetes/kubeadm/issues/278

**Release note**:

```release-note
NONE
```
2017-06-06 02:22:00 -07:00
Kubernetes Submit Queue 21b6a336f5 Merge pull request #46907 from zhangxiaoyu-zidif/add-comment-for-genutils
Automatic merge from submit-queue (batch tested with PRs 46787, 46876, 46621, 46907, 46819)

Add fatal message

**What this PR does / why we need it**:
Add fatal message

**Release note**:

```release-note
NONE
```
2017-06-06 02:21:57 -07:00
Jacob Beacham 7ffd870c1e kubeadm: Idempotent service account creation.
Ignore errors for duplicates when creating service accounts.

https://github.com/kubernetes/kubeadm/issues/278
2017-06-06 01:43:55 -07:00
Christoph Blecker 1049ec8594
Fix link tests in mungedocs 2017-06-05 22:37:20 -07:00
Kubernetes Submit Queue d4e8a6cb4c Merge pull request #46745 from pipejakob/kubeadm-upgrades
Automatic merge from submit-queue

kubeadm: don't duplicate master taint if it already exists.

**What this PR does / why we need it**:
This helps enable a graceful upgrade/downgrade process between 1.6.x and 1.7.x kubeadm clusters (although no guarantees outside of that range) by doing:

    $ kubeadm init --kubernetes-version <version> --skip-preflight-checks

Without this change, the command fails with an error that the node taint is duplicated.

This is part of https://github.com/kubernetes/kubeadm/issues/278

**Release note**:

```release-note
NONE
```
Fixes: https://github.com/kubernetes/kubeadm/issues/288
2017-06-05 22:21:35 -07:00
Christoph Blecker 1bdc7a29ae
Update docs/ URLs to point to proper locations 2017-06-05 22:13:54 -07:00
Lucas Käldström de2ef8f0c7
kubeadm: Make kubeadm use the right CSR approver for the right version 2017-06-06 07:47:18 +03:00
Kubernetes Submit Queue a552ee61a0 Merge pull request #46672 from smarterclayton/initializer_with_config
Automatic merge from submit-queue (batch tested with PRs 46967, 46992, 43338, 46717, 46672)

Select initializers from the dynamic configuration

Continues #36721

kubernetes/features#209
2017-06-05 20:27:50 -07:00
Kubernetes Submit Queue 5ece6470b3 Merge pull request #46717 from timstclair/audit-proto
Automatic merge from submit-queue (batch tested with PRs 46967, 46992, 43338, 46717, 46672)

Generate protobuf for the audit API

Add protobuf generation & annotations for the advanced auditing API. We're not using them directly now, but settling on the field numbering will help with some 3rd party integrations.

For kubernetes/features#22

/cc @ihmccreery
2017-06-05 20:27:48 -07:00
Kubernetes Submit Queue de19cbe752 Merge pull request #46050 from mml/log-disruption
Automatic merge from submit-queue (batch tested with PRs 44883, 46836, 46765, 46683, 46050)

Log more verbose when DisruptionController doesn't start.
2017-06-05 18:43:16 -07:00
Kubernetes Submit Queue 59af8cb506 Merge pull request #46765 from xingzhou/kube-46736
Automatic merge from submit-queue (batch tested with PRs 44883, 46836, 46765, 46683, 46050)

While deleting a namespace, the TPR instances under this ns should be…

… deleted.

While deleting a namespace, the TPR instances under this ns should be deleted.

Fixed #46736 

**Release note**:
```
None
```
2017-06-05 18:43:10 -07:00
Kubernetes Submit Queue 8280bd5e1a Merge pull request #46799 from mikedanese/gce-3
Automatic merge from submit-queue (batch tested with PRs 46972, 42829, 46799, 46802, 46844)

promote tls-bootstrap to beta

last commit of this PR.

Towards https://github.com/kubernetes/kubernetes/issues/46999

```release-note
Promote kubelet tls bootstrap to beta. Add a non-experimental flag to use it and deprecate the old flag.
```
2017-06-05 17:46:52 -07:00
Kubernetes Submit Queue f893cddfba Merge pull request #46460 from sakshamsharma/location_transformer
Automatic merge from submit-queue (batch tested with PRs 46550, 46663, 46816, 46820, 46460)

Add configuration for encryption providers

## Additions

Allows providing a configuration file (using flag `--experimental-encryption-provider-config`) to use the existing AEAD transformer (with multiple keys) by composing mutable transformer, prefix transformer (for parsing providerId), another prefix transformer (for parsing keyId), and AES-GCM transformers (one for each key). Multiple providers can be configured using the configuration file.

Example configuration:
```
kind: EncryptionConfig
apiVersion: v1
resources:
  - resources:
    - namespaces
    providers:
    - aes:
        keys:
        - name: key1
          secret: c2vjcmv0iglzihnly3vyzq==
        - name: key2
          secret: dghpcybpcybwyxnzd29yza==
    - identity: {}
```

Need for configuration discussed in:
#41939
[Encryption](3418b4e4c6/contributors/design-proposals/encryption.md)

**Pathway of a read/write request**:
1. MutableTransformer
2. PrefixTransformer reads the provider-id, and passes the request further if that matches.
3. PrefixTransformer reads the key-id, and passes the request further if that matches.
4. GCMTransformer tries decrypting and authenticating the cipher text in case of reads. Similarly for writes.

## Caveats
1. To keep the command line parameter parsing independent of the individual transformer's configuration, we need to convert the configuration to an `interface{}` and manually parse it in the transformer. Suggestions on better ways to do this are welcome.

2. Flags `--encryption-provider` and `--encrypt-resource` (both mentioned in [this document](3418b4e4c6/contributors/design-proposals/encryption.md) ) are not supported in this because they do not allow more than one provider, and the current format for the configuration file possibly supersedes their functionality.

3. Currently, it can be tested by adding `--experimental-encryption-provider-config=config.yml` to `hack/local-up-cluster.sh` on line 511, and placing the above configuration in `config.yml` in the root project directory.

Previous discussion on these changes:
https://github.com/sakshamsharma/kubernetes/pull/1

@jcbsmpsn @destijl @smarterclayton

## TODO
1. Investigate if we need to store keys on disk (per [encryption.md](3418b4e4c6/contributors/design-proposals/encryption.md (option-1-simple-list-of-keys-on-disk)))
2. Look at [alpha flag conventions](https://github.com/kubernetes/kubernetes/blob/master/pkg/features/kube_features.go)
3. Need to reserve `k8s:enc` prefix formally for encrypted data. Else find a better way to detect transformed data.
2017-06-05 16:43:48 -07:00
Tim St. Clair d7d5435720
Generate protobuf for the audit API 2017-06-05 16:13:41 -07:00
Clayton Coleman 772ab8e1b4
Load initializers from dynamic config
Handle failure cases on startup gracefully to avoid causing cascading
errors and poor initialization in other components. Initial errors from
config load cause the initializer to pause and hold requests. Return
typed errors to better communicate failures to clients.

Add code to handle two specific cases - admin wants to bypass
initialization defaulting, and mirror pods (which want to bypass
initialization because the kubelet owns their lifecycle).
2017-06-05 19:12:41 -04:00
Jacob Beacham 20c45d08fb kubeadm: don't duplicate master taint if it already exists.
This helps enable a graceful upgrade/downgrade process between 1.6.x and
1.7.x kubeadm clusters (although no guarantees outside of that range) by
doing:

  $ kubeadm init --kubernetes-version <version> --skip-preflight-checks

Without this change, the command fails with an error that the node taint
is duplicated.

This is part of https://github.com/kubernetes/kubeadm/issues/278
2017-06-05 14:47:50 -07:00
Anirudh Ramanathan cc294cfb7e Merge pull request #46985 from deads2k/controller-09-agg-health
make the health check wait for ready apiservices
2017-06-05 14:33:23 -07:00
p0lyn0mial d0e89577db Simply changed the names of packages of some admission plugins. 2017-06-05 22:23:42 +02:00
Mike Danese cdcfa35c2a promote tls-bootstrap to beta 2017-06-05 12:20:58 -07:00
deads2k 0ad98c29f0 make the health check wait for ready apiservices 2017-06-05 15:05:33 -04:00
mbohlool 1a1d9a0394 Aggregate OpenAPI specs 2017-06-04 21:54:11 -07:00
Kubernetes Submit Queue f28fe811ad Merge pull request #46680 from cheftako/aggregate
Automatic merge from submit-queue (batch tested with PRs 46681, 46786, 46264, 46680, 46805)

Enable Dialer on the Aggregator

Centralize the creation of the dialer during startup.
Have the dialer then passed in to both APIServer and Aggregator.
Aggregator the uses the dialer as its Transport base.

**What this PR does / why we need it**:Enables the Aggregator to use the Dialer/SSHTunneler to connect to the user-apiserver.

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

**Special notes for your reviewer**:

**Release note**: None
2017-06-03 21:16:46 -07:00
zhangxiaoyu-zidif 9121ee63d4 Add fatal message 2017-06-04 09:42:08 +08:00
Kubernetes Submit Queue 638c7382ae Merge pull request #46783 from deads2k/controller-08-initfn
Automatic merge from submit-queue (batch tested with PRs 40760, 46706, 46783, 46742, 46751)

complete the controller context for init funcs

This completes the conversion to initFuncs for the controller initialization to make easier and more manageable to add them.
2017-06-03 18:30:42 -07:00
Kubernetes Submit Queue dbd1503b65 Merge pull request #45924 from janetkuo/daemonset-history
Automatic merge from submit-queue

Implement Daemonset history

~Depends on #45867 (the 1st commit, ignore it when reviewing)~ (already merged)

Ref https://github.com/kubernetes/community/pull/527/ and https://github.com/kubernetes/community/pull/594

@kubernetes/sig-apps-api-reviews @kubernetes/sig-apps-pr-reviews @erictune @kow3ns @lukaszo @kargakis 

---

TODOs:
- [x] API changes
  - [x] (maybe) Remove rollback subresource if we decide to do client-side rollback 
- [x] deployment controller 
  - [x] controller revision
    - [x] owner ref (claim & adoption)
    - [x] history reconstruct (put revision number, hash collision avoidance)
    - [x] de-dup history and relabel pods
    - [x] compare ds template with history 
  - [x] hash labels (put it in controller revision, pods, and maybe deployment)
  - [x] clean up old history 
  - [x] Rename status.uniquifier when we reach consensus in #44774 
- [x] e2e tests 
- [x] unit tests 
  - [x] daemoncontroller_test.go 
  - [x] update_test.go 
  - [x] ~(maybe) storage_test.go // if we do server side rollback~

kubectl part is in #46144

--- 

**Release note**:

```release-note
```
2017-06-03 16:52:38 -07:00
Tim Hockin be987b015c Merge pull request #46716 from thockin/proxy-comments
Kube-proxy cleanups
2017-06-03 15:57:17 -07:00
Kubernetes Submit Queue 7d599cc190 Merge pull request #46724 from deads2k/agg-32-startup
Automatic merge from submit-queue (batch tested with PRs 36721, 46483, 45500, 46724, 46036)

stop special casing the loopback connection for aggregator

Fixes a TODO for the aggregator loopback connection.
2017-06-03 08:08:42 -07:00
Kubernetes Submit Queue 07f85565a2 Merge pull request #36721 from smarterclayton/initializers
Automatic merge from submit-queue

Add initializer support to admission and uninitialized filtering to rest storage

Initializers are the opposite of finalizers - they allow API clients to react to object creation and populate fields prior to other clients seeing them.

High level description:

1. Add `metadata.initializers` field to all objects
2. By default, filter objects with > 0 initializers from LIST and WATCH to preserve legacy client behavior (known as partially-initialized objects)
3. Add an admission controller that populates .initializer values per type, and denies mutation of initializers except by certain privilege levels (you must have the `initialize` verb on a resource)
4. Allow partially-initialized objects to be viewed via LIST and WATCH for initializer types
5. When creating objects, the object is "held" by the server until the initializers list is empty
6. Allow some creators to bypass initialization (set initializers to `[]`), or to have the result returned immediately when the object is created.

The code here should be backwards compatible for all clients because they do not see partially initialized objects unless they GET the resource directly. The watch cache makes checking for partially initialized objects cheap. Some reflectors may need to change to ask for partially-initialized objects.

```release-note
Kubernetes resources, when the `Initializers` admission controller is enabled, can be initialized (defaulting or other additive functions) by other agents in the system prior to those resources being visible to other clients.  An initialized resource is not visible to clients unless they request (for get, list, or watch) to see uninitialized resources with the `?includeUninitialized=true` query parameter.  Once the initializers have completed the resource is then visible.  Clients must have the the ability to perform the `initialize` action on a resource in order to modify it prior to initialization being completed.
```
2017-06-03 07:16:52 -07:00
Kubernetes Submit Queue efa8c5eb45 Merge pull request #45008 from xilabao/fix-cert-dir
Automatic merge from submit-queue

fix cert dir in kubeadm

1.fixes https://github.com/kubernetes/kubeadm/issues/232
2. use manifests as a constant
2017-06-03 03:48:26 -07:00
Janet Kuo d02f40a5e7 Implement DaemonSet history logic in controller
1. Create controllerrevisions (history) and label pods with template
   hash for both RollingUpdate and OnDelete update strategy
2. Clean up old, non-live history based on revisionHistoryLimit
3. Remove duplicate controllerrevisions (the ones with the same template)
   and relabel their pods
4. Update RBAC to allow DaemonSet controller to manage
   controllerrevisions
5. In DaemonSet controller unit tests, create new pods with hash labels
2017-06-03 00:44:23 -07:00
Kubernetes Submit Queue b8c9ee8abb Merge pull request #46456 from jingxu97/May/allocatable
Automatic merge from submit-queue

Add local storage (scratch space) allocatable support

This PR adds the support for allocatable local storage (scratch space).
This feature is only for root file system which is shared by kubernetes
componenets, users' containers and/or images. User could use
--kube-reserved flag to reserve the storage for kube system components.
If the allocatable storage for user's pods is used up, some pods will be
evicted to free the storage resource.

This feature is part of local storage capacity isolation and described in the proposal https://github.com/kubernetes/community/pull/306

**Release note**:

```release-note
This feature exposes local storage capacity for the primary partitions, and supports & enforces storage reservation in Node Allocatable 
```
2017-06-03 00:24:29 -07:00
Kubernetes Submit Queue e837c3bbc2 Merge pull request #46388 from lavalamp/whitlockjc-generic-webhook-admission
Automatic merge from submit-queue (batch tested with PRs 46239, 46627, 46346, 46388, 46524)

Dynamic webhook admission control plugin

Unit tests pass.

Needs plumbing:
* [ ] service resolver (depends on @wfender PR)
* [x] client cert (depends on ????)
* [ ] hook source (depends on @caesarxuchao PR)

Also at least one thing will need to be renamed after Chao's PR merges.

```release-note
Allow remote admission controllers to be dynamically added and removed by administrators.  External admission controllers make an HTTP POST containing details of the requested action which the service can approve or reject.
```
2017-06-02 23:37:42 -07:00
Kubernetes Submit Queue 348bf1e032 Merge pull request #46627 from deads2k/api-12-labels
Automatic merge from submit-queue (batch tested with PRs 46239, 46627, 46346, 46388, 46524)

move labels to components which own the APIs

During the apimachinery split in 1.6, we accidentally moved several label APIs into apimachinery.  They don't belong there, since the individual APIs are not general machinery concerns, but instead are the concern of particular components: most commonly the kubelet.  This pull moves the labels into their owning components and out of API machinery.

@kubernetes/sig-api-machinery-misc @kubernetes/api-reviewers @kubernetes/api-approvers 
@derekwaynecarr  since most of these are related to the kubelet
2017-06-02 23:37:38 -07:00
Kubernetes Submit Queue 24d09977fb Merge pull request #41912 from jcbsmpsn/rotate-client-certificate
Automatic merge from submit-queue (batch tested with PRs 46726, 41912, 46695, 46034, 46551)

Rotate kubelet client certificate.

Changes the kubelet so it bootstraps off the cert/key specified in the
config file and uses those to request new cert/key pairs from the
Certificate Signing Request API, as well as rotating client certificates
when they approach expiration.

Default behavior is for client certificate rotation to be disabled. If enabled
using a command line flag, the kubelet exits each time the certificate is
rotated. I tried to use `GetCertificate` in [tls.Config](https://golang.org/pkg/crypto/tls/#Config) but it is only called
on the server side of connections. Then I tried `GetClientCertificate`,
but it is new in 1.8.

**Release note**
```release-note
With --feature-gates=RotateKubeletClientCertificate=true set, the kubelet will
request a client certificate from the API server during the boot cycle and pause
waiting for the request to be satisfied. It will continually refresh the certificate
as the certificates expiration approaches.
```
2017-06-02 21:42:37 -07:00
Kubernetes Submit Queue aab12f217e Merge pull request #46726 from deads2k/crd-09-proto
Automatic merge from submit-queue

add protobuf for CRD

Adds protobuf encoding to CRD and simplifies loopback initialization.

xref: https://github.com/kubernetes/features/issues/95
2017-06-02 21:34:54 -07:00
Clayton Coleman 4ce3907639
Add Initializers to all admission control paths by default 2017-06-02 22:09:04 -04:00
Clayton Coleman 331eea67d8
Allow initialization of resources
Add support for creating resources that are not immediately visible to
naive clients, but must first be initialized by one or more privileged
cluster agents. These controllers can mark the object as initialized,
allowing others to see them.

Permission to override initialization defaults or modify an initializing
object is limited per resource to a virtual subresource "RESOURCE/initialize"
via RBAC.

Initialization is currently alpha.
2017-06-02 22:09:03 -04:00
Kubernetes Submit Queue f294b535a0 Merge pull request #45930 from x1957/addlog
Automatic merge from submit-queue (batch tested with PRs 46801, 45184, 45930, 46192, 45563)

adds log  when --kubeconfig with wrong config

**What this PR does / why we need it**:
easy for troubleshooting
I have set --kubeconfig==/etc/kubernetes/kubelet.conf when copy & paste(the file path is wrong “==/etc/kubernetes/kubelet.conf”), but kubelet start with no error log. I don't know what happend.
**Release note**:

```release-note
NONE
```
2017-06-02 18:05:53 -07:00
Kubernetes Submit Queue caead74171 Merge pull request #45184 from DirectXMan12/feature/metrics-client-gen-tweaks
Automatic merge from submit-queue (batch tested with PRs 46801, 45184, 45930, 46192, 45563)

Tweak client-gen to support metrics API

This PR adds support to client-gen for readonly APIs as well as for customizing the resource name used for a given type.

This is required to support the clients generated for `k8s.io/metrics/pkg/apis/metrics`.

cc @caesarxuchao 

Currently based on #45180

**Release note**:
```release-note
NONE
```
2017-06-02 18:05:50 -07:00
lichunlong dc768c87c3 fix review 2017-06-02 15:32:22 +08:00
Xing Zhou 3a72abed40 While deleting a namespace, the TPR instances under this ns should be deleted.
While deleting a namespace, the TPR instances under this ns should be deleted.
2017-06-02 11:54:13 +08:00
Saksham Sharma 9760d00d08 Add configuration options for encryption providers
Add location transformer, config for transformers

Location transformer helps choose the most specific transformer for
read/write operations depending on the path of resource being accessed.

Configuration allows use of --experimental-encryption-provider-config
to set up encryption providers. Only AEAD is supported at the moment.

Add new files to BUILD, AEAD => k8s-aes-gcm

Use group resources to select encryption provider

Update tests for configuration parsing

Remove location transformer

Allow specifying providers per resource group in configuration

Add IdentityTransformer configuration option

Fix minor issues with initial AEAD implementation

Unified parsing of all configurations

Parse configuration using a union struct

Run configuration parsing in APIserver, refactor parsing

More gdoc, fix minor bugs

Add test coverage for combined transformers

Use table driven tests for encryptionconfig
2017-06-01 20:25:11 -07:00
Jacob Beacham cbc14a7df4 kubeadm: Only create bootstrap configmap if exists.
The fact that this method was not idempotent was breaking kubeadm
upgrades.
2017-06-01 19:08:03 -07:00
deads2k 475916cc59 complete the controller context for init funcs 2017-06-01 20:34:30 -04:00
Jing Xu 943fc53bf7 Add predicates check for local storage request
This PR adds the check for local storage request when admitting pods. If
the local storage request exceeds the available resource, pod will be
rejected.
2017-06-01 15:57:50 -07:00
Jing Xu dd67e96c01 Add local storage (scratch space) allocatable support
This PR adds the support for allocatable local storage (scratch space).
This feature is only for root file system which is shared by kubernetes
componenets, users' containers and/or images. User could use
--kube-reserved flag to reserve the storage for kube system components.
If the allocatable storage for user's pods is used up, some pods will be
evicted to free the storage resource.
2017-06-01 15:57:50 -07:00
Kubernetes Submit Queue f7a1f10275 Merge pull request #45919 from ericchiang/audit-webhook-backend
Automatic merge from submit-queue

apiserver: add a webhook implementation of the audit backend

This builds off of #45315 and is intended to implement an interfaced defined in #45766.

TODO:

- [x] Rebase on top of API types PR.
- [x] Rebase on top of API types updates (#46065)
- [x] Rebase on top of feature flag (#46009)
- [x] Rebase on top of audit instrumentation.
- [x] Hook up API server flag or register plugin (depending on #45766)

Features issue https://github.com/kubernetes/features/issues/22

Design proposal https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auditing.md

```release-notes
Webhook added to the API server which omits structured audit log events.
```

/cc @soltysh @timstclair @soltysh @deads2k
2017-06-01 13:41:59 -07:00
Tim Hockin 862b165427 Proxy: comments on --masquerade-all flag 2017-06-01 12:36:31 -07:00
Jacob Simpson 1519bb94dc Rotate kubelet client certificate.
Changes the kubelet so it bootstraps off the cert/key specified in the
config file and uses those to request new cert/key pairs from the
Certificate Signing Request API, as well as rotating client certificates
when they approach expiration.
2017-06-01 09:29:42 -07:00
supereagle dc9f0f9729 mark --network-plugin-dir deprecated for kubelet, and update related bootstrap scripts 2017-06-01 22:06:44 +08:00
Kubernetes Submit Queue 98e5496aa2 Merge pull request #46677 from enisoc/tpr-migrate-etcd
Automatic merge from submit-queue (batch tested with PRs 43505, 45168, 46439, 46677, 46623)

Add TPR to CRD migration helper.

This is a helper for migrating TPR data to CustomResource. It's rather hacky because it requires crossing apiserver boundaries, but doing it this way keeps the mess contained to the TPR code, which is scheduled for deletion anyway.

It's also not completely hands-free because making it resilient enough to be completely automated is too involved to be worth it for an alpha-to-beta migration, and would require investing significant effort to fix up soon-to-be-deleted TPR code. Instead, this feature will be documented as a best-effort helper whose results should be verified by hand.

The intended benefit of this over a totally manual process is that it should be possible to copy TPR data into a CRD without having to tear everything down in the middle. The process would look like this:

1. Upgrade to k8s 1.7. Nothing happens to your TPRs.
1. Create CRD with group/version and resource names that match the TPR. Still nothing happens to your TPRs, as the CRD is hidden by the overlapping TPR.
1. Delete the TPR. The TPR data is converted to CustomResource data, and the CRD begins serving at the same REST path.

Note that the old TPR data is left behind by this process, so watchers should not receive DELETE events. This also means the user can revert to the pre-migration state by recreating the TPR definition.

Ref. https://github.com/kubernetes/kubernetes/issues/45728
2017-06-01 05:43:44 -07:00
Kubernetes Submit Queue 05e2e1fd86 Merge pull request #45708 from jianglingxia/jlx51215
Automatic merge from submit-queue (batch tested with PRs 46686, 45049, 46323, 45708, 46487)

add some full stop and change some format
2017-06-01 03:42:10 -07:00
lichunlong 63bc96e1b0 fix review 2017-06-01 17:22:41 +08:00
Walter Fender 5b3f4684ed Enable Dialer on the Aggregator
Centralize the creation of the dialer during startup.
Have the dialer then passed in to both APIServer and Aggregator.
Aggregator the sets the dialer on its Transport base.
This should allow the SSTunnel to be used but also allow the Aggregation
Auth to work with it.
Depending on Environment InsecureSkipTLSVerify *may* need to be set to
true.
Fixed as few tests to call CreateDialer as part of start-up.
2017-06-01 00:05:02 -07:00
Anthony Yeh ba59e14d44
Add TPR to CRD migration helper. 2017-05-31 19:07:38 -07:00
xilabao 2061fa6717 1. Fix create volume of CertificatesDir.
2. Replace "manifests" to kubeadmconstants.ManifestsDirName
2017-06-01 09:17:10 +08:00
Daniel Smith d6e1140b5d Implement dynamic admission webhooks
Also fix a bug in rest client
2017-05-31 16:38:46 -07:00
deads2k 70006e13b2 add protobuf for CRD 2017-05-31 16:16:18 -04:00
deads2k b5737d1c12 stop special casing the loopback connection for aggregator 2017-05-31 15:52:32 -04:00
Jeremy Whitlock f4403d262e add generated sources for webhook admission plugin 2017-05-31 11:41:11 -07:00
Jeremy Whitlock b26c19bc61 add generic webhook admission controller
As part of https://github.com/kubernetes/community/pull/132, thsi commit
adds a generic webhook admission controller.  This plugin allows for a
completely declarative approach for filtering/matching admission requests
and for matching admission requests, calls out to an external webhook for
handling admission requests.
2017-05-31 11:41:11 -07:00
Eric Chiang a88e0187f9 apiserver: add a webhook implementation of the audit backend 2017-05-31 09:45:23 -07:00
x1957 10eecc771d adds log when --kubeconfig with wrong config 2017-05-31 23:16:57 +08:00
deads2k 954eb3ceb9 move labels to components which own the APIs 2017-05-31 10:32:06 -04:00
lichunlong 58d0596c23 fix review 2017-05-31 21:48:53 +08:00
Kubernetes Submit Queue 0aad9d30e3 Merge pull request #44897 from msau42/local-storage-plugin
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

Local storage plugin

**What this PR does / why we need it**:
Volume plugin implementation for local persistent volumes.  Scheduler predicate will direct already-bound PVCs to the node that the local PV is at.  PVC binding still happens independently.

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

**Release note**:

```
Alpha feature: Local volume plugin allows local directories to be created and consumed as a Persistent Volume.  These volumes have node affinity and pods will only be scheduled to the node that the volume is at.
```
2017-05-30 23:20:02 -07:00
xilabao ea196490a0 add validate to not allow mix --config with other arguments 2017-05-31 13:41:21 +08:00
lichunlong 1965157b49 fix#46039: iptables proxier need use '--bind-address' if set 2017-05-31 13:35:55 +08:00
Kubernetes Submit Queue f2074ba8de Merge pull request #45059 from jcbsmpsn/rotate-server-certificate
Automatic merge from submit-queue (batch tested with PRs 46635, 45619, 46637, 45059, 46415)

Certificate rotation for kubelet server certs.

Replaces the current kubelet server side self signed certs with certs signed by
the Certificate Request Signing API on the API server. Also renews expiring
kubelet server certs as expiration approaches.

Two Points:
1. With `--feature-gates=RotateKubeletServerCertificate=true` set, the kubelet will
    request a certificate during the boot cycle and pause waiting for the request to
    be satisfied.
2. In order to have the kubelet's certificate signing request auto approved,
    `--insecure-experimental-approve-all-kubelet-csrs-for-group=` must be set on
    the cluster controller manager. There is an improved mechanism for auto
    approval [proposed](https://github.com/kubernetes/kubernetes/issues/45030).

**Release note**:
```release-note
With `--feature-gates=RotateKubeletServerCertificate=true` set, the kubelet will
request a server certificate from the API server during the boot cycle and pause
waiting for the request to be satisfied. It will continually refresh the certificate as
the certificates expiration approaches.
```
2017-05-30 19:49:02 -07:00
Kubernetes Submit Queue 4e531f615d Merge pull request #45619 from mikedanese/cert-sar
Automatic merge from submit-queue (batch tested with PRs 46635, 45619, 46637, 45059, 46415)

migrate group approver to use subject access reviews

WIP, needs test and changes to kubeadm

depends on https://github.com/kubernetes/kubernetes/pull/45514
2017-05-30 19:48:57 -07:00
jianglingxia 85d22f0a83 add some full stop and change some format
Signed-off-by: jianglingxia <jiang.lingxia@zte.com.cn>
2017-05-31 09:43:08 +08:00
Kubernetes Submit Queue da5edc11f3 Merge pull request #44061 from yujuhong/docker_flags
Automatic merge from submit-queue

kubelet: group all container-runtime-specific flags/options into a separate struct

They don't belong in the KubeletConfig.

This addresses #43253
2017-05-30 17:43:52 -07:00
Kubernetes Submit Queue 052cd6d30b Merge pull request #46165 from x1957/kubelet
Automatic merge from submit-queue

fixtypo 

**What this PR does / why we need it**:
fix typo seperated -> separated

**Release note**:

```release-note
None
```
2017-05-30 12:56:02 -07:00
Mike Danese fb4c020c82 make kubeadm use new sar approver 2017-05-30 11:43:03 -07:00
Mike Danese 66b4b99616 migrate group approver to use subject access reviews 2017-05-30 11:43:03 -07:00
Kubernetes Submit Queue cb201802a1 Merge pull request #46459 from p0lyn0mial/move_admission_lifecycle_to_genericapi
Automatic merge from submit-queue (batch tested with PRs 46552, 46608, 46390, 46605, 46459)

Move admission lifecycle to genericapi

**What this PR does / why we need it**:  ends the whole sequence of moving some admission plugins to generic api.


**Release note**:

```release-note
NONE
```
2017-05-30 08:42:02 -07:00
Yu-Ju Hong c82350214e Group container-runtime-specific flags/options together
Do not store them in kubelet's configuration. Eventually, we would like
to deprecate all these flags as they should not be part of kubelet.
2017-05-30 08:10:39 -07:00
deads2k ce681fe47c move CRD from alpha to beta 2017-05-30 07:57:26 -04:00
Kubernetes Submit Queue a4e730336d Merge pull request #46566 from xychu/kube-apiserver
Automatic merge from submit-queue (batch tested with PRs 46561, 46566)

Fix golint errors in cmd/kube-apiserver

**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
```
2017-05-30 02:50:57 -07:00
Kubernetes Submit Queue e59fd18c16 Merge pull request #46428 from lixiaobing10051267/masterManifest
Automatic merge from submit-queue (batch tested with PRs 45327, 46217, 46377, 46428, 46588)

ommitting close file while testing manifest

ommitting close file while testing manifest.
2017-05-30 01:56:05 -07:00
Kubernetes Submit Queue b6c00aeb10 Merge pull request #46377 from noah8713/master
Automatic merge from submit-queue (batch tested with PRs 45327, 46217, 46377, 46428, 46588)

Fix comment typo in kube-apiserver and cachesize

**What this PR does / why we need it**:
Fix comment typo in files cmd/kube-apiserver/app/server.go and pkg/registry/cachesize/cachesize.go
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Not a major issue, just a minor improvement.
**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-30 01:56:03 -07:00
Kubernetes Submit Queue 82765ba3cf Merge pull request #46600 from fabriziopandini/kubeadm108
Automatic merge from submit-queue

Kubeadm - Make code OS-agnostic

**What this PR does / why we need it**:
Kubernetes just got Windows Containers alpha support, opening the opportunity for kubeadm to also be used to setup, at least, Windows Server 2016 or newer worker nodes. With that in mind, we should take the effort of writing OS-agnostic code whenever possible, e.g. when dealing with the filesystem.

**Which issue this PR fixes** 
https://github.com/kubernetes/kubeadm/issues/108

**Special notes for your reviewer**:

**Release note**:
2017-05-29 23:41:49 -07:00
p0lyn0mial 77eb2f3950 register all generic admission plugins when AdmissionOptions are created.
lifecycle plugin: make use of the libraries under k8s.io/client-go/pkg/api and k8s.io/client-go/kubernetes
for the client libraries instead of k8s.io/kubernetes/client/*

move registration to AdmissionOptions
2017-05-29 22:08:59 +02:00
Jacob Simpson 4c22e6bc6a Certificate rotation for kubelet server certs.
Replaces the current kubelet server side self signed certs with certs
signed by the Certificate Request Signing API on the API server. Also
renews expiring kubelet server certs as expiration approaches.
2017-05-29 12:28:01 -07:00
Kubernetes Submit Queue 34cd38e3ed Merge pull request #45699 from jianglingxia/jlx51210
Automatic merge from submit-queue (batch tested with PRs 45699, 46200, 46335, 46599)

modify the initialization statement

**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
```
2017-05-29 11:13:59 -07:00
fabriziopandini 7166f185be path.Join to filepath.Join 2017-05-29 19:15:04 +02:00
Dan Winship 0923f860f1 Regenerate files 2017-05-28 10:11:02 -04:00
Dan Winship 0683e55fc1 Add networking.k8s.io v1 API, with NetworkPolicy 2017-05-28 10:11:01 -04:00
Kubernetes Submit Queue c2667203e4 Merge pull request #45859 from DirectXMan12/refactor/protobuf-for-metrics
Automatic merge from submit-queue

Protobuf generation for k8s.io/metrics

This PR introduces protobuf generation for k8s.io/metrics.  Doing so required:

- fixing a bug in `go-to-protobuf` causing the `cast{key,value,type}` values to not be quoted when coming from struct tags (and not auto-injection by `go-to-protobuf` itself).
- Making sure the proto IDL in k8s.io/client-go had a package name of `k8s.io.client_go.xyz` and not `k8s.io.kubernetes.xyz`.

Additionally, I updated `go-to-protobuf` to skip functions and non-public types when composing the import list, which cuts down on the more bizarre imports in the IDL (like importing the sample API package in every IDL file because it contained `addToScheme`, like every other API package).

We use `castvalue` to force gogo-proto to realize that it should consider the value of the map which underlies `ResourceList` when calculating which imports need to be named.  Otherwise, it ignores the value's type, leading to compilation errors when it later can't find an import it assumed existed.  We accidentally didn't hit this in `k8s.io/kubernetes/pkg/api/v1` since another field coincidentally happens to directly use `resource.Quantity` (the value type of `ResourceList`).

**Release note**:
```release-note
NONE
```
2017-05-27 14:08:46 -07:00
Ethan Chu 048053d4cf Fix golint errors in cmd/kube-apiserver 2017-05-27 17:36:59 +08:00
Kubernetes Submit Queue b58c7ec456 Merge pull request #46554 from thockin/kubelet-masq-flag
Automatic merge from submit-queue (batch tested with PRs 46302, 44597, 44742, 46554)

Do not install do-nothing iptables rules

Deprecate kubelet non-masquerade-cidr.
Do not install iptables rules if it is set to 0.0.0.0/0.

Fixes #46553
2017-05-26 20:39:58 -07:00
Kubernetes Submit Queue fdb4fa689e Merge pull request #44742 from cheftako/aggregate
Automatic merge from submit-queue (batch tested with PRs 46302, 44597, 44742, 46554)

Change to aggregator so it calls a user apiservice via its pod IP.

proxy_handler now does a sideways call to lookup the pod IPs for aservice.
It will then pick a random pod IP to forward the use apiserver request to.

**What this PR does / why we need it**: It allows the aggregator to work without setting up the full network stack on the kube master (i.e. with kube-dns or kube-proxy)

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-05-26 20:39:56 -07:00
Kubernetes Submit Queue bf60e7e286 Merge pull request #46522 from MrHohn/fix-proxy-healthz
Automatic merge from submit-queue (batch tested with PRs 46252, 45524, 46236, 46277, 46522)

Add /healthz back to kube-proxy metrics server

Fixes #46447.

/healthz is removed from kube-proxy metrics server by #44968 and that breaks our upgrade test, which run 1.6 tests on 1.7 cluster. It seems harmless to continue holding /healthz on metrics server as well, so that we won't break other potential users.

/assign @bowei 
cc @dchen1107 

**Release note**:

```release-note
NONE
```
2017-05-26 19:48:04 -07:00
Tim Hockin 252646b8de Deprecate kubelet non-masquerade-cidr
Also do not install iptables rules if it is set to 0.0.0.0/0
2017-05-26 17:01:58 -07:00
Solly Ross 85c3ca1013 [go-to-protobuf] Quote tag cast{key,value,type}
When using a `cast{key,value,type}` that was injected via struct tag, we
need to make sure to quote the value when transfering it over to proto
tags.  Otherwise, it'll come through as unquoted, resulting in invalid
proto.

This was previously not a problem, since all values of `castkey` and
`casttype` were actually coming from the auto-injecting code which deals
with maps and aliases, which does correctly quote values.
2017-05-26 19:59:27 -04:00
Solly Ross 7b8e572d8a [go-to-protobuf] generate proto for k8s.io/metrics
This commit adds the `k8s.io/metrics` APIs to the list of packages for
which to generate protobuf.  Additionally, it adds
`k8s.io/client-go/pkg/apis/v1` as a non-generated (referenced) package.
2017-05-26 19:59:27 -04:00
Solly Ross fb40658f9d [go-to-protobuf] Skip private types and functions
Since go-to-protobuf doesn't care about functions or private types (only
public types), we can skip them.  This helps to clean up the generated
IDL: previously, the IDL contained erroneous imports due to matching
functions and private types which were not actually converted to protobuf,
but which were the same as functions and private types in other packages.
2017-05-26 19:59:06 -04:00
Walter Fender ad8a83a7c1 Change to aggregator so it calls a user apiservice via its pod IP.
proxy_handler now uses the endpoint router to map the cluster IP to
appropriate endpoint (Pod) IP for the given resource.
Added code to allow aggregator routing to be optional.
Updated bazel build.
Fixes to cover JLiggit comments.
Added util ResourceLocation method based on Listers.
Fixed issues from verification steps.
Updated to add an interface to obfuscate some of the routing logic.
Collapsed cluster IP resolution in to the aggregator routing
implementation.
Added 2 simple unit tests for ResolveEndpoint
2017-05-26 16:10:01 -07:00
Kubernetes Submit Queue 3be6879bde Merge pull request #46440 from deads2k/crd-03-invert
Automatic merge from submit-queue (batch tested with PRs 42256, 46479, 45436, 46440, 46417)

move CRD behind TPR

Second attempt at https://github.com/kubernetes/kubernetes/pull/46297

@liggitt since @sttts is out can you take a look and hopefully find me a different, more sane way to do this? It's a little crazy, but I left a large comment explaining why I think its the only way.
2017-05-26 15:59:03 -07:00
Kubernetes Submit Queue 7bc6da0b77 Merge pull request #46294 from caesarxuchao/dynamic-registration-prototype
Automatic merge from submit-queue (batch tested with PRs 46383, 45645, 45923, 44884, 46294)

Dynamic registration prototype

Implementing the api proposed in https://github.com/kubernetes/community/pull/611.
Wiring the code to serve the api via apiserver.
```release-note
Adding admissionregistration API group which enables dynamic registration of initializers and external admission webhooks. It is an alpha feature.
```
2017-05-26 12:58:07 -07:00
Zihong Zheng ad437e9ce2 Add /healthz back to kube-proxy metrics server 2017-05-26 11:53:43 -07:00
Kubernetes Submit Queue bcad534ebc Merge pull request #46058 from jcbsmpsn/configure-certificate-duration
Automatic merge from submit-queue

Add support for specifying certificate duration at runtime.
2017-05-26 11:02:03 -07:00
deads2k 18177e2bde move CRD behind TPR 2017-05-26 12:15:13 -04:00
Kubernetes Submit Queue 58167fcfa1 Merge pull request #46202 from lixiaobing10051267/masterServerTest
Automatic merge from submit-queue

print the name of invalid host to help to fix the bug

print the name of invalid host to help to fix the bug.
2017-05-26 02:34:50 -07:00
lixiaobing1 a78eeebe2d print the name of invalid host to help to fix the bug 2017-05-26 16:14:37 +08:00
Chao Xu bc9b305f17 generated clients 2017-05-26 00:03:53 -07:00
Chao Xu 1500017111 go-to-protobuf take care of admissionregistration 2017-05-25 23:55:15 -07:00
Kubernetes Submit Queue 5e853709a7 Merge pull request #46089 from karataliu/wincri1
Automatic merge from submit-queue (batch tested with PRs 46124, 46434, 46089, 45589, 46045)

Support TCP type runtime endpoint for kubelet

**What this PR does / why we need it**:
Currently the grpc server for kubelet and dockershim has a hardcoded endpoint: unix socket '/var/run/dockershim.sock', which is not applicable on non-unix OS.

This PR is to support TCP endpoint type besides unix socket.

**Which issue this PR fixes** 
This is a first attempt to address issue https://github.com/kubernetes/kubernetes/issues/45927

**Special notes for your reviewer**:
Before this change, running on Windows node results in:
```
Container Manager is unsupported in this build
```

After adding the cm stub, error becomes:
```
listen unix /var/run/dockershim.sock: socket: An address incompatible with the requested protocol was used.
```

This PR is to fix those two issues.

After this change, still meets 'seccomp' related issue when running on Windows node, needs more updates later.

**Release note**:
2017-05-25 21:40:02 -07:00
Andy Goldstein 78a4c8e95a Up namespace controller workers to 5
Increase the number of namespace controller workers from 2 to 5 in an
effort to speed up namespace deletions.
2017-05-25 09:47:47 -04:00
lixiaobing1 b17e0a2876 ommitting close file while testing manifest 2017-05-25 17:08:58 +08:00
zhangxiaoyu-zidif 8e0add42f3 hollow-node.go:delete useless para. and import 2017-05-25 12:54:01 +08:00
Dong Liu fb26c9100a Support TCP type runtime endpoint for kubelet. 2017-05-25 09:16:11 +08:00
Ginwala 28a0e2621b Fix comment typo in kube-apiserver and cachesize 2017-05-24 13:41:33 -07:00
Jacob Simpson 07e9b0e197 Add support for specifying certificate duration at runtime. 2017-05-24 13:29:46 -07:00
Kubernetes Submit Queue 1153ef19ce Merge pull request #45635 from MrHohn/hyperkube-unit-test
Automatic merge from submit-queue (batch tested with PRs 45514, 45635)

hyperkube_test should not depend on number of spaces.

From #45524.

Apparently adding a long flag to kube-controller-manager breaks the hyperkube unit tests, because they depend on number of spaces :)

**Release note**:

```release-note
NONE
```
2017-05-23 20:52:56 -07:00
Kubernetes Submit Queue 5be7a6a73e Merge pull request #45514 from mikedanese/cert-refactor
Automatic merge from submit-queue (batch tested with PRs 45514, 45635)

refactor certificate controller to break it into two parts

Break pkg/controller/certificates into:
* pkg/controller/certificates/approver: containing the group approver
* pkg/controller/certificates/signer: containing the local signer
* pkg/controller/certificates: containing shared infrastructure
```release-note
Break the 'certificatesigningrequests' controller into a 'csrapprover' controller and 'csrsigner' controller.
```
2017-05-23 20:52:53 -07:00
Kubernetes Submit Queue 95a6f108bd Merge pull request #46289 from p0lyn0mial/admission_plugins_remove_init_blocks
Automatic merge from submit-queue

remove init blocks from all admission plugins

**What this PR does / why we need it**:
removes init blocks from all admission plugins

**Release note**:

```release-note
NONE
```
2017-05-23 17:00:59 -07:00
Kubernetes Submit Queue 45b275d52c Merge pull request #45897 from ncdc/gc-require-list-watch
Automatic merge from submit-queue (batch tested with PRs 46149, 45897, 46293, 46296, 46194)

GC: update required verbs for deletable resources, allow list of ignored resources to be customized

The garbage collector controller currently needs to list, watch, get,
patch, update, and delete resources. Update the criteria for
deletable resources to reflect this.

Also allow the list of resources the garbage collector controller should
ignore to be customizable, so downstream integrators can add their own
resources to the list, if necessary.

cc @caesarxuchao @deads2k @smarterclayton @mfojtik @liggitt @sttts @kubernetes/sig-api-machinery-pr-reviews
2017-05-23 15:48:57 -07:00
Mike Danese f04ce3cfba refactor certificate controller 2017-05-23 15:25:58 -07:00
Kubernetes Submit Queue 3ff99a8381 Merge pull request #46149 from cjcullen/logtoggle
Automatic merge from submit-queue

Allow the /logs handler on the apiserver to be toggled.

Adds a flag to kube-apiserver, and plumbs through en environment variable in configure-helper.sh
2017-05-23 15:19:08 -07:00
p0lyn0mial c5019bf696 remove init blocks from all admission plugins 2017-05-23 22:00:32 +02:00
Andy Goldstein d1a0384678 GC: allow ignored resources to be customized
Allow the list of resources the garbage collector controller should
ignore to be customizable, so downstream integrators can add their own
resources to the list, if necessary.
2017-05-23 12:05:09 -04:00
Andy Goldstein d30fb0d9d5 GC: update required verbs for deletable resources
The garbage collector controller currently needs to list, watch, get,
patch, update, and delete resources. Update the criteria for
deletable resources to reflect this.
2017-05-23 12:00:10 -04:00
Dong Liu 1c4f95a80c Remove duplicate error message output in hyperkube. 2017-05-23 17:02:59 +08:00
Kubernetes Submit Queue cc6e51c6e8 Merge pull request #45427 from ncdc/gc-shared-informers
Automatic merge from submit-queue (batch tested with PRs 46201, 45952, 45427, 46247, 46062)

Use shared informers in gc controller if possible

Modify the garbage collector controller to try to use shared informers for resources, if possible, to reduce the number of unique reflectors listing and watching the same thing.

cc @kubernetes/sig-api-machinery-pr-reviews @caesarxuchao @deads2k @liggitt @sttts @smarterclayton @timothysc @soltysh @kargakis @kubernetes/rh-cluster-infra @derekwaynecarr @wojtek-t @gmarek
2017-05-22 20:58:03 -07:00
Kubernetes Submit Queue c6cf666fa1 Merge pull request #45308 from fabianofranz/more_cmd_sanity_checks
Automatic merge from submit-queue (batch tested with PRs 46022, 46055, 45308, 46209, 43590)

More cli sanity verifications

Adds some more `kubectl` command sanity checks to improve consistency and avoid the need of code reviews for some of our CLI style and standards.

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cli-pr-reviews
2017-05-22 19:59:59 -07:00
Kubernetes Submit Queue bb56937b92 Merge pull request #46055 from deads2k/crd-01-embed
Automatic merge from submit-queue (batch tested with PRs 46022, 46055, 45308, 46209, 43590)

embed kube-apiextensions inside of kube-apiserver

To reduce operation complexity, we decided to include the kube-apiextensions-server inside of kube-apiserver (https://github.com/kubernetes/community/blob/master/sig-api-machinery/api-extensions-position-statement.md#q-should-kube-aggregator-be-a-separate-binaryprocess-than-kube-apiserver).  With the API reasonably well established and a finalizer about merge, I think its time to add ourselves.

This pull wires kube-apiextensions-server ahead of the TPRs so that one will replace the other if both are added by accident (CRDs should have priority) and wires a controller for automatic aggregation.

WIP because I still need tests: unit test for controller, test-cmd test to mirror the TPR test.


```release-note
Adds the `CustomResourceDefinition` (crd) types to the `kube-apiserver`.  These are the successors to `ThirdPartyResource`.  See https://github.com/kubernetes/community/blob/master/contributors/design-proposals/thirdpartyresources.md for more details.
```
2017-05-22 19:59:57 -07:00
Michelle Au dd46c7f88e Local volume plugin 2017-05-22 14:44:51 -07:00
CJ Cullen 9dca164ddd Allow the /logs handler on the apiserver to be toggled.
Change-Id: Ibf173b7f85cf7fffe8482eaee74fb77da2b2588b
2017-05-22 14:37:24 -07:00
Andy Goldstein 2480f2ceb6 Use shared informers in gc controller if possible 2017-05-22 12:51:37 -04:00
deads2k 446e959bf7 make CRD apiservice controller 2017-05-22 08:54:14 -04:00
deads2k a637c49c8d embed apiextensions server into kube-apiserver 2017-05-22 08:53:07 -04:00
Cao Shufeng 9710eb62ae validate oidc flags
This change validate oidc flags for kube-apiserver.
2017-05-22 18:03:28 +08:00
Clayton Coleman 784e3ae5fa
Switch the tokens controller to use shared informers
Tokens controller previously needed a bit of extra help in order to be
safe for concurrent use. The new MutationCache allows it to keep a local
cache and still use a shared informer. The filtering event handler lets
it only see changes to secrets it cares about.
2017-05-20 14:19:49 -04:00
x1957 5e09714076 fixtypo seperated -> separated 2017-05-20 20:16:20 +08:00
Kubernetes Submit Queue af5d057339 Merge pull request #46018 from YuPengZTE/devBaseCommand
Automatic merge from submit-queue (batch tested with PRs 46033, 46122, 46053, 46018, 45981)

ineffectual assignment to baseCommand, delete it

Signed-off-by: yupengzte <yu.peng36@zte.com.cn>



**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
```
2017-05-19 23:29:30 -07:00
Kubernetes Submit Queue 078d820de9 Merge pull request #46122 from ncdc/kube-proxy-version-flag
Automatic merge from submit-queue (batch tested with PRs 46033, 46122, 46053, 46018, 45981)

Restore kube-proxy --version

Accidentally removed by #34727.

Fixes #46026
2017-05-19 23:29:26 -07:00
Kubernetes Submit Queue 4f55f49035 Merge pull request #46042 from derekwaynecarr/quota-admission-registry
Automatic merge from submit-queue (batch tested with PRs 45346, 45903, 45958, 46042, 45975)

ResourceQuota admission control injects registry

**What this PR does / why we need it**:
The `ResourceQuota` admission controller works with a registry that maps a GroupKind to an Evaluator.  The registry used in the existing plug-in is not injectable, which makes usage of the ResourceQuota plug-in in other API server contexts difficult.  This PR updates the code to support late injection of the registry via a plug-in initializer.
2017-05-19 22:29:34 -07:00
Andy Goldstein f51c2c445c Restore kube-proxy --version 2017-05-19 14:40:35 -04:00
Jeremy Whitlock 1b59dd887d add "admission" API group
This commit is an initial pass at providing an admission API group.
The API group is required by the webhook admission controller being
developed as part of https://github.com/kubernetes/community/pull/132
and could be used more as that proposal comes to fruition.
2017-05-19 10:17:37 -06:00
Kubernetes Submit Queue 9a5694b4c4 Merge pull request #45908 from ncdc/kube-proxy-write-config
Automatic merge from submit-queue

kube-proxy: add --write-config-to flag

Add --write-config-to flag to kube-proxy to write the default configuration
values to the specified file location.

@deads2k suggested I create my own scheme for this, so I followed the example he shared with me. The only bit currently still referring to `api.Scheme` is where we create the event broadcaster recorder. In order to use the custom private scheme, I either have to pass it in to `NewProxyServer()`, or I have to make `NewProxyServer()` a member of the `Options` struct. If the former, then I probably need to export `Options.scheme`. Thoughts?

cc @mikedanese @sttts @liggitt @deads2k @smarterclayton @timothysc @kubernetes/sig-network-pr-reviews @kubernetes/sig-api-machinery-pr-reviews 

```release-note
Add --write-config-to flag to kube-proxy to allow users to write the default configuration settings to a file.
```
2017-05-19 09:01:04 -07:00
Kubernetes Submit Queue ead8c98cdb Merge pull request #45987 from nicksardo/cloud-init-kubeclient
Automatic merge from submit-queue

Initialize cloud providers with a K8s clientBuilder

**What this PR does / why we need it**:
This PR provides each cloud provider the ability to generate kubernetes clients. Either the full access or service account client builder is passed from the controller manager. Cloud providers could need to retrieve information from the cluster that isn't provided through defined interfaces, and this seems more preferable to adding parameters.

Please leave your thoughts/comments.

**Release note**:
```release-note
NONE
```
2017-05-18 20:51:24 -07:00
Derek Carr a71bea312a ResourceQuota admission control injects registry 2017-05-18 23:17:13 -04:00
Kubernetes Submit Queue a9fbeef694 Merge pull request #45929 from liggitt/node-admission
Automatic merge from submit-queue (batch tested with PRs 41535, 45985, 45929, 45948, 46056)

NodeRestriction admission plugin

Adds an optional `NodeRestriction` admission plugin that limits identifiable kubelets to mutating their own Node object, and Pod objects bound to their node.

This is the admission portion of https://github.com/kubernetes/community/blob/master/contributors/design-proposals/kubelet-authorizer.md and kubernetes/features#279

```release-note
The `NodeRestriction` admission plugin limits the `Node` and `Pod` objects a kubelet can modify. In order to be limited by this admission plugin, kubelets must use credentials in the `system:nodes` group, with a username in the form `system:node:<nodeName>`. Such kubelets will only be allowed to modify their own `Node` API object, and only modify `Pod` API objects that are bound to their node.
```
2017-05-18 19:58:13 -07:00
Kubernetes Submit Queue 8214f7bb29 Merge pull request #45839 from caesarxuchao/client-gen-vendor
Automatic merge from submit-queue

let client-gen understand vendor

This is extracted from #44784, where we move external api types to k8s.io/api. After the move, the types will locate at vendor/k8s.io/api/xxx. However, gengo index the parsed package using the import path, which is stripped of  the vendor/ prefix, so we'll need to strip the vendor/ prefix as necessary in client-gen.

This PR doesn't produce any change to the generated clientset yet since all types are still in the kubernetes repo.
2017-05-18 17:45:35 -07:00
Jordan Liggitt 6fd36792f1
Add NodeRestriction admission plugin 2017-05-18 16:43:42 -04:00
Matt Liggett 00e6de099e Log more verbose when DisruptionController doesn't start.
To help with debugging #45706
2017-05-18 13:19:06 -07:00
Fabiano Franz 3bb04c67cc More cli sanity verifications 2017-05-18 15:44:49 -03:00
Kubernetes Submit Queue d775ff4c3a Merge pull request #45982 from fabianofranz/more_sig_cli_owners
Automatic merge from submit-queue

More owners from SIG-CLI

Adds SIG-CLI as reviewers and approvers of `cmd/clicheck/` and adds me + @pwittrock as approvers in `hack/` (mostly for `test-cmd` and some `hack/verify*.sh` and `hack/update*.sh` scripts).

**Release note**:

```release-note
NONE
```
2017-05-18 10:17:22 -07:00
Kubernetes Submit Queue 2ff902b672 Merge pull request #45937 from smarterclayton/init_api
Automatic merge from submit-queue

Add initializers to ObjectMeta and a new filter on ListOptions

Will support admission extension by allowing controllers to interact with objects before they are visible to the rest of the API.

Part of https://github.com/kubernetes/community/blob/master/contributors/design-proposals/admission_control_extension.md
2017-05-18 10:17:15 -07:00
Kubernetes Submit Queue a1c2db2fec Merge pull request #45950 from shyamjvs/revert-proxier
Automatic merge from submit-queue

Make real proxier in hollow-proxy optional (default=true)

Ref https://github.com/kubernetes/kubernetes/pull/45622
This allows using real proxier for hollow proxy, but we use the fake one by default.

cc @kubernetes/sig-scalability-misc @wojtek-t @gmarek
2017-05-18 07:55:09 -07:00
Andy Goldstein 032e2f6652 kube-proxy: add --write-config flag
Add --write-config flag to kube-proxy to write the default configuration
values to the specified file location.
2017-05-18 10:34:22 -04:00
Clayton Coleman bdd4d34c7d
generated: api changes 2017-05-18 10:07:47 -04:00
Shyam Jeedigunta 804a4f558c Make usage of real proxier in hollow-proxy optional (default=true) 2017-05-18 14:30:12 +02:00
yupengzte b38be58a39 ineffectual assignment to baseCommand, delete it
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
2017-05-18 15:56:07 +08:00
Nick Sardo 87a5edd2cd Initialize cloud providers with a K8s clientBuilder 2017-05-17 14:38:25 -07:00
Kubernetes Submit Queue 9a9a296556 Merge pull request #45889 from wojtek-t/kube_proxy_handlers
Automatic merge from submit-queue (batch tested with PRs 45953, 45889)

Add /metrics and profiling handlers to kube-proxy

Also expose "syncProxyRules latency" as a prometheus metrics.

Fix https://github.com/kubernetes/kubernetes/issues/45876
2017-05-17 13:56:47 -07:00
Fabiano Franz e4953081f7 More owners from SIG-CLI 2017-05-17 15:46:34 -03:00
Wojciech Tyczynski 45ed99c3a6 Add syncProxyRules prometheus metric 2017-05-17 19:26:58 +02:00
Wojciech Tyczynski e35b1c21a1 Expose /metrics and /debug/pprof from kube-proxy 2017-05-17 19:23:58 +02:00
Michael Taufen 2ee2ec5e21 Remove the deprecated --babysit-daemons kubelet flag 2017-05-17 09:08:57 -07:00
Kubernetes Submit Queue 6f4e0b66a7 Merge pull request #44685 from smarterclayton/serverside_get_api
Automatic merge from submit-queue (batch tested with PRs 44520, 45253, 45838, 44685, 45901)

API for server side tabular output

These are the APIs necessary to implement propsoal kubernetes/community#363

They consist of a new meta group (v1alpha1) that indicates these are alpha apis for the server as a whole, a new kind `TableList` which is a simple row + header arranged table capable of returning both object and columnar data, a `TableListOptions` for altering the behavior of the return, and `PartialObjectMetadata` which is an "interface" style API object which allows a client to ask any object for their metadata (without having to know how to parse the object or perform gymnastics).

Extracted from #40848

A few minor tweaks still required.
2017-05-16 21:28:00 -07:00
Chao Xu bd6a9604dc generated 2017-05-16 20:40:04 -07:00
Chao Xu 9288025c28 let client-gen understand vendor 2017-05-16 20:29:38 -07:00
Kubernetes Submit Queue 3f0ebbe884 Merge pull request #45247 from mbohlool/c3
Automatic merge from submit-queue (batch tested with PRs 45247, 45810, 45034, 45898, 45899)

Apiregistration v1alpha1→v1beta1

Promoting apiregistration api from v1alpha1 to v1beta1.

API Registration is responsible for registering an API `Group`/`Version` with
another kubernetes like API server. The `APIService` holds information
about the other API server in `APIServiceSpec` type as well as general
`TypeMeta` and `ObjectMeta`. The `APIServiceSpec` type have the main
configuration needed to do the aggregation. Any request coming for
specified `Group`/`Version` will be directed to the service defined by
`ServiceReference` (on port 443) after validating the target using provided
`CABundle` or skipping validation if development flag `InsecureSkipTLSVerify`
is set. `Priority` is controlling the order of this API group in the overall
discovery document.
The return status is a set of conditions for this aggregation. Currently
there is only one condition named "Available", if true, it means the
api/server requests will be redirected to specified API server.

```release-note
API Registration is now in beta.
```
2017-05-16 19:01:55 -07:00
Kubernetes Submit Queue 7f92d35f1c Merge pull request #45739 from timothysc/cm_lock
Automatic merge from submit-queue (batch tested with PRs 45374, 44537, 45739, 44474, 45888)

Allow kcm and scheduler to lock on ConfigMaps.

**What this PR does / why we need it**:
Plumbs through the ability to lock on ConfigMaps through the kcm and scheduler.  

**Which issue this PR fixes** 
Fixes: #44857
Addresses issues with: #45415

**Special notes for your reviewer**:

**Release note**:

```
Add leader-election-resource-lock support to kcm and scheduler to allow for locking on ConfigMaps as well as Endpoints(default) 
```
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews @jamiehannaford @bsalamat @mikedanese
2017-05-16 18:10:57 -07:00
Kubernetes Submit Queue ece4124e17 Merge pull request #45355 from p0lyn0mial/admission_options_spits_out_admission_control
Automatic merge from submit-queue (batch tested with PRs 45408, 45355, 45528)

Admission options spits out admission control

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

This PR adds ApplyTo method to AdmissionOptions struct. The method creates and initialises admission control to the server configuration.

**Release note**:

```
NONE
```
2017-05-16 09:11:54 -07:00
Kubernetes Submit Queue 560323ad9b Merge pull request #45389 from monopole/isolation1
Automatic merge from submit-queue (batch tested with PRs 45835, 45389)

Introduce visibility rules to kubernetes code.

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

Use rules to identify "bad" dependencies on kubectl code for later refactoring or removal, and prevent their reintroduction.

**Which issue this PR fixes**

First in a series of PRs to address kubernetes/community#598

**Release note**:
```release-note
NONE
```
2017-05-15 19:34:52 -07:00
Kubernetes Submit Queue e50ba62aa5 Merge pull request #45835 from ncdc/client-gen-more-groupName-override
Automatic merge from submit-queue (batch tested with PRs 45835, 45389)

client-gen: honor groupName overrides in customArgs

If there is a comment of the form "// +groupName=somegroup" or
"// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as
the name of the group in customArgs.GroupVersions and
customArgs.GroupVersionToInputPath.

@deads2k this lets OpenShift generate the correct group names for pkg/deploy (groupName=apps) and pkg/sdn (groupName=network), although we still need your hack to specify `--group`.

cc @smarterclayton @liggitt @sttts @kubernetes/sig-api-machinery-pr-reviews
2017-05-15 19:34:49 -07:00
Kubernetes Submit Queue 521d7d1ac5 Merge pull request #42472 from timchenxiaoyu/requesttypo
Automatic merge from submit-queue

fix request typo
2017-05-15 15:57:57 -07:00
mbohlool e2f20a3539 Promote apiregistration from v1alpha1 to v1beta1 2017-05-15 15:34:33 -07:00
Kubernetes Submit Queue 682f3a39a0 Merge pull request #45171 from ncdc/groupName-override
Automatic merge from submit-queue

Use groupName comment for listers/informers

If present, use the "// +groupName" doc comment as the desired group
name when generating listers and informers.

@kubernetes/sig-api-machinery-pr-reviews @smarterclayton @deads2k @liggitt @sttts
2017-05-15 14:14:21 -07:00
Andy Goldstein 84da322766 client-gen: honor groupName overrides in customArgs
If there is a comment of the form "// +groupName=somegroup" or
"// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as
the name of the group in customArgs.GroupVersions and
customArgs.GroupVersionToInputPath.
2017-05-15 16:52:09 -04:00
Jeffrey Regan 7abff879d7 Introduce visibility rules to kubernetes code.
**What this PR does / why we need it**:

Visibility rules allow dependency control.  The rules currently in
place make all targets public, to override the default state of
private.  This PR removes public visibility from kubectl code.  It
uses specially named pacakge groups to identify "bad" dependencies on
kubectl code for later refactoring or removal.

**Which issue this PR fixes**

First in a series of PRs to address kubernetes/community#598

**Release note**:
```release-note
NONE
```
2017-05-15 12:50:56 -07:00
Kubernetes Submit Queue c924414b1f Merge pull request #45548 from justinsb/fix_typo_ss_controller
Automatic merge from submit-queue (batch tested with PRs 45826, 45747, 45548, 45606, 41766)

Fix typo in name of ss controller
2017-05-15 11:39:24 -07:00
Timothy St. Clair 1173c84ad9 Update to plumb through configurable locking on different resource types. 2017-05-15 10:01:46 -05:00
Clayton Coleman c299a8049c
Add Table to meta.k8s.io/v1alpha1
Table is a generic tabular output that can be returned by servers to
enable clients to display data simply.
2017-05-15 10:50:49 -04:00
Jamie Hannaford a2248a2bcd Add lock type flags for controller-manager leadership election 2017-05-15 08:42:15 -05:00
p0lyn0mial 8cea69aa98 This PR implements AdmissionOptions.ApplyTo
ApplyTo adds the admission chain to the server configuration the method lazily initializes a generic plugin
that is appended to the list of pluginInitializers.

apiserver.Config will hold an instance of SharedInformerFactory to ensure we only have once instance.
The field will be initialized in apisever.SecureServingOptions
2017-05-14 10:30:19 +02:00
Kubernetes Submit Queue abaffb243e Merge pull request #45692 from caesarxuchao/limit-client-go-package-import-2
Automatic merge from submit-queue (batch tested with PRs 44748, 45692)

Limiting client go packages visibility, round 3

Continue the work in the merged PR https://github.com/kubernetes/kubernetes/pull/45258

These packages in client-go will be gone after #44065 is fixed:
pkg/api/helper, pkg/api/util, internal version of api groups, API install packages. 

This PR removes the dependency on these packages and add bazel visibility rules to prevent relapse.
2017-05-12 16:04:37 -07:00
Michael Taufen 93f392251c Mark kubelet's master-service-namespace flag deprecated
This flag is already deprecated in the API server:
- https://kubernetes.io/docs/admin/kube-apiserver/
- https://kubernetes.io/docs/admin/federation-apiserver/
2017-05-12 06:37:48 -07:00
Kubernetes Submit Queue 3b9a90ae79 Merge pull request #45684 from bowei/kube-dns-update
Automatic merge from submit-queue

Update kube-dns version to 1.14.2

```release-note
Updates kube-dns to 1.14.2

- Support kube-master-url flag without kubeconfig
- Fix concurrent R/Ws in dns.go
- Fix confusing logging when initialize server
- Fix printf in cmd/kube-dns/app/server.go
- Fix version on startup and --version flag
- Support specifying port number for nameserver in stubDomains
```
2017-05-12 03:13:38 -07:00
Kubernetes Submit Queue a126f40c58 Merge pull request #45622 from shyamjvs/mock-proxy
Automatic merge from submit-queue (batch tested with PRs 45571, 45657, 45638, 45663, 45622)

Use real proxier inside hollow-proxy but with mocked syscalls

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

This should make hollow-proxy better mimic the real kube-proxy in performance.
Maybe next we should have a more realistic implementation even for fake iptables (adding/updating/deleting rules/chains in an table, just not on the real one)? Though I'm not sure how important it is.

cc @kubernetes/sig-scalability-misc @kubernetes/sig-network-misc @wojtek-t @gmarek
2017-05-12 02:28:43 -07:00
jianglingxia 2d9b71d122 modify the initialization statement 2017-05-12 10:55:14 +08:00
Hemant Kumar 9a1a9cbe08 detach the volume when pod is terminated
Make sure volume is detached when pod is terminated because
of any reason and not deleted from api server.
2017-05-11 22:18:22 -04:00
Chao Xu 14045d253d hack/update-bazel.sh 2017-05-11 15:59:04 -07:00
Chao Xu c354076aa4 remove invocation of k8s.io/client-go/pkg/api/install
change import of client-go/api/helper to kubernetes/api/helper

remove unnecessary use of client-go/api.registry

change use of client-go/pkg/util to kubernetes/pkg/util

remove dependency on client-go/pkg/apis/extensions

remove unnecessary invocation of k8s.io/client-go/extension/intsall

change use of k8s.io/client-go/pkg/apis/authentication to v1
2017-05-11 15:03:46 -07:00
Bowei Du 1c223c8e1b Update kube-dns version to 1.14.2
Changes:

- Support kube-master-url flag without kubeconfig
- Fix concurrent R/Ws in dns.go
- Fix confusing logging when initialize server
- Fix printf in cmd/kube-dns/app/server.go
- Fix version on startup and --version flag
- Support specifying port number for nameserver in stubDomains
2017-05-11 12:29:00 -07:00
deads2k be39283923 plumb stopch to post start hook index since many of them are starting go funcs 2017-05-11 09:16:13 -04:00
Kubernetes Submit Queue 640373da10 Merge pull request #45641 from xilabao/update-token-ttl-description
Automatic merge from submit-queue (batch tested with PRs 44626, 45641)

update token ttl description
2017-05-11 03:59:38 -07:00
xilabao 7f5e8fdedd update token ttl description 2017-05-11 15:23:57 +08:00
Zihong Zheng 868edcb231 hyperkube_test should not depends on number of spaces. 2017-05-10 22:18:51 -07:00
Kubernetes Submit Queue 1f3b158a10 Merge pull request #45194 from yujuhong/rm-cri-flag
Automatic merge from submit-queue

Remove the deprecated `--enable-cri` flag

Except for rkt, CRI is the default and only integration point for
container runtimes.

```release-note
Remove the deprecated `--enable-cri` flag. CRI is now the default, 
and the only way to integrate with kubelet for the container runtimes.
```
2017-05-10 20:46:24 -07:00
Kubernetes Submit Queue a48cfe9fe5 Merge pull request #45384 from caesarxuchao/copy-metrics-interanl
Automatic merge from submit-queue (batch tested with PRs 45382, 45384, 44781, 45333, 45543)

Copy internal types to metrics

Supersedes #45306. 

#45306 removed the internal types and suggested whoever needs the internal types should define their own copy, and use the code-gen tools to generated the conversion functions. Per offline discussion with @DirectXMan12, we wanted to go that direction but it's not clear where to put the internal types yet. Hence, as a temporary solution, we decided copy the referred client-go/pkg/api types into metrics api to avoid the dependency.

The commit "remove need of registry from custom_metrics/client.go" is similar to what I did to the fake client in an earlier PR. Let me know if you want to put the commit in another PR.
2017-05-10 17:47:41 -07:00
Shyam Jeedigunta 27fa52390b Use real proxier inside hollow-proxy but with mocked syscalls 2017-05-10 23:45:26 +02:00
Yu-Ju Hong daa329c9ae Remove the deprecated `--enable-cri` flag
Except for rkt, CRI is the default and only integration point for
container runtimes.
2017-05-10 13:03:41 -07:00
Kubernetes Submit Queue bfa18037ce Merge pull request #45404 from wojtek-t/edge_based_winuserspace_proxy
Automatic merge from submit-queue

Edge based winuserspace proxy

Last PR in the series of making kube-proxy event-based.

This is a sibling PR to https://github.com/kubernetes/kubernetes/pull/45356 that is already merged.
The second commit is removing the code that is no longer used.
2017-05-10 12:51:43 -07:00
Kubernetes Submit Queue 77b2e6302c Merge pull request #45236 from verb/sharedpid-2-default
Automatic merge from submit-queue

Enable shared PID namespace by default for docker pods

**What this PR does / why we need it**: This PR enables PID namespace sharing for docker pods by default, bringing the behavior of docker in line with the other CRI runtimes when used with docker >= 1.13.1.

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

**Special notes for your reviewer**: cc @dchen1107 @yujuhong 

**Release note**:

```release-note
Kubernetes now shares a single PID namespace among all containers in a pod when running with docker >= 1.13.1. This means processes can now signal processes in other containers in a pod, but it also means that the `kubectl exec {pod} kill 1` pattern will cause the pod to be restarted rather than a single container.
```
2017-05-10 12:06:01 -07:00
Solly Ross 1cbc825fb9 [client-gen] Support Read-Only APIs
This commit adds support for read-only APIs to client-gen.
If the tag `// +readonly=true` is used, only the {Get,List,Watch}
client methods will be generated.
2017-05-10 13:33:18 -04:00
Solly Ross 392b8da1d0 [client-gen] Allow overriding the resource name
This commit allows client-gen to generate clients where the resource
name does not directly correspond to the type name.

The tag `// +resourceName=<name>` can be used to override the resource
name.
2017-05-10 13:33:17 -04:00
Wojciech Tyczynski ce752e3fc9 Remove no-longer used code in proxy/config 2017-05-10 12:16:35 +02:00
Wojciech Tyczynski 57d35d5acb Switch winuserspace proxy to be event based for services 2017-05-10 12:14:37 +02:00
Chao Xu a5fd6b91e7 generated 2017-05-09 21:28:39 -07:00
Kubernetes Submit Queue 51a3413371 Merge pull request #45307 from yujuhong/mv-docker-client
Automatic merge from submit-queue (batch tested with PRs 45453, 45307, 44987)

Migrate the docker client code from dockertools to dockershim

Move docker client code from dockertools to dockershim/libdocker. This includes
DockerInterface (renamed to Interface), FakeDockerClient, etc.

This is part of #43234
2017-05-09 20:23:44 -07:00
Kubernetes Submit Queue 61593ba8b8 Merge pull request #45453 from k82cn/k8s_45220
Automatic merge from submit-queue (batch tested with PRs 45453, 45307, 44987)

Init cache with assigned non-terminated pods before scheduling

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

**Release note**:

```release-note
The fix makes scheduling go routine waiting for cache (e.g. Pod) to be synced.
```
2017-05-09 20:23:37 -07:00
Chao Xu b5a41e770a remove unnecessary call to metrics install package
remove init and reference to client-go/api from metrcis install package
2017-05-09 18:05:22 -07:00
Kubernetes Submit Queue f8f9d7db93 Merge pull request #45304 from deads2k/controller-03-ns-discovery
Automatic merge from submit-queue (batch tested with PRs 45304, 45006, 45527)

increase the QPS for namespace controller

The namespace controller is really chatty. Especially to discovery since that involves two requests for every API version available. This bumps the QPS and burst on the namespace controller to avoid being stuck waiting.
2017-05-09 12:04:41 -07:00
Klaus Ma c78faec4ff Initialize scheduler cache with assigned non-terminated pods before scheduling. 2017-05-10 01:50:38 +08:00
Justin Santa Barbara a88a0abbdb Fix typo in name of ss controller
Typo, but I presume also we're intending to allow control of individual
controllers, so the name does matter.
2017-05-09 11:31:06 -04:00
Kubernetes Submit Queue a062782524 Merge pull request #44258 from wlan0/master
Automatic merge from submit-queue (batch tested with PRs 45508, 44258, 44126, 45441, 45320)

cloud initialize node in external cloud controller

@thockin This PR adds support in the `cloud-controller-manager` to initialize nodes (instead of kubelet, which did it previously)

This also adds support in the kubelet to skip node cloud initialization when `--cloud-provider=external`

Specifically,

Kubelet

1. The kubelet has a new flag called `--provider-id` which uniquely identifies a node in an external DB
2. The kubelet sets a node taint - called "ExternalCloudProvider=true:NoSchedule" if cloudprovider == "external"

Cloud-Controller-Manager

1. The cloud-controller-manager listens on "AddNode" events, and then processes nodes that starts with that above taint. It performs the cloud node initialization steps that were previously being done by the kubelet.
2. On addition of node, it figures out the zone, region, instance-type, removes the above taint and updates the node.
3. Then periodically queries the cloudprovider for node addresses (which was previously done by the kubelet) and updates the node if there are new addresses

```release-note
NONE  
```
2017-05-08 16:34:43 -07:00
Kubernetes Submit Queue 332b095ca9 Merge pull request #44968 from MrHohn/kube-proxy-healthcheck
Automatic merge from submit-queue (batch tested with PRs 44727, 45409, 44968, 45122, 45493)

Separate healthz server from metrics server in kube-proxy

From #14661, proposal is on kubernetes/community#552.

Couple bullet points as in commit:
- /healthz will be served on 0.0.0.0:10256 by default.
- /metrics and /proxyMode will be served on port 10249 as before.
- Healthz handler will verify timestamp in iptables mode.

/assign @nicksardo @bowei @thockin 

**Release note**:

```release-note
NONE
```
2017-05-08 14:54:38 -07:00
deads2k b7161a02b2 expose controller initializers 2017-05-08 14:34:18 -04:00
deads2k 4389f71576 refactor names for the apiserver handling chain 2017-05-08 07:55:31 -04:00
xiangpengzhao a1b568ccb8 Add default=false to usage of kube-apiserver allow-privileged flag 2017-05-06 11:27:05 +08:00
Sidhartha Mani 8666eaac53 bug fix #45156. Make cloud-provider flag mandatory 2017-05-05 16:51:49 -07:00
wlan0 45d2bc06b7 cloud initialize node in external cloud controller 2017-05-05 16:51:45 -07:00
Kubernetes Submit Queue 17d33ea82e Merge pull request #44830 from NickrenREN/remove-NodeLegacyHostIP
Automatic merge from submit-queue

Remove deprecated NodeLegacyHostIP

**Release note**:
```release-note
Remove deprecated node address type `NodeLegacyHostIP`.
```

ref #44807
2017-05-05 15:38:58 -07:00
Zihong Zheng e5db5dc3a1 Autogenerated files 2017-05-05 14:44:38 -07:00
Zihong Zheng ca59d909cf Separate healthz server from metrics server in kube-proxy
- /healthz will be served on 0.0.0.0:10256 by default.
- /metrics and /proxyMode will be served on port 10249
  as before.
- Healthz handler will verify timestamp in iptables mode.
2017-05-05 14:43:44 -07:00
Yu-Ju Hong cf3635c876 Update bazel BUID files 2017-05-05 11:48:08 -07:00
Yu-Ju Hong 389c140eaf Move docker client code from dockertools to dockershim/dockerlib
The code affected include DockerInterface (renamed to Interface),
FakeDockerClient, etc.
2017-05-05 11:48:08 -07:00
Wojciech Tyczynski 33a7a288a5 Switch userspace proxy to be event based for services 2017-05-05 09:35:38 +02:00
Kubernetes Submit Queue 78e08cf72d Merge pull request #45369 from dmmcquay/kubeadm_remove_etcd3_default
Automatic merge from submit-queue (batch tested with PRs 45364, 45369, 45323)

kubeadm: edit apiserver flags for storage-backend

**What this PR does / why we need it**: Since storage-backend defaults to etcd3 in 1.6 (see https://github.com/kubernetes/kubernetes/pull/36229), no need to have a flag defining the default.

**Special notes for your reviewer**: /cc @luxas 

**Release note**:
```release-note
NONE
```
2017-05-04 16:47:36 -07:00
Kubernetes Submit Queue 5a9759b0b4 Merge pull request #45376 from luxas/kubeadm_fix_taints
Automatic merge from submit-queue (batch tested with PRs 45309, 45376)

kubeadm: Fix the tainting of the master node

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

Currently, kubeadm unintentionally removes Taints set with the kubelet flag `--register-with-taints` when creating a new Taint slice instead of appening the existing one. This PR fixes that behavior.

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

This should be a cherrypick candidate for v1.6 cc @enisoc 

**Release note**:

```release-note
kubeadm: Fix invalid assign statement so it is possible to register the master kubelet with other initial Taints
```
@jbeda @dmmcquay @mikedanese @krousey PTAL, very straightforward PR
2017-05-04 15:54:39 -07:00
Kubernetes Submit Queue d23c73687a Merge pull request #45238 from deads2k/auth-04-expose-kubelet
Automatic merge from submit-queue (batch tested with PRs 45362, 45159, 45321, 45238)

expose kubelet authentication and authorization builders

The kubelet authentication and authorization builder methods are useful for consumers.

@liggitt
2017-05-04 13:25:06 -07:00
Lucas Käldström 6065824958
kubeadm: Fix the tainting of the master node 2017-05-04 22:34:44 +03:00
deads2k 0022223d8b expose kubelet authentication and authorization builders 2017-05-04 14:35:24 -04:00
Chao Xu 5f5a70f65f generated clientset changes
propagate to client-go
update-bazel.sh
2017-05-04 11:30:51 -07:00
Chao Xu bbb94e42c1 remove registry from testing/fixture.go; update client-gen to not use
registry in the generated clients
2017-05-04 11:30:51 -07:00
Derek McQuay 2c05234674
kubeadm: edit apiserver flags for storage-backend
Since storage-backend defaults to etcd3 in 1.6, no need to have a flag
defining the default.
2017-05-04 11:06:23 -07:00
Kubernetes Submit Queue 82bc084297 Merge pull request #45169 from ncdc/lister-gen-typo
Automatic merge from submit-queue

Fix typo in lister-gen, regenerate

NamespaeLister -> NamespaceLister

@stevekuznetsov, just for you 😄
2017-05-04 07:24:01 -07:00
Kubernetes Submit Queue f6ec7bade1 Merge pull request #45316 from yujuhong/dockershim-plugin-settings
Automatic merge from submit-queue (batch tested with PRs 45316, 45341)

Pass NoOpLegacyHost to dockershim in --experimental-dockershim mode

This allows dockershim to use network plugins, if needed.

/cc @Random-Liu
2017-05-04 05:19:49 -07:00