Commit Graph

4916 Commits (1f45cd06b31af32ef7eb074e6d962aecc193520d)

Author SHA1 Message Date
Kubernetes Submit Queue 4385382364 Merge pull request #48573 from jmillikin-stripe/build-kubectl-on-darwin
Automatic merge from submit-queue (batch tested with PRs 51047, 48573, 50764, 51092, 50578)

Use `select` to disable building static binaries if `--cpu=darwin`.

This change allows kubectl to be built on MacOS machines using
`bazel build //cmd/kubectl`.
    
Mac OS X doesn't support static binaries because it does not have a
stable syscall API. Userspace binaries are expected to dynamically
link against libcrt instead.
    
https://developer.apple.com/library/content/qa/qa1118/_index.html

```release-note
None
```
2017-08-23 17:56:02 -07:00
supereagle a4770d79b8 remove duplicated import 2017-08-23 21:55:18 +08:00
fabriziopandini 462dd940c0 kubeadm selfhosting CLI improvements 2017-08-23 14:31:31 +02:00
mbohlool 95586075af Fix backward compatibility for renamed OpenAPI definitions 2017-08-23 05:06:36 -07:00
Kubernetes Submit Queue b98826408f Merge pull request #51085 from frobware/disclose-StartTestServerOrDie-error-message
Automatic merge from submit-queue (batch tested with PRs 50229, 50973, 50976, 51085, 51084)

Print root cause failure message in StartTestServerOrDie()

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

If the test server cannot be started then print the underling root cause as
opposed to the generic 'Failed to create server chain'.

For example: 

    Failed to create server chain: Model name conflict in merging OpenAPI spec: io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIServiceCondition
2017-08-23 03:36:10 -07:00
fabriziopandini fc753af10f Add CLI flag for `cfg.FeatureFlags` 2017-08-23 09:56:15 +02:00
fabriziopandini 5ff994f17b Move package `app/cmd/features` to `app/features` + bazel files 2017-08-23 09:55:47 +02:00
Kubernetes Submit Queue 172f05bc53 Merge pull request #46902 from thockin/remove-obsolete-bins
Automatic merge from submit-queue (batch tested with PRs 50980, 46902, 51051, 51062, 51020)

Remove seemingly obsolete binaries

It's hard to tell if these are safe to remove.  Let CI tell me.
2017-08-22 23:13:59 -07:00
Kubernetes Submit Queue 4de2b66b73 Merge pull request #50980 from luxas/kubeadm_config_cmd
Automatic merge from submit-queue

kubeadm: Implement 'kubeadm config'

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

Implements a `kubeadm config` command for viewing the current kubeadm configuration stored as a ConfigMap in the cluster and creating that configuration for v1.7- users. kubeadm v1.8+ handles the creation of this ConfigMap at init time, but v1.7 users have to create it themselves with this command in order to be able to preserve the same config after the upgrade.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Adds a new `kubeadm config` command that lets users tell `kubeadm upgrade` what kubeadm configuration to use and lets users view the current state.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
2017-08-22 23:07:17 -07:00
Kubernetes Submit Queue 5f29fa4a44 Merge pull request #50965 from luxas/kubeadm_branch_kubedns_version
Automatic merge from submit-queue (batch tested with PRs 51039, 50512, 50546, 50965, 50467)

kubeadm: Get kube-dns based on the kubernetes version

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

Makes the kube-dns version used dependent on the kubernetes version. This is required for upgrades as we have to be able to handle one kube-dns version per branch for instance...

Currently a no-op though, as both v1.7 and v1.8 seem to use 1.14.4

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

Dependency for https://github.com/kubernetes/kubernetes/pull/48899 (kubeadm upgrades)

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews 

@kubernetes/dns-maintainers FYI; next time you bump DNS version, please update this func instead of the constant there...
2017-08-22 21:16:14 -07:00
Kubernetes Submit Queue c6980e7247 Merge pull request #51033 from mtaufen/revert-51008-revert-50789-fix-scheme
Automatic merge from submit-queue (batch tested with PRs 50967, 50505, 50706, 51033, 51028)

Revert "Merge pull request #51008 from kubernetes/revert-50789-fix-scheme"

I'm spinning up a cluster right now to test this fix, but I'm pretty sure this was the problem.
There doesn't seem to be a way to confirm from logs, because AFAICT the logs from the hollow kubelet containers are not collected as part of the kubemark test.

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

This reverts commit f4afdecef8, reversing
changes made to e633a1604f.

This also fixes a bug where Kubemark was still using the core api scheme
to manipulate the Kubelet's types, which was the cause of the initial
revert.

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

**Release note**:

```release-note
NONE
```

/cc @shyamjvs @wojtek-t
2017-08-22 10:48:21 -07:00
Kubernetes Submit Queue e80a365fe1 Merge pull request #50505 from feiskyer/kubeadm-reset
Automatic merge from submit-queue (batch tested with PRs 50967, 50505, 50706, 51033, 51028)

Clean kubelet certificates on kubeadm reset

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

After `kubeadm init` and `kubeadm reset` for a few times, kubelet will fail communicating with apiserver because certificate signed by unknown authority. We should cleanup kubelet certs on kubeadm reset.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-08-22 10:48:14 -07:00
Kubernetes Submit Queue 5e1b5b47cf Merge pull request #50967 from luxas/kubeadm_print_staticpod_create
Automatic merge from submit-queue (batch tested with PRs 50967, 50505, 50706, 51033, 51028)

kubeadm: Tell the user when a static pod is created

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

Prints a line to notify the user of the static pod creation in order to be consistent with the other phases (one line per phase and optionally per component).

Now the phase command `controlplane all` and `etcd local` also actually outputs something.
Also renamed `[token]` to `[bootstraptoken]` to match the output below and `s/mode/modes/`

`kubeadm init` output now:
```console
$ ./kubeadm init
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[init] Using Kubernetes version: v1.7.4
[init] Using Authorization modes: [Node RBAC]
[preflight] Running pre-flight checks
[preflight] WARNING: docker service is not enabled, please run 'systemctl enable docker.service'
[preflight] Starting the kubelet service
[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --token-ttl 0)
[certificates] Generated ca certificate and key.
[certificates] Generated apiserver certificate and key.
[certificates] apiserver serving cert is signed for DNS names [thegopher kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.1.115]
[certificates] Generated apiserver-kubelet-client certificate and key.
[certificates] Generated sa key and public key.
[certificates] Generated front-proxy-ca certificate and key.
[certificates] Generated front-proxy-client certificate and key.
[certificates] Valid certificates and keys now exist in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "controller-manager.conf"
[kubeconfig] Wrote KubeConfig file to disk: "scheduler.conf"
[controlplane] Wrote Static Pod manifest for component kube-apiserver to "/etc/kubernetes/manifests/kube-apiserver.yaml"
[controlplane] Wrote Static Pod manifest for component kube-controller-manager to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[controlplane] Wrote Static Pod manifest for component kube-scheduler to "/etc/kubernetes/manifests/kube-scheduler.yaml"
[etcd] Wrote Static Pod manifest for a local etcd instance to "/etc/kubernetes/manifests/etcd.yaml"
[init] Waiting for the kubelet to boot up the control plane as Static Pods from directory "/etc/kubernetes/manifests"
[apiclient] All control plane components are healthy after 40.002026 seconds
[markmaster] Master thegopher tainted and labelled with key/value: node-role.kubernetes.io/master=""
[bootstraptoken] Using token: cfe65e.d196614967c3ffe3
[bootstraptoken] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstraptoken] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstraptoken] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[uploadconfig] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[addons] Applied essential addon: kube-dns
[addons] Applied essential addon: kube-proxy

Your Kubernetes master has initialized successfully!

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

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  http://kubernetes.io/docs/admin/addons/

You can now join any number of machines by running the following on each node
as root:

  kubeadm join --token cfe65e.d196614967c3ffe3 192.168.1.115:6443 --discovery-token-ca-cert-hash sha256:eb3461b9b707eafc214577f36ae8c351bbc4d595ab928fc84caf1325b69cb192

$ ./kubeadm alpha phase controlplane all
[controlplane] Wrote Static Pod manifest for component kube-apiserver to "/etc/kubernetes/manifests/kube-apiserver.yaml"
[controlplane] Wrote Static Pod manifest for component kube-controller-manager to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[controlplane] Wrote Static Pod manifest for component kube-scheduler to "/etc/kubernetes/manifests/kube-scheduler.yaml"
$ ./kubeadm alpha phase etcd local
[etcd] Wrote Static Pod manifest for a local etcd instance to "/etc/kubernetes/manifests/etcd.yaml"
```

**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-cluster-lifecycle-pr-reviews @fabriziopandini
2017-08-22 10:48:11 -07:00
Lucas Käldström 28117323bc
kubeadm: Implement the 'kubeadm config' command 2017-08-22 18:49:34 +03:00
Robert Pothier 9dd5fe826b kubeadm: Add node-cidr-mask-size to pass to kube-controller-manager for IPv6
Due to the increased size of subnets with IPv6, the node-cidr-mask-size needs to be passed to kube-controller-manager. If the user passes a IPv6 cidr, the node-cidr-mask-size will be set to 64, If IPv4 it will be set to 24 as it was previously.
2017-08-22 10:33:27 -04:00
Kubernetes Submit Queue cb1220c114 Merge pull request #50963 from luxas/kubeadm_add_back_component_label2
Automatic merge from submit-queue (batch tested with PRs 50893, 50913, 50963, 50629, 50640)

kubeadm: Add back labels for the Static Pod control plane (attempt 2)

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

Exactly the same PR as https://github.com/kubernetes/kubernetes/pull/50174, but that PR was appearently lost in a rebase/mis-merge or something, so resending this one.

**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-cluster-lifecycle-pr-reviews
2017-08-22 05:31:10 -07:00
Andrew McDermott 0acda5efc6 Print root cause failure message in StartTestServerOrDie()
If the server cannot be started then print the underling root cause as
opposed to the generic 'Failed to create server chain'.
2017-08-22 10:26:09 +01:00
Kubernetes Submit Queue bf00190037 Merge pull request #47698 from fabriziopandini/kubeadm308
Automatic merge from submit-queue (batch tested with PRs 46458, 50934, 50766, 50970, 47698)

kubeadm: Warn in preflight checks if KubernetesVersion is of a newer branch than kubeadm

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

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

**Special notes for your reviewer**:

**Release note**:
2017-08-21 18:11:28 -07:00
Kubernetes Submit Queue 99e50f3544 Merge pull request #50970 from mtaufen/fix-unhandled-error
Automatic merge from submit-queue (batch tested with PRs 46458, 50934, 50766, 50970, 47698)

Fix unhandled error

Fixes an unhandled error in the kubelet startup code.
fixes: https://github.com/kubernetes/kubernetes/issues/50981
2017-08-21 18:11:25 -07:00
Kubernetes Submit Queue b49a179ea4 Merge pull request #50766 from luxas/kubeadm_selfhosting_race_condition
Automatic merge from submit-queue (batch tested with PRs 46458, 50934, 50766, 50970, 47698)

kubeadm: Make the self-hosting with certificates in Secrets mode work again

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

This PR:
 - makes the self-hosting with certificates in Secrets mode work
 - makes the wait functions timeoutable
 - fixes a race condition where the kubelet may be slow to remove the Static Pod
 - cleans up some of the self-hosting logic
 - makes self-hosting-with-secrets respect the feature flag

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

**Special notes for your reviewer**:

This is work in progress. I'll add unit tests, rebase upon https://github.com/kubernetes/kubernetes/pull/50762 and maybe split out some of the functionatlity here into a separate PR

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
2017-08-21 18:11:22 -07:00
Kubernetes Submit Queue f40d07480f Merge pull request #49119 from kad/n-addons-repo
Automatic merge from submit-queue (batch tested with PRs 50693, 50831, 47506, 49119, 50871)

kubeadm: Implement support for using images from CI builds

**What this PR does / why we need it**: Implements support for CI images in kubeadm

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

**Special notes for your reviewer**:

**Release note**:
```release-note
- kubeadm now supports "ci/latest-1.8" or "ci-cross/latest-1.8" and similar labels.
```
2017-08-21 14:30:03 -07:00
fabriziopandini 9730b82fcf kubeadm preflight - enforce maximum supported Kubernetes version 2017-08-21 22:05:13 +02:00
Michael Taufen a90d81620b Revert "Merge pull request #51008 from kubernetes/revert-50789-fix-scheme"
This reverts commit f4afdecef8, reversing
changes made to e633a1604f.

This also fixes a bug where Kubemark was still using the core api scheme
to manipulate the Kubelet's types, which was the cause of the initial
revert.
2017-08-21 11:28:05 -07:00
Kubernetes Submit Queue d852b8aad9 Merge pull request #50631 from luxas/kubeadm_dryrun_apiclient
Automatic merge from submit-queue (batch tested with PRs 47896, 50678, 50620, 50631, 51005)

kubeadm: Adds dry-run support for kubeadm using the `--dry-run` option

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

Adds dry-run support to kubeadm by creating a fake clientset that can get totally fake values (like in the init case), or delegate GETs/LISTs to a real API server but discard all edits like POST/PUT/PATCH/DELETE

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

**Special notes for your reviewer**:

This PR depends on https://github.com/kubernetes/kubernetes/pull/50626, first three commits are from there
This PR is a dependency for https://github.com/kubernetes/kubernetes/pull/48899 (kubeadm upgrades)

I have some small things to fixup and I'll yet write unit tests, but PTAL if you think this is going in the right direction

**Release note**:

```release-note
kubeadm: Adds dry-run support for kubeadm using the `--dry-run` option
```
cc @kubernetes/sig-cluster-lifecycle-pr-reviews @kubernetes/sig-api-machinery-pr-reviews
2017-08-21 08:26:26 -07:00
Kubernetes Submit Queue 5c351c282a Merge pull request #50678 from xiangpengzhao/remove-cm-flag
Automatic merge from submit-queue (batch tested with PRs 47896, 50678, 50620, 50631, 51005)

Remove deprecated lookup cache flags.

**What this PR does / why we need it**:
Remove deprecated lookup cache flags: `replication-controller-lookup-cache-size, replicaset-lookup-cache-size, daemonset-lookup-cache-size`

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

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

**Release note**:

```release-note
The following deprecated flags have been removed from `kube-controller-manager`: `replication-controller-lookup-cache-size`, `replicaset-lookup-cache-size`, and `daemonset-lookup-cache-size`. Make sure you no longer attempt to set them.
```
2017-08-21 08:26:20 -07:00
Kubernetes Submit Queue 5b159fa750 Merge pull request #47896 from NickrenREN/makeEventRecorder-cleanup
Automatic merge from submit-queue (batch tested with PRs 47896, 50678, 50620, 50631, 51005)

MakeEventRecorder function cleanup

delete KubeletConfiguration arg since it is unused


fixes #50969

```release-note
NONE
```
2017-08-21 08:26:17 -07:00
Shyam JVS 5591914d62 Revert "Don't register the kubeletconfig group with the default Scheme" 2017-08-21 11:15:27 +02:00
Lucas Käldström 6bc8ab3725
kubeadm: Use kube-dns manifests based on the kubernetes version 2017-08-20 11:30:07 +03:00
Michael Taufen c48b2dd7e4 Fix unhandled error 2017-08-19 11:54:17 -07:00
Lucas Käldström e4855bd1af
kubeadm: Tell the user when a static pod is created 2017-08-19 20:47:25 +03:00
Lucas Käldström 4a693337b6
kubeadm: Add back labels for the Static Pod control plane (attempt 2) 2017-08-19 19:59:59 +03:00
Tim Hockin 831fd242e8 Remove seemingly obsolete binaries 2017-08-18 21:01:19 -07:00
xswack 7154034fff Expand the test to include other flags as well 2017-08-19 11:17:16 +08:00
Pengfei Ni a2d0d46056 Clean /run/kubernetes on kubeadm reset 2017-08-19 08:40:25 +08:00
Lucas Käldström d2e08fd739
autogenerated bazel 2017-08-19 00:46:38 +03:00
Lucas Käldström 21eeb5c925
kubeadm: Adding unit tests for newly added funcs 2017-08-19 00:45:49 +03:00
Lucas Käldström d1acdf1627
kubeadm: Make the self-hosting with certificates in Secrets mode work again 2017-08-19 00:45:16 +03:00
Michael Taufen 0af9f756cd Don't register the kubeletconfig group with the default Scheme 2017-08-18 13:51:39 -07:00
Kubernetes Submit Queue 9553e89a19 Merge pull request #50860 from wlan0/master
Automatic merge from submit-queue

Proposal to add @wlan0 to appropriate owner files

@thockin @luxas
2017-08-18 10:24:20 -07:00
Kubernetes Submit Queue 0ade03bc0f Merge pull request #50839 from tengqm/fix-admission-controller-reg
Automatic merge from submit-queue (batch tested with PRs 50911, 50839)

Fix admission plugin registration

**What this PR does / why we need it**:
The current registration of admission plug-ins happen too late so the
command line help is not yielding correct/useful information to users.
This is already causing confusion as mentioned in some issues.

This patch fixes it by moving plugins.go down to options package because
"plugins" in this context are themselves options for users. Registration
of plugins is not an expensive operation and it is already done in most
execution paths.

**Which issue this PR fixes**
fixes #50833 

**Special notes for your reviewer**:
There might be other thoughts on how to better align this with other
efforts. This PR is leaving them to future work. For example:
in future, we may want to revisit these plugins and migrate them to the
shared apiserver repo when appropriate.

**Release note**:
I'm not sure if a release note is needed for this. Maybe there is a need.

```release-note
```
2017-08-18 08:24:30 -07:00
Alexander Kanevskiy 9f3ac327c7 Autogenerated 2017-08-18 17:02:23 +03:00
Alexander Kanevskiy 2312920cbc Implemented support for using images from CI builds
Implements kubernetes/kubeadm#337
2017-08-18 17:02:18 +03:00
Lucas Käldström 0bf84aa182
kubeadm: Adds dry-run support for kubeadm using the '--dry-run' option 2017-08-18 16:05:12 +03:00
Dong Liu 6fcde5694f Fix zsh completion for kubeadm 2017-08-18 18:49:41 +08:00
fabriziopandini c6bb8fbb4a Autogenerated bazel files 2017-08-18 09:14:28 +02:00
fabriziopandini 00fa026b9d Main work -- cleanup certs CLI command 2017-08-18 09:14:11 +02:00
fabriziopandini 5fac458f5f Main work -- refactor certs phase 2017-08-18 09:13:49 +02:00
NickrenREN b00ec8e46c Cleanup makeEventRecorder function
drop KubeletConfiguration arg since it is unused
2017-08-18 14:54:10 +08:00
tengqm a909cc8af5 Fix admission plugin registration
The current registration of admission plug-ins happen too late so the
command line help is not yielding correct/useful information to users.
This is already causing confusion as mentioned in some issues.

This patch fixes it by moving plugins.go down to options package because
"plugins" in this context are themselves options for users. Registration
of plugins is not an expensive operation and it is already done in most
execution paths.

In future, we may want to revisit these plugins and migrate them to the
shared apiserver repo when appropriate.
2017-08-18 10:32:15 +08:00
wlan0 92415f7dd7 Proposal to add @wlan0 to appropriate owner files 2017-08-17 11:37:51 -07:00
Daneyon Hansen 3390bc3cbc Updates Kubeadm Master Endpoint for IPv6
Previously, kubeadm would use <ip>:<port> to construct a master
endpoint. This works fine for IPv4 addresses, but not for IPv6.
IPv6 requires the ip to be encased in brackets when being joined
to a port with a colon.

This patch updates kubeadm to support wrapping a v6 address with
[] to form the master endpoint url. Since this functionality is
needed in multiple areas, a dedicated util function was created.

Fixes: https://github.com/kubernetes/kubernetes/issues/48227
2017-08-17 10:57:54 -07:00
Lucas Käldström c08091699c
kubeadm: Fix self-hosting race condition 2017-08-17 16:07:04 +03:00
Jordan Liggitt 55c7ce1d80
Honor --use-service-account-credentials in cloud-controller-manager 2017-08-17 01:41:57 -04:00
Kubernetes Submit Queue 4a15d32bec Merge pull request #50762 from jamiehannaford/kubeadm-gated-secrets
Automatic merge from submit-queue (batch tested with PRs 41901, 50762, 50756)

Feature-gate self-hosted secrets

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

Feature gates now select whether secrets are used for TLS cert storage in self-hosted clusters.

**Release note**:
```release-note
TLS cert storage for self-hosted clusters is now configurable. You can store them as secrets (alpha) or as usual host mounts.
```

/cc @luxas
2017-08-16 16:25:20 -07:00
Kubernetes Submit Queue 4032896ef1 Merge pull request #41901 from soltysh/cronjobs_beta
Automatic merge from submit-queue

Promote CronJobs to batch/v1beta1 - just the API

This PR promotes CronJobs to beta.

@erictune @kubernetes/sig-apps-api-reviews @kubernetes/api-approvers ptal

This builds on top of #41890 and needs #40932 as well

```release-note
Promote CronJobs to batch/v1beta1.
```
2017-08-16 15:59:46 -07:00
ymqytw b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -07:00
Jamie Hannaford abedc49b71 Feature-gate self-hosted secrets 2017-08-16 20:01:01 +02:00
Kubernetes Submit Queue 04a6481059 Merge pull request #47480 from danehans/kubeadm_certs
Automatic merge from submit-queue (batch tested with PRs 49115, 47480)

Adds IPv6 test cases for kubeadm certs.

**What this PR does / why we need it**:
Adds IPv6 test cases in support of kubeadm certificate and validation functionality. It's needed to ensure test cases cover IPv6 related networking scenarios.

**Which issue this PR fixes**
This PR is in support of Issue #1443

**Special notes for your reviewer**:
Additional PR's will follow to ensure kubeadm supports IPv6.

**Release note**:
```NONE
```
2017-08-16 06:27:27 -07:00
Kubernetes Submit Queue 7b26438253 Merge pull request #50692 from fabriziopandini/kubeadm-phases-small-cleanups
Automatic merge from submit-queue (batch tested with PRs 50692, 50727)

kubeadm: Small cleanups from the phases refactoring

**What this PR does / why we need it**:
Small cleanups on kubeadm phases

**Which issue this PR fixes**: 
fixes pending comments in [#49419](https://github.com/kubernetes/kubernetes/pull/49419)
fixes [#376](https://github.com/kubernetes/kubeadm/issues/376)

**Special notes for your reviewer**:
cc @luxas
2017-08-16 05:33:56 -07:00
Maciej Szulik 43b8715d82
Promote CronJobs to batch/v1beta1 2017-08-16 08:42:21 +02:00
Daneyon Hansen d1633727ec Adds IPv6 test cases to kubeadm certs and validation pkgs. 2017-08-15 13:17:58 -07:00
Kubernetes Submit Queue df8287c91d Merge pull request #47998 from danehans/kubeadm_boot
Automatic merge from submit-queue

Adds IPv6 test case to kubeadm bootstrap

**What this PR does / why we need it**:
Adds IPv6 test cases in support of kubeadm bootstrap functionality. It's needed to ensure test cases cover IPv6 related networking scenarios.

**Which issue this PR fixes**
This PR is in support of Issue #1443 and Issue #47666

**Special notes for your reviewer**:
Additional PR's will follow to ensure kubeadm fully supports IPv6.

**Release note**:
```NONE
```

/area ipv6
2017-08-15 13:11:22 -07:00
Kubernetes Submit Queue 21812547f9 Merge pull request #49051 from mtaufen/move-kc-type
Automatic merge from submit-queue (batch tested with PRs 50198, 49051, 48432)

move KubeletConfiguration out of componentconfig API group

I'm splitting #44252 into more manageable steps. This step moves the types and updates references.

To reviewers: the most important changes are the removals from pkg/apis/componentconfig and additions to pkg/kubelet/apis/kubeletconfig. Almost everything else is an import or name update.

I have one unanswered question: Should I create a whole new api scheme for Kubelet APIs rather than register e.g. a kubeletconfig group with the default runtime.Scheme instance? This feels like the right thing, as the Kubelet should be exposing its own API, but there's a big fat warning not to do this in `pkg/api/register.go`. Can anyone answer this?
2017-08-15 12:18:18 -07:00
Kubernetes Submit Queue d72fc055ee Merge pull request #50626 from luxas/kubeadm_separate_apiclient
Automatic merge from submit-queue (batch tested with PRs 50626, 50683, 50679, 50684, 50460)

kubeadm: Centralize client create-or-update logic in one package

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

Moves all Create-or-Update logic into one package instead of duplicating that logic all around in the codebase.

**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 PR depends on https://github.com/kubernetes/kubernetes/pull/50214.
Note that commit 2 is the only one that needs reviewing.
This PR is required for https://github.com/kubernetes/kubernetes/pull/48899 (kubeadm upgrade)

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @mattmoyer @fabriziopandini
2017-08-15 10:28:21 -07:00
Michael Taufen 24bab4c20f move KubeletConfiguration out of componentconfig API group 2017-08-15 08:12:42 -07:00
fabriziopandini 7e71c49bbf Small improvements on CLI messages 2017-08-15 16:30:08 +02:00
fabriziopandini d150362e63 Small code cleanups 2017-08-15 16:27:27 +02:00
Lucas Käldström 8c5c3ca197
autogenerated bazel 2017-08-15 15:52:49 +03:00
Lucas Käldström d725fe2c2c
kubeadm: Centralize client create-or-update logic in one package 2017-08-15 15:52:37 +03:00
xiangpengzhao 6ee6b17719 Remove deprecated lookup cache flags. 2017-08-15 20:03:11 +08:00
Kubernetes Submit Queue 55160e7cc1 Merge pull request #49322 from bsalamat/priority_admission
Automatic merge from submit-queue

Add Priority admission controller

**What this PR does / why we need it**: Add Priority admission controller. This admission controller checks creation and update of PriorityClasses. It also resolves a PriorityClass name of a pod to its integer value.

**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
Add Priority admission controller for monitoring and resolving PriorityClasses.
```

ref/ #47604
ref/ #48646
2017-08-15 03:13:15 -07:00
Dr. Stefan Schimanski 11b25366bc apiservers: add synchronous shutdown mechanism on SIGTERM+INT 2017-08-15 09:17:18 +02:00
Kubernetes Submit Queue c85aea35cb Merge pull request #50302 from fabriziopandini/kubeadm-phases-controlplane2
Automatic merge from submit-queue

kubeadm: Implementing the controlplane phase

**What this PR does / why we need it:**
This contains implementation of controlplane phases in kubeadm, which is part of the wider effort of implementing phases in kubeadm, previously in alpha stage.

The original proposal for this activity can be found [here](https://github.com/kubernetes/kubeadm/pull/156/files) and related comments.

Kubeadm phase implementation checklist is defined [here](https://github.com/kubernetes/kubeadm/issues/267)

Common implementation guidelines and principles for all phases are defined [here](https://docs.google.com/document/d/1VQMyFIVMfRGQPP3oCUpfjiWtOr3pLxp4g7cP-hXQFXc/edit?usp=sharing)

This PR implements:

- [x] kubeadm phase controlplane: wip by @fabriziopandini
  - [x] kubeadm phase controlplane all
  - [x] kubeadm phase controlplane etcd
  - [x] kubeadm phase controlplane apiserver
  - [x] kubeadm phase controlplane scheduler
  - [x] kubeadm phase controlplane controller-manager

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

**Special notes for your reviewer:**
This PR implements the same approach of #49419, thus minimising rework/impacts on existing codebase.
2017-08-14 20:35:14 -07:00
Kubernetes Submit Queue 17fa37292f Merge pull request #49129 from justinsb/revert_48056
Automatic merge from submit-queue (batch tested with PRs 49129, 50436, 50417, 50553, 47587)

Revert "Remove old node role label that is not used by kubeadm"

Revert the commit that removed printing of node roles from kubectl.

It sounds like we also need to update the labels we inspect, as these were previously removed.  But starting with a clean revert.

Issue #49124

```release-note
NONE
```
2017-08-14 19:48:56 -07:00
Kubernetes Submit Queue a4996c99d4 Merge pull request #50214 from andrewrynhard/refactor_addons
Automatic merge from submit-queue (batch tested with PRs 49904, 50484, 50214)

Refactor addons into multiple packages

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

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
https://github.com/kubernetes/kubeadm/issues/348
2017-08-14 13:09:59 -07:00
Kubernetes Submit Queue 9f902fef24 Merge pull request #50094 from sttts/sttts-no-importprefix
Automatic merge from submit-queue (batch tested with PRs 50094, 48966, 49478, 50593, 49140)

apimachinery: remove pre-apigroups import path logic

Replacing #50093.
2017-08-14 12:14:55 -07:00
John Millikin 046a6ce6bb
Use `select` to disable building static binaries if `--cpu=darwin`.
This change allows kubectl to be built on MacOS machines using
`bazel build //cmd/kubectl`.

Mac OS X doesn't support static binaries because it does not have a
stable syscall API. Userspace binaries are expected to dynamically
link against libcrt instead.

https://developer.apple.com/library/content/qa/qa1118/_index.html
2017-08-14 09:56:05 -07:00
Andrew Rynhard 8947726f6a Update bazel 2017-08-14 08:15:54 -07:00
Andrew Rynhard bbbf530504 Refactor addons into multiple packages 2017-08-14 07:57:20 -07:00
fabriziopandini 8ab27c1fbe Autogenerated bazel etc. 2017-08-14 16:31:53 +02:00
fabriziopandini 11e5274e2b Add CLI commands 2017-08-14 16:31:32 +02:00
fabriziopandini 740a78b0f3 Main work -- move etcd to separate phase and hook up most things 2017-08-14 16:31:09 +02:00
fabriziopandini 4db581c8ee Move all staticpod utils to separate package 2017-08-14 16:30:31 +02:00
Pengfei Ni c242432a3b Rename runtime/default to docker default 2017-08-13 15:42:15 +08:00
Pengfei Ni f3150c9c8c Support seccomp profile from container's security context 2017-08-13 15:42:15 +08:00
Kubernetes Submit Queue 42adb9ef25 Merge pull request #50258 from liggitt/token-cache
Automatic merge from submit-queue (batch tested with PRs 49488, 50407, 46105, 50456, 50258)

Enable caching successful token authentication

Resolves #50472

To support revocation of service account tokens, an etcd lookup of the token and service account is done by the token authenticator. Controllers that make dozens or hundreds of API calls per second (like the endpoints controller) cause this lookup to be done very frequently on the same objects.

This PR:
* Implements a cached token authenticator that conforms to the authenticator.Token interface
* Implements a union token authenticator (same approach as the union request authenticator, conforming to the authenticator.Token interface)
* Cleans up the auth chain construction to group all token authenticators (means we only do bearer and websocket header parsing once)
* Adds a 10-second TTL cache to successful token authentication

```release-note
API server authentication now caches successful bearer token authentication results for a few seconds.
```
2017-08-11 14:14:06 -07:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Jeff Grafton cf55f9ed45 Autogenerate BUILD files 2017-08-11 09:30:23 -07:00
Kubernetes Submit Queue f37b30657e Merge pull request #50078 from php-coder/fix_useless_cat_usage
Automatic merge from submit-queue

Simplify a command for unmounting mounted directories

**What this PR does / why we need it**:
This PR simplifies a command for unmounting mounted directories. It replaces `cat | awk | grep` by a single `awk` expression.

**Special notes for your reviewer**:
Link about useless cat/grep usage: http://porkmail.org/era/unix/award.html#grep

**Credit**:
I saw this code fragment in the Julia Evans (@jvns) [write up](https://jvns.ca/blog/2017/07/30/a-couple-useful-ideas-from-google/).

**Release note**:
```release-note
NONE
```

CC @simo5
2017-08-11 06:48:40 -07:00
Kubernetes Submit Queue 7adb675003 Merge pull request #50269 from stevekuznetsov/skuznets/import-restrictions
Automatic merge from submit-queue

Rewrite staging import verifier in Go

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

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

Maintaining Bash is nobody's idea of fun. The declarative config is infinitely easier to read, as well.

**Special notes for your reviewer**:

@sttts still trying to figure out the rules you have encoded in the shell script... very confusing. Please review the `kube-gen` specifically.

**Release note**:
```release-note
NONE
```
2017-08-11 00:37:13 -07:00
Kubernetes Submit Queue a227c1ea2c Merge pull request #48581 from mengqiy/kubectl_logs
Automatic merge from submit-queue

move logs to kubectl/util

Move `pkg/util/logs` to `pkg/kubectl/util/logs` per https://github.com/kubernetes/kubernetes/issues/48209#issuecomment-311730681
This will make kubeadm, kubefed, gke-certificates-controller and e2e have dependency on kubectl, which should be fine.

partially addresses: kubernetes/community#598

```release-note
NONE
```

/assign @apelisse @monopole
2017-08-10 23:45:38 -07:00
Klaus Ma 55fa10c182 Tainted node by condition. 2017-08-11 09:55:29 +08:00
Daneyon Hansen 85db3ff08e Adds IPv6 test case to kubeadm bootstrap 2017-08-10 13:31:11 -07:00
ymqytw d7659dffff move logs to kubectl/util 2017-08-10 11:30:26 -07:00
Matt Moyer 358806e18b kubeadm: generated deepcopy for `k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm` and `k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha1`. 2017-08-10 11:39:25 -05:00
Matt Moyer 1be639d6b0 kubeadm: implement TLS discovery root CA pinning.
This change adds the `--discovery-token-ca-cert-hash` and `--discovery-token-unsafe-skip-ca-verification` flags for `kubeadm join` and corresponding fields on the kubeadm NodeConfiguration struct. These flags configure enhanced TLS validation for token-based discovery.

The enhanced TLS validation works by pinning the public key hashes of the cluster CA. This is done by connecting to the `cluster-info` endpoint initially using an unvalidated/unsafe TLS connection. After the cluster info has been loaded, parsed, and validated with the existing symmetric signature/MAC scheme, the root CA is validated against the pinned public key set. A second request is made using validated/safe TLS using the newly-known CA and the result is validated to make sure the same `cluster-info` was returned from both requests.

This validation prevents a class of attacks where a leaked bootstrap token (such as from a compromised worker node) allows an attacker to impersonate the API server.

This change also update `kubeadm init` to print the correct `--discovery-token-ca-cert-hash` flag in the example `kubeadm join` command it prints at the end of initialization.
2017-08-10 11:39:25 -05:00
Matt Moyer 2dd359ba19 kubeadm: add pubkeypin package (public key pinning hash implementation).
This change adds a `k8s.io/kubernetes/cmd/kubeadm/app/util/pubkeypin` package which implements x509 public key pinning in the style of RFC7469. This is the public key hash format used by the new `kubeadm join --discovery-token-ca-cert-hash` flag.

Hashes are namespaced with a short type, with "sha256" being the only currently-supported format. Type "sha256" is a hex-encoded SHA-256 hash over the Subject Public Key Info (SPKI) object in DER-encoded ASN.1.
2017-08-10 11:37:07 -05:00
Dr. Stefan Schimanski 8728576236 apimachinery: remove pre-apigroups import prefix logic 2017-08-10 13:07:54 +02:00
Slava Semushin ae99f10afd Simplify a command for unmounting mounted directories under /var/lib/kubelet. 2017-08-10 12:58:50 +02:00
Kubernetes Submit Queue 9bbcd4af60 Merge pull request #50335 from ironcladlou/gc-discovery-optimization
Automatic merge from submit-queue (batch tested with PRs 49642, 50335, 50390, 49283, 46582)

Improve GC discovery sync performance

Improve GC discovery sync performance by only syncing when discovered
resource diffs are detected. Before, the GC worker pool was shut down
and monitors resynced unconditionally every sync period, leading to
significant processing delays causing test flakes where otherwise
reasonable GC timeouts were being exceeded.

Related to https://github.com/kubernetes/kubernetes/issues/49966.

/cc @kubernetes/sig-api-machinery-bugs

```release-note
NONE
```
2017-08-10 00:53:19 -07:00
Kubernetes Submit Queue 85e2e5dd9a Merge pull request #49642 from liggitt/rbac-v1
Automatic merge from submit-queue (batch tested with PRs 49642, 50335, 50390, 49283, 46582)

Add rbac.authorization.k8s.io/v1

xref https://github.com/kubernetes/features/issues/2

Promotes the rbac.authorization.k8s.io/v1beta1 API to v1 with no changes

```release-note
The `rbac.authorization.k8s.io/v1beta1` API has been promoted to `rbac.authorization.k8s.io/v1` with no changes.
The `rbac.authorization.k8s.io/v1alpha1` version is deprecated and will be removed in a future release.
```
2017-08-10 00:53:17 -07:00
Lucas Käldström cb73972224
autogenerated 2017-08-10 06:46:46 +03:00
Lucas Käldström 5f4e19beb8
kubeadm: Add the 'kubeadm phase bootstrap-token' command 2017-08-10 06:45:53 +03:00
Lucas Käldström 04748160a6
kubeadm: Move all node bootstrap token related code in one phase package 2017-08-10 06:45:19 +03:00
Jordan Liggitt 0458fac8c0
Simplify bearer token auth chain, cache successful authentications 2017-08-09 23:37:24 -04:00
Kubernetes Submit Queue b23af4b906 Merge pull request #50320 from luxas/kubeadm_saveconfig_phase
Automatic merge from submit-queue

kubeadm: Upload configuration used at 'kubeadm init' time to ConfigMap for easier upgrades

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

Uploads config used to a ConfigMap so we can upgrade a cluster seamlessly without forcing the user to re-specify all options they specified the first time.

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

**Special notes for your reviewer**:

This should be a cherrypick-candidate for easier upgrading to v1.8
cc @wojtek-t 

**Release note**:

```release-note
kubeadm: Upload configuration used at 'kubeadm init' time to ConfigMap for easier upgrades
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @timothysc
2017-08-09 17:14:19 -07:00
Kubernetes Submit Queue fdc65025ee Merge pull request #50337 from bowei/node-controller-repackage
Automatic merge from submit-queue (batch tested with PRs 50016, 49583, 49930, 46254, 50337)

Break up node controller into packages

This change does NO actual code changes other than moving constituent
parts into packages.

```release-note
NONE
```
2017-08-09 14:14:35 -07:00
Kubernetes Submit Queue 458cc04330 Merge pull request #46254 from mtaufen/dkcfg
Automatic merge from submit-queue (batch tested with PRs 50016, 49583, 49930, 46254, 50337)

Alpha Dynamic Kubelet Configuration

Feature: https://github.com/kubernetes/features/issues/281

This proposal contains the alpha implementation of the Dynamic Kubelet Configuration feature proposed in ~#29459~ [community/contributors/design-proposals/dynamic-kubelet-configuration.md](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/dynamic-kubelet-configuration.md). 

Please note:
- ~The proposal doc is not yet up to date with this implementation, there are some subtle differences and some more significant ones. I will update the proposal doc to match by tomorrow afternoon.~
- ~This obviously needs more tests. I plan to write several O(soon). Since it's alpha and feature-gated, I'm decoupling this review from the review of the tests.~ I've beefed up the unit tests, though there is still plenty of testing to be done.
- ~I'm temporarily holding off on updating the generated docs, api specs, etc, for the sake of my reviewers 😄~ these files now live in a separate commit; the first commit is the one to review.

/cc @dchen1107 @vishh @bgrant0607 @thockin @derekwaynecarr 

```release-note
Adds (alpha feature) the ability to dynamically configure Kubelets by enabling the DynamicKubeletConfig feature gate, posting a ConfigMap to the API server, and setting the spec.configSource field on Node objects. See the proposal at https://github.com/kubernetes/community/blob/master/contributors/design-proposals/dynamic-kubelet-configuration.md for details.
```
2017-08-09 14:14:32 -07:00
Jordan Liggitt dd7be70a4a
Add rbac.authorization.k8s.io/v1 2017-08-09 17:04:54 -04:00
Lucas Käldström 728d0f9355
autogenerated bazel 2017-08-09 19:31:16 +03:00
Lucas Käldström ad7012e974
kubeadm: Upload configuration used at 'kubeadm init' time to ConfigMap for easier upgrades 2017-08-09 19:22:40 +03:00
Dan Mace 3d6d57a18f Improve GC discovery sync performance
Improve GC discovery sync performance by only syncing when discovered
resource diffs are detected. Before, the GC worker pool was shut down
and monitors resynced unconditionally every sync period, leading to
significant processing delays causing test flakes where otherwise
reasonable GC timeouts were being exceeded.

Related to https://github.com/kubernetes/kubernetes/issues/49966.
2017-08-09 09:16:05 -04:00
Kubernetes Submit Queue 788664b7f7 Merge pull request #50288 from liggitt/service-account-warning
Automatic merge from submit-queue (batch tested with PRs 50173, 50324, 50288, 50263, 50333)

Honor --use-service-account-credentials and warn when missing private key

Fixes #50275 by logging a warning and failing to start rather than continue to run ignoring the user's specified config
2017-08-09 02:21:56 -07:00
Kubernetes Submit Queue 35e5197eca Merge pull request #50173 from luxas/kubeadm_constants
Automatic merge from submit-queue

kubeadm: Centralize commonly used paths/constants to the constants pkg

**What this PR does / why we need it**:
Before there were constants defined for the control plane components in three different places:
 - images
 - phases/controlplane
 - phases/selfhosting

Now they are in one centralized place. I also moved funcs for building common paths to that lib.

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

Dependency for: https://github.com/kubernetes/kubernetes/pull/48899

**Special notes for your reviewer**:

Most of this PR really is autogenerated with a replace tool. I tested this and things work just normally as well.

**Release note**:

```release-note
NONE
```
@timothysc @dmmcquay @pipejakob @kubernetes/sig-cluster-lifecycle-pr-reviews
2017-08-09 01:41:19 -07:00
Steve Kuznetsov 54809de387
Rewrite staging import verifier in Go
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-08-08 16:08:20 -07:00
Bowei Du 27854fa0d8 Break up node controller into packages
This change does NO actual code changes other than moving constituent
parts into packages.
2017-08-08 15:33:56 -07:00
Michael Taufen 443d58e40a Dynamic Kubelet Configuration
Alpha implementation of the Dynamic Kubelet Configuration feature.
See the proposal doc in #29459.
2017-08-08 12:21:37 -07:00
Lucas Käldström 9a6ef9677a
kubeadm: Centralize commonly used paths/constants to the constants pkg 2017-08-08 15:07:21 +03:00
Kubernetes Submit Queue 608b81a63f Merge pull request #50174 from luxas/kubeadm_add_back_component_label
Automatic merge from submit-queue (batch tested with PRs 50254, 50174, 50179)

kubeadm: Add back labels for the Static Pod control plane

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

This Labels section has been removed now for a short period during the v1.8 dev cycle, but I found a good use-case for it; namely filtering Mirror Pods by the `component=kube-*` label when waiting for the self-hosted control plane to come up after an upgrade. It's not _really_ neccessary, but nice to have.

Also noticed the lack of coverage for this func, so added a small unit test.

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

Dependency for: https://github.com/kubernetes/kubernetes/pull/48899

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @dmmcquay @timothysc @mattmoyer
2017-08-08 04:02:54 -07:00
Kubernetes Submit Queue 2c088a2d5a Merge pull request #50259 from deads2k/controllers-01-printhealth
Automatic merge from submit-queue (batch tested with PRs 50208, 50259, 49702, 50267, 48986)

provide the failing health as part of the controller error

When the controllers fail to start because the master is unhealthy, the healthz message is a useful starting point for debugging. This provides it in the error returned.
2017-08-08 01:52:58 -07:00
Jordan Liggitt dffee9c06f
Honor --use-service-account-credentials and warn when missing private key 2017-08-08 00:48:17 -04:00
Robert Rati 926f070719 Make ClusterID required for AWS. #48954 2017-08-07 15:47:00 -04:00
David Eads 47d426c441 provide the failing health as part of the controller error 2017-08-07 12:55:29 -04:00
Jamie Hannaford 173bc31c25 Enable selfHosted feature flag 2017-08-07 15:20:34 +02:00
Dr. Stefan Schimanski 3b310d8989 Update generated code 2017-08-06 15:32:28 +02:00
Dr. Stefan Schimanski 1910b5a1dd Fix code implicitly casting clientsets to getters 2017-08-06 15:30:13 +02:00
fabriziopandini f9f91bf18e fully implement kubeadm-phase-kubeconfig 2017-08-05 16:44:39 +02:00
Lucas Käldström a69697e607
kubeadm: Add back labels for the Static Pod control plane 2017-08-05 15:45:09 +03:00
Kubernetes Submit Queue bb99ccc178 Merge pull request #50162 from luxas/kubeadm_clientset_iface
Automatic merge from submit-queue (batch tested with PRs 47416, 47408, 49697, 49860, 50162)

kubeadm: Replace *clientset.Clientset with clientset.Interface

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

Needed for https://github.com/kubernetes/kubernetes/pull/48899
We should always use `clientset.Interface` instead of `*clientset.Clientset`, for better testability and all the other benefits of using an interface.

**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**:
Should be straightforward to merge

**Release note**:

```release-note
NONE
```
@timothysc @dmmcquay @pipejakob
2017-08-05 03:23:01 -07:00
Kubernetes Submit Queue 34e9c6fa5d Merge pull request #41611 from cblecker/clientgo-public-pem-functions
Automatic merge from submit-queue (batch tested with PRs 50119, 48366, 47181, 41611, 49547)

Move remaining cert helper functions from pkg/serviceaccount to client-go/util/cert

**What this PR does / why we need it**:
Unifies all remaining certificate helper functions from pkh/serviceaccount to client-go/util/cert. Private key functions were moved in #40907

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

**Special notes for your reviewer**:

**Release note**:
2017-08-04 14:29:39 -07:00
Kubernetes Submit Queue fae79dd4b4 Merge pull request #47181 from dims/fail-on-swap-enabled
Automatic merge from submit-queue (batch tested with PRs 50119, 48366, 47181, 41611, 49547)

Fail on swap enabled and deprecate experimental-fail-swap-on flag

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

    * Deprecate the old experimental-fail-swap-on
    * Add a new flag fail-swap-on and set it to true

    Before this change, we would not fail when swap is on. With this
    change we fail for everyone when swap is on, unless they explicitly
    set --fail-swap-on to false.

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

Fixes #34726

**Special notes for your reviewer**:

**Release note**:

```release-note
Kubelet will by default fail with swap enabled from now on. The experimental flag "--experimental-fail-swap-on" has been deprecated, please set the new "--fail-swap-on" flag to false if you wish to run with /proc/swaps on.
```
2017-08-04 14:29:36 -07:00
Lucas Käldström 0734b63dc0
kubeadm: Replace *clientset.Clientset with clientset.Interface 2017-08-04 21:14:50 +03:00
Kubernetes Submit Queue e29ead1154 Merge pull request #50090 from gmarek/EventClient
Automatic merge from submit-queue (batch tested with PRs 48237, 50084, 50019, 50069, 50090)

Explicitly use Core client as EventClient in hollow node
2017-08-03 22:22:05 -07:00
Kubernetes Submit Queue 151b8118d5 Merge pull request #50069 from fisherxu/master
Automatic merge from submit-queue (batch tested with PRs 48237, 50084, 50019, 50069, 50090)

Fix comment of isHTTPSURL

**What this PR does / why we need it**:
fix comment of isHTTPSURL
2017-08-03 22:22:03 -07:00
Kubernetes Submit Queue 0c2f816646 Merge pull request #48237 from xiangpengzhao/fix-proxy-test
Automatic merge from submit-queue

Add test for kube-proxy running with "--cleanup-iptables=true"

**What this PR does / why we need it**:
Add test to prevent such kube-proxy panic to happen again.

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

**Special notes for your reviewer**:
Forgot to add this in last PR #48183. Should we also add this to v1.7 milestone?
/cc @ncdc @dchen1107 

**Release note**:

```release-note
NONE
```
2017-08-03 22:03:31 -07:00
Christoph Blecker aac4d5382d
Move remaining cert helper functions to client-go/util/cert
- Move public key functions to client-go/util/cert
- Move pki file helper functions to client-go/util/cert
- Standardize on certutil package alias
- Update dependencies to client-go/util/cert
2017-08-03 13:17:07 -07:00
gmarek 20b6b3ca99 Explicitly use Core client as EventClient in hollow node 2017-08-03 15:15:09 +02:00
Kubernetes Submit Queue 42a73ee3ac Merge pull request #48943 from jamiehannaford/kubeadm-feature-gates
Automatic merge from submit-queue

Add --feature-gate flags to kubeadm

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

Adds `--feature-gates` in similar manner to other `cmd` binaries

**Which issue this PR fixes** 

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

**Special notes for your reviewer**:

This results in a lot of probably unnecessary feature flags. I'm guessing a lot of kubeadm users will be confused when they see:

```
Flags:
      --feature-gates mapStringBool   A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:
APIResponseCompression=true|false (ALPHA - default=false)
Accelerators=true|false (ALPHA - default=false)
AdvancedAuditing=true|false (ALPHA - default=false)
AllAlpha=true|false (ALPHA - default=false)
AllowExtTrafficLocalEndpoints=true|false (default=true)
AppArmor=true|false (BETA - default=true)
DebugContainers=true|false (ALPHA - default=false)
DynamicKubeletConfig=true|false (ALPHA - default=false)
DynamicVolumeProvisioning=true|false (ALPHA - default=true)
ExperimentalCriticalPodAnnotation=true|false (ALPHA - default=false)
ExperimentalHostUserNamespaceDefaulting=true|false (BETA - default=false)
LocalStorageCapacityIsolation=true|false (ALPHA - default=false)
PersistentLocalVolumes=true|false (ALPHA - default=false)
PodPriority=true|false (ALPHA - default=false)
RotateKubeletClientCertificate=true|false (ALPHA - default=false)
RotateKubeletServerCertificate=true|false (ALPHA - default=false)
StreamingProxyRedirects=true|false (BETA - default=true)
TaintBasedEvictions=true|false (ALPHA - default=false)
  -h, --help                          help for kubeadm
```

However the feature flags used in the core pkg is global, so I don't think it can be overriden. So we have a few options:

1. Allow these flags for kubeadm
2. Refactor feature pkg to allow granular features
3. Roll our own feature gating for kubeadm

/cc @luxas
2017-08-03 04:54:10 -07:00
xufei 8ea31945be Fix comment of isHTTPSURL 2017-08-03 15:42:33 +08:00
Kubernetes Submit Queue 07ddb3941f Merge pull request #49899 from ericchiang/kubelet-close-conns-on-rotate
Automatic merge from submit-queue (batch tested with PRs 49237, 49656, 49980, 49841, 49899)

certificate manager: close existing client conns once cert rotates

After the kubelet rotates its client cert, it will keep connections to the API server open indefinitely, causing it to use its old credentials instead of the new certs. Because the API server authenticates client certs at the time of the request, and not the handshake, this could cause the kubelet to start hitting auth failures even if it rotated its certificate to a new, valid one.
    
When the kubelet rotates its cert, close down existing connections to force a new TLS handshake.

Ref https://github.com/kubernetes/features/issues/266
Updates https://github.com/kubernetes-incubator/bootkube/pull/663

```release-note
After a kubelet rotates its client cert, it now closes its connections to the API server to force a handshake using the new cert. Previously, the kubelet could keep its existing connection open, even if the cert used for that connection was expired and rejected by the API server.
```

/cc @kubernetes/sig-auth-bugs 
/assign @jcbsmpsn @mikedanese
2017-08-02 19:11:18 -07:00
Kubernetes Submit Queue 22af024093 Merge pull request #49412 from bjhaid/etcd_healthz_endpoint
Automatic merge from submit-queue (batch tested with PRs 49989, 49806, 49649, 49412, 49512)

This adds an etcd health check endpoint to kube-apiserver

addressing https://github.com/kubernetes/kubernetes/issues/48215.

**What this PR does / why we need it**:
This ensures kube-apiserver `/healthz` endpoint fails whenever connectivity cannot be established to etcd, also ensures the etcd preflight checks works with unix sockets

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

**Special notes for your reviewer**:
This PR does not use the etcd client directly as the client object is wrapped behind the storage interface and not exposed directly for use, so I decided to reuse what's being done in the preflight. So this will only check fail for connectivity and not etcd auth related problems. I did not write tests for the endpoint because I couldn't find examples that I could follow for writing tests for healthz related endpoints, I'll be willing to write those tests if someone can point me at a relevant one.

**Release note**:
```release-note
Add etcd connectivity endpoint to healthz
```

@deads2k please help review, thanks!
2017-08-02 17:06:02 -07:00
Davanum Srinivas 71e8c8eba4 Fail on swap enabled and deprecate experimental-fail-swap-on flag
* Deprecate the old experimental-fail-swap-on
* Add a new flag fail-swap-on and set it to true

Before this change, we would not fail when swap is on. With this
change we fail for everyone when swap is on, unless they explicitly
set --fail-swap-on to false.
2017-08-02 16:20:01 -04:00
Kubernetes Submit Queue 84e0326eb1 Merge pull request #49782 from supereagle/update-generated-deepcopy
Automatic merge from submit-queue (batch tested with PRs 50029, 48517, 49739, 49866, 49782)

Update generated deepcopy code

**What this PR does / why we need it**:
In generated deepcopy code, the method names in comments do not match the real method names.

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

**Special notes for your reviewer**:
/assign @sttts @caesarxuchao 


**Release note**:
```release-note
NONE
```
2017-08-02 12:46:57 -07:00
Jamie Hannaford e6a98688d0 Add --feature-gate flags to kubeadm 2017-08-02 17:05:36 +02:00
Kubernetes Submit Queue acc00afece Merge pull request #49267 from MrHohn/kube-proxy-abort-when-healthz-fails
Automatic merge from submit-queue (batch tested with PRs 49992, 48861, 49267, 49356, 49886)

Emit event and retry when fail to start healthz server on kube-proxy

**What this PR does / why we need it**: Enhance kube-proxy's logic when fail to start healthz server.

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

**Special notes for your reviewer**:
/assign @thockin @nicksardo @bowei 

**Release note**:

```release-note
NONE
```
2017-08-02 05:16:01 -07:00
Kubernetes Submit Queue 9067d35951 Merge pull request #48861 from mbohlool/openapi_aggr
Automatic merge from submit-queue (batch tested with PRs 49992, 48861, 49267, 49356, 49886)

Reintegrate aggregation support for OpenAPI

Reintegrating changes of #46734

Changes summary:

- Extracted all OpenAPI specs to new repo `kube-openapi`
- Make OpenAPI spec aggregator to copy and rename any non-requal model (even with documentation change only).
- Load specs when adding APIServices and retry on failure until successful spec retrieval or a 404.
- Assumes all Specs except aggregator's Spec are static 
- A re-register of any APIService will result in updating the spec for that service (Suggestion for TPR: they should be registered to aggregator API Server, Open for discussion if any more changes needed for another PR.)

fixes #48548
2017-08-02 05:15:57 -07:00
Kubernetes Submit Queue f33297d5c1 Merge pull request #49092 from huangjiuyuan/fix-apiserver-option-test
Automatic merge from submit-queue (batch tested with PRs 49871, 49422, 49092, 49858, 48999)

adding kube-apiserver starting option tests

**What this PR does / why we need it**:
There is only one test for `--enable-swagger-ui` option in `cmd/kube-apiserver/app/options/options_test.go`, I have expanded this test with more kube-apiserver starting options.

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

**Special notes for your reviewer**:

**Release note**:

`NONE`
2017-08-01 23:35:53 -07:00
Kubernetes Submit Queue 58e8c3e23d Merge pull request #49872 from xiangpengzhao/fix-kubeadm-ver
Automatic merge from submit-queue (batch tested with PRs 49870, 49416, 49872, 49892, 49908)

Make "kubeadm version" json format output more readable.

**What this PR does / why we need it**:
Add indent to json format output.

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

**Special notes for your reviewer**:
output example:
```
#kubeadm version -o json
{
  "clientVersion": {
    "major": "1",
    "minor": "8+",
    "gitVersion": "v1.8.0-alpha.2.1026+d8205661b700c6-dirty",
    "gitCommit": "d8205661b700c6f99c33ea0ac1e5ed3e49c202b2",
    "gitTreeState": "dirty",
    "buildDate": "2017-07-31T12:14:28Z",
    "goVersion": "go1.8.3",
    "compiler": "gc",
    "platform": "linux/amd64"
  }
}
```


**Release note**:

```release-note
NONE
```
2017-08-01 19:53:01 -07:00
Eric Chiang 98795b32de generated:
Commands run:

	./hack/update-bazel.sh
2017-08-01 16:33:52 -07:00
Eric Chiang 11d96c174e certificate manager: close existing client conns once cert rotates
After the kubelet rotates its client cert, it will keep connections
to the API server open indefinitely, causing it to use its old
credentials instead of the new certs

When the kubelet rotates its cert, close down existing connections
to force a new TLS handshake.
2017-08-01 16:33:52 -07:00
bjhaid 47d748c5dc This adds an etcd health check endpoint to kube-apiserver
addressing https://github.com/kubernetes/kubernetes/issues/48215.
2017-08-01 21:37:52 +00:00
mbohlool 1806609596 Update Bazel 2017-08-01 03:37:18 -07:00
mbohlool 8c0580d89b Aggregate OpenAPI spec 2017-08-01 03:37:17 -07:00
mbohlool 400b77b48f Update main repo references to new kube-openapi repo 2017-08-01 03:37:16 -07:00
Edmund Rhudy fea25a61c1 Fixes kubernetes/kubeadm#347
Node name discovery failed on `kubeadm join`. If a node name
is not explicitly provided, it will be looked up.
2017-07-31 14:31:27 -04:00
Bobby (Babak) Salamat e25476a6ed autogenerated files 2017-07-31 10:16:35 -07:00
supereagle a1c880ece3 update generated deepcopy code 2017-07-31 22:33:00 +08:00
xiangpengzhao bb070a64a8 Make "kubeadm version" json format output more readable. 2017-07-31 20:17:41 +08:00
huangjiuyuan 00a3767289 adding kube-apiserver starting option tests
Signed-off-by: huangjiuyuan <jiuyuan.huang@daocloud.io>
2017-07-31 17:21:40 +08:00
Kubernetes Submit Queue 74ca1045d7 Merge pull request #49750 from danehans/kubeadm_tolower_certs
Automatic merge from submit-queue (batch tested with PRs 49538, 49708, 47665, 49750, 49528)

Lowercases hostname for kubeadm cert slice

**What this PR does / why we need it**:
Previously, unit tests on master were failing due to this error:
```
--- FAIL: TestSubCmdApiServerFlags (0.99s)
	certs_test.go:149: APIserverCert.DNSNames[0] is danehans-m-c1kp instead of DANEHANS-M-C1KP
```
The PR fixes the TestSubCmdApiServerFlags test, which uses the OS hostname to compare the apiserver serving cert and fails if the OS hostname is in caps.

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

**Special notes for your reviewer**:

**Release note**:

```NONE
```
2017-07-29 05:28:55 -07:00
Kubernetes Submit Queue 7be28a15cc Merge pull request #47665 from ironcladlou/gc-poll-types
Automatic merge from submit-queue (batch tested with PRs 49538, 49708, 47665, 49750, 49528)

Enable garbage collection of custom resources

Enhance the garbage collector to periodically refresh the resources it monitors (via discovery) to enable custom resource definition GC (addressing #44507 and reverting #47432).

This is a replacement for #46000.

/cc @lavalamp @deads2k @sttts @caesarxuchao 

/ref https://github.com/kubernetes/kubernetes/pull/48065

```release-note
The garbage collector now supports custom APIs added via CustomeResourceDefinition or aggregated apiservers. Note that the garbage collector controller refreshes periodically, so there is a latency between when the API is added and when the garbage collector starts to manage it.
```
2017-07-29 05:28:53 -07:00
Kubernetes Submit Queue 740ca9a052 Merge pull request #49538 from supereagle/versioned-coreclient
Automatic merge from submit-queue (batch tested with PRs 49538, 49708, 47665, 49750, 49528)

Use the core client with version

**What this PR does / why we need it**:
Replace the **deprecated** `clientSet.Core()` with `clientSet.CoreV1()`.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-07-29 05:28:49 -07:00
mbohlool 88868402b8 Revert "Aggregate OpenAPI specs"
This reverts commit 1a1d9a0394.
2017-07-28 14:02:36 -07:00
Kubernetes Submit Queue 9dc3a661d7 Merge pull request #49681 from mikedanese/kubelet-csr
Automatic merge from submit-queue (batch tested with PRs 49581, 49652, 49681, 49688, 44655)

kubeadm: use kubelet bootstrap instead of reimplementing

@kubernetes/sig-cluster-lifecycle-api-reviews
2017-07-28 13:45:48 -07:00
Kubernetes Submit Queue dcb1d2875e Merge pull request #47539 from gnufied/deprecate-keep-terminated-pod-volumes
Automatic merge from submit-queue (batch tested with PRs 45813, 49594, 49443, 49167, 47539)

Deprecate keep-terminated-pod-volumes

It was discussed and agreed by sig-storage that
this flag causes unnecessary confusion and is hard to keep
synchornized with controller's attach/detach functionality.

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

```release-note
keep-terminated-pod-volumes flag on kubelet is deprecated.
```
2017-07-28 07:22:41 -07:00
Dan Mace d08dfb92c7 Enable garbage collection of custom resources
Enhance the garbage collector to periodically refresh the resources it
monitors (via discovery) to enable custom resource definition GC.

This implementation caches Unstructured structs for any kinds not
covered by a shared informer. The existing meta-only codec only supports
compiled types; an improved codec which supports arbitrary types could
be introduced to optimize caching to store only metadata for all
non-informer types.
2017-07-28 10:00:10 -04:00
Kubernetes Submit Queue b3db5a20c1 Merge pull request #43494 from guangxuli/fix_k8s_kubelet_panix
Automatic merge from submit-queue (batch tested with PRs 49238, 49595, 43494, 47897, 48905)

Should not set struct pointer directly to interface which may cause potential panic

fix https://github.com/kubernetes/kubernetes/issues/43127 to avoid potential kubelet panic.

In our old implemention, interface `kubeDeps.EventClient ` (interface) will never equals to `nil` even if `eventClient `(struct pointer )was set to `nil`.  `kubeDeps.ExternalKubeClient` and `kubeDeps.KubeClient` also have same potential risk.
2017-07-28 02:12:56 -07:00
Kubernetes Submit Queue 7056b5ba70 Merge pull request #49238 from janetkuo/apps-v1beta2-rs
Automatic merge from submit-queue (batch tested with PRs 49238, 49595, 43494, 47897, 48905)

Add apps/v1beta2.ReplicaSet

~Depends on #48746~ (merged)
~Depends on #49357~ (merged)
xref: #49135

```release-note
Add a new API object apps/v1beta2.ReplicaSet
```
2017-07-28 02:12:51 -07:00
Justin Santa Barbara 81b0fa7b29 Revert "Remove old node role label that is not used by kubeadm"
This reverts commit e25a5b1546.
2017-07-28 02:26:43 -04:00
Kubernetes Submit Queue 803cb9303b Merge pull request #49495 from deads2k/controller-12-toleration
Automatic merge from submit-queue (batch tested with PRs 49665, 49689, 49495, 49146, 48934)

make it possible to allow discovery errors for controllers

Update the discovery client to return partial discovery information *and* an error.  Since we can aggregate API servers, discovery of some resources can fail independently.  Callers of this function who want to tolerate the errors can, existing callers will still get an error and fail in normal blocks.

@kubernetes/sig-api-machinery-misc @sttts
2017-07-27 21:45:34 -07:00
Zihong Zheng db379de778 Emit event and retry when fail to start healthz server on kube-proxy. 2017-07-27 20:54:51 -07:00
Bobby (Babak) Salamat de8689c99b Add priority admission controller 2017-07-27 18:44:40 -07:00
Daneyon Hansen 3d6a24c407 Lowercases hostname for kubeadm cert slice 2017-07-27 14:29:12 -07:00
Mike Danese fe7ba9e748 kubeadm: use kubelet bootstrap instead of reimplementing 2017-07-27 09:21:24 -07:00
deads2k b7286f3188 make it possible to allow discovery errors for controllers 2017-07-26 16:09:30 -04:00
Kubernetes Submit Queue 81c5547a18 Merge pull request #49514 from smarterclayton/move_bootstrap
Automatic merge from submit-queue (batch tested with PRs 47357, 49514, 49271, 49572, 49476)

Move client cert bootstrap code into pkg/kubelet/...

Keeps it better encapsulated. @deads2k
2017-07-26 12:03:45 -07:00
Janet Kuo 6eaf6884fb Bump ReplicaSet to apps/v1beta2 2017-07-26 09:51:41 -07:00
supereagle edce96c5b6 use the core client with version 2017-07-26 19:16:02 +08:00
Kubernetes Submit Queue 06e3a00a14 Merge pull request #47252 from sttts/sttts-crd-initializers
Automatic merge from submit-queue (batch tested with PRs 43443, 46193, 49071, 47252)

custom-resources: add initializer test
2017-07-25 21:52:52 -07:00
Kubernetes Submit Queue 4399fb2b87 Merge pull request #49071 from foxish/foxish-api
Automatic merge from submit-queue (batch tested with PRs 43443, 46193, 49071, 47252)

Add v1beta2.DaemonSet

Depends on https://github.com/kubernetes/kubernetes/pull/48746
Partly implements https://github.com/kubernetes/kubernetes/issues/49135

```release-note
Adding type apps/v1beta2.DaemonSet
```
2017-07-25 21:52:50 -07:00
Clayton Coleman 333536a68b
Move client cert bootstrap to a kubelet package
Makes it more clearly associated with the existing code and simplifies
cmd/kubelet/app.
2017-07-25 17:54:15 -04:00
Clayton Coleman 48236f0321
Move cmd/kubelet/app/bootstrap.go to a kubelet subpackage 2017-07-25 17:53:39 -04:00
Kubernetes Submit Queue 2189314895 Merge pull request #40050 from mtaufen/standalone-mode
Automatic merge from submit-queue (batch tested with PRs 48976, 49474, 40050, 49426, 49430)

Use presence of kubeconfig file to toggle standalone mode

Fixes #40049 

```release-note
The deprecated --api-servers flag has been removed. Use --kubeconfig to provide API server connection information instead. The --require-kubeconfig flag is now deprecated. The default kubeconfig path is also deprecated. Both --require-kubeconfig and the default kubeconfig path will be removed in Kubernetes v1.10.0.
```

/cc @kubernetes/sig-cluster-lifecycle-misc @kubernetes/sig-node-misc
2017-07-25 12:14:43 -07:00
Kubernetes Submit Queue 9350afd772 Merge pull request #48976 from supereagle/cleanup-api-package
Automatic merge from submit-queue (batch tested with PRs 48976, 49474, 40050, 49426, 49430)

Remove duplicated import and wrong alias name of api package

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

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

**Special notes for your reviewer**:
/assign @caesarxuchao

**Release note**:
```release-note
NONE
```
2017-07-25 12:14:38 -07:00
foxish 14d5793869 DS: changes to server and storage 2017-07-25 11:47:57 -07:00
Kubernetes Submit Queue 9c3d0e8a96 Merge pull request #48224 from deads2k/controller-11-reflectormetrics
Automatic merge from submit-queue (batch tested with PRs 48224, 45431, 45946, 48775, 49396)

add reflector metrics

This adds metrics (optionally prometheus) to reflectors so that you can see when one reflector is behaving poorly and just how poorly its doing.

@eparis 

```release-note
Adds metrics for checking reflector health.
```
2017-07-25 11:06:47 -07:00
Dr. Stefan Schimanski 7185624688 kube-apiserver: add CRD initializer test 2017-07-25 16:52:40 +02:00
Kubernetes Submit Queue a7c219f92b Merge pull request #49550 from allencloud/use-demorgans-to-make-code-more-readable
Automatic merge from submit-queue (batch tested with PRs 49286, 49550)

use demorgans to make startRouteController implementation more readable

Signed-off-by: allencloud <allen.sun@daocloud.io>



**What this PR does / why we need it**:
When I was learning controller manager, I found that there is a `TODO` which is to use demorgans to make code more readable. So I try to make it work.
 

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

**Special notes for your reviewer**:
NONE
**Release note**:

```release-note
NONE
```

ping @deads2k
2017-07-25 06:41:11 -07:00
deads2k 151d39682e add reflector metrics 2017-07-25 09:01:37 -04:00
Kubernetes Submit Queue c31a1379b8 Merge pull request #49498 from luxas/kubeadm_fix_config_validation
Automatic merge from submit-queue (batch tested with PRs 49498, 49192)

kubeadm: Make sure --config can be mixed with --skip-* flags

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

fixes: https://github.com/kubernetes/kubeadm/issues/352

**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**:
Should be a cherrypick candidate

**Release note**:

```release-note
kubeadm: Fixes a small bug where `--config` and `--skip-*` flags couldn't be passed at the same time in validation.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @ericchiang @wojtek-t
2017-07-25 02:43:11 -07:00
allencloud df2a1e50e3 use demorgans to make startRouteController implementation more readable
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-07-25 16:21:48 +08:00
Kubernetes Submit Queue 7f1d9382ec Merge pull request #48846 from dashpole/remove_ood
Automatic merge from submit-queue

Remove flags low-diskspace-threshold-mb and outofdisk-transition-frequency

issue: #48843

This removes two flags replaced by the eviction manager.  These have been depreciated for two releases, which I believe correctly follows the kubernetes depreciation guidelines.

```release-note
Remove depreciated flags: --low-diskspace-threshold-mb and --outofdisk-transition-frequency, which are replaced by --eviction-hard
```

cc @mtaufen since I am changing kubelet flags
cc @vishh @derekwaynecarr 
/sig node
2017-07-24 23:05:50 -07:00
Kubernetes Submit Queue e623fed778 Merge pull request #48636 from jingxu97/July/allocatable
Automatic merge from submit-queue (batch tested with PRs 48636, 49088, 49251, 49417, 49494)

Fix issues for local storage allocatable feature

This PR fixes the following issues:
1. Use ResourceStorageScratch instead of ResourceStorage API to represent
local storage capacity
2. In eviction manager, use container manager instead of node provider
(kubelet) to retrieve the node capacity and reserved resources. Node
provider (kubelet) has a feature gate so that storagescratch information
may not be exposed if feature gate is not set. On the other hand,
container manager has all the capacity and allocatable resource
information.

This PR fixes issue #47809
2017-07-24 19:30:33 -07:00
supereagle adc0eef43e remove duplicated import and wrong alias name of api package 2017-07-25 10:04:25 +08:00
Lucas Käldström aa46947557
kubeadm: Make sure --config can be mixed with --skip-* flags 2017-07-24 22:21:12 +03:00
Michael Taufen 38aee0464d Providing kubeconfig file is now the switch for standalone mode
Replaces use of --api-servers with --kubeconfig in Kubelet args across
the turnup scripts. In many cases this involves generating a kubeconfig
file for the Kubelet and placing it in the correct location on the node.
2017-07-24 11:03:00 -07:00
Clayton Coleman b9bebe8a4e
Use a client interface instead of a concrete type
Aids testing
2017-07-22 20:29:48 -04:00
Kubernetes Submit Queue a79e6b183d Merge pull request #49346 from caesarxuchao/generate-to-client-go
Automatic merge from submit-queue (batch tested with PRs 49326, 49394, 49346, 49379, 49399)

Make client-go authoritative

client-go now is authoritative except for `client-go/pkg/version`, which I think we can leave as is for a while.
2017-07-21 23:23:35 -07:00
Kubernetes Submit Queue 75b3a0f3de Merge pull request #48607 from luxas/kubeadm_cleanup_selfhosting
Automatic merge from submit-queue (batch tested with PRs 46210, 48607, 46874, 46598, 49240)

kubeadm: Make the hostPath volume mount code more secure

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

 - Refactors the hostpath volume mounting code for the Static Pods
 - Splits out the functionality that was in a big function to something testable
 - Unit test a lot
 - Adds support for mounting external etcd CA/cert/key files in an other path than `/etc/ssl/certs`. Before this you **had** to have your files in there or the apiserver would crashloop
 - Significantly improves comment coverage
 - Now only mounts the bare essentials instead of nearly everything. For example, don't mount full `/etc/kubernetes` when the only thing you need is `/etc/kubernetes/scheduler.conf`
 - Make everything but the etcd datadir read-only for components.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
cc @kubernetes/sig-cluster-lifecycle-pr-reviews
2017-07-21 17:00:15 -07:00
Chao Xu 44f0188fe7 generated innocuous change 2017-07-21 14:29:59 -07:00
Chao Xu 112510b774 move clientset's import_known_versions.go to kube-controller-manager 2017-07-21 13:35:23 -07:00
Kubernetes Submit Queue ae1ff1a2d4 Merge pull request #48746 from janetkuo/apps-v1beta2
Automatic merge from submit-queue

Add a new API version apps/v1beta2

xref: #49135
This PR adds a new API version `apps/v1beta2` which contains a copy (of types, conversions, and defaults) of `apps/v1beta1` StatefulSet, Deployment, and their subresources. Note that `apps/v1beta2` is still WIP and we will make breaking changes to it before releasing 1.8.

Moving core controllers (StatefulSet, Deployment, ReplicaSet, DaemonSet) to `apps/v1beta2` is the first step of moving them to `apps/v1` (GA). 

This PR is a starting point for DaemonSet and ReplicaSet to move from `/extensions` to `/apps` and for Deployment and StatefulSet to make some breaking changes (e.g. new defaults and/or remove deprecated fields).

```release-note
Add a new API version apps/v1beta2
```
2017-07-21 11:47:21 -07:00
Kubernetes Submit Queue 40249c061f Merge pull request #49366 from gmarek/coreEvents
Automatic merge from submit-queue

Explicitly use Core() client when creating eventClint

@sttts
2017-07-21 04:20:38 -07:00
Kubernetes Submit Queue ec9275d6b6 Merge pull request #49328 from euank/etcd-selinux-default
Automatic merge from submit-queue (batch tested with PRs 49328, 49285, 49307, 49127, 49163)

kubeadm: don't customize etcd selinux label

The original change that added the unconfined label included a comment
indicating it won't be needed in the future.
See: https://github.com/kubernetes/kubernetes/pull/33555#issuecomment-251126908

That time is now. https://github.com/kubernetes/kubernetes/pull/33663
has landed and means we no longer have to go out of our way to make that
work.

Removing the label also increases security since there wasn't really a
good reason for etcd to be run with such broad selinux privileges.

This also will allow kubeadm to avoid errors on distros without an spc_t
type, such as Gentoo and Container Linux (at the time of writing at
least).

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

**Release note**:
```release-note
NONE
```
2017-07-21 03:00:14 -07:00
gmarek 45b47c7faa Explicitly use Core() client when creating eventClint 2017-07-21 11:22:56 +02:00
Kubernetes Submit Queue 5644e3d770 Merge pull request #49227 from deads2k/quota-01-tighten
Automatic merge from submit-queue (batch tested with PRs 49107, 47177, 49234, 49224, 49227)

tighten quota controller interface

While debugging a quota performance problem, I had to chase some references deeper than necessary because the interfaces were overly broad. This tightens them.

```release-note
NONE
```
2017-07-20 15:08:27 -07:00
Euan Kemp 644aef100b kubeadm: don't customize etcd selinux label
The original change that added the unconfined label included a comment
indicating it won't be needed in the future.
See: https://github.com/kubernetes/kubernetes/pull/33555#issuecomment-251126908

That time is now. https://github.com/kubernetes/kubernetes/pull/33663
has landed and means we no longer have to go out of our way to make that
work.

Removing the label also increases security since there wasn't really a
good reason for etcd to be run with such broad selinux privileges.

This also will allow kubeadm to avoid errors on distros without an spc_t
type, such as Gentoo and Container Linux (at the time of writing at
least).

Fixes https://github.com/kubernetes/kubeadm/issues/269
2017-07-20 13:36:06 -07:00
David Ashpole 7a23f8b018 remove deprecated flags LowDiskSpaceThresholdMB and OutOfDiskTransitionFrequency 2017-07-20 13:23:13 -07:00
ymqytw 9b393a83d4 update godep 2017-07-20 11:03:49 -07:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
Janet Kuo 767082e8e9 Add new API version apps/v1beta2
Add a new API version apps/v1beta2 and enable it by default.
apps/v1beta2 has a copy of apps/v1beta1 types, except for
ControllerRevision.
2017-07-20 10:25:21 -07:00
Lucas Käldström e65d0bd514
kubeadm: Make the hostPath volume mount code more secure 2017-07-20 20:17:28 +03:00
Kubernetes Submit Queue 5529d01a22 Merge pull request #48810 from sttts/sttts-fuzzer-cleanup
Automatic merge from submit-queue (batch tested with PRs 49114, 48810)

Unify fuzzers and roundtrip tests

- reorganize apimachinery/pkg/api/testing package to avoid circular imports
- make fuzzers modular per apigroup
- add roundtrip test for meta types
- add roundtrip test for a couple of staging apigroups

Follow-up:

- split `pkg/api` tests by apigroup
2017-07-20 07:20:40 -07:00
Dr. Stefan Schimanski ecc811d263 Unify fuzzers and roundtrip tests 2017-07-20 12:31:00 +02:00
guangxuli d6e051ec95 Can not set struct pointer directly to interface(kubelet panic)
set default value explicitly

gofmt
2017-07-20 13:52:19 +08:00
Dr. Stefan Schimanski edfbb9aa64 Fixup go2idl references 2017-07-20 07:41:37 +02:00
Dr. Stefan Schimanski 2e6be8583d Move cmd/libs/go2idl/* to staging/src/k8s.io/kube-gen/cmd 2017-07-20 07:41:37 +02:00
Kubernetes Submit Queue 25d3523359 Merge pull request #48940 from rootfs/fc-fencing
Automatic merge from submit-queue (batch tested with PRs 48377, 48940, 49144, 49062, 49148)

support fc volume attach and detach

**What this PR does / why we need it**:
Support FC volume attach and detach to enforce RWO access

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-07-19 19:10:12 -07:00
Kubernetes Submit Queue 8d26afa8a6 Merge pull request #48377 from bsalamat/priority_class
Automatic merge from submit-queue

Add PriorityClass API object under new "scheduling" API group

**What this PR does / why we need it**: This PR is a part of a series of PRs to add pod priority to Kubernetes. This PR adds a new API group called "scheduling" with a new API object called "PriorityClass". PriorityClass maps the string value of priority to its integer value.

**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**: Given the size of this PR, I will add the admission controller for the PriorityClass in a separate PR.

**Release note**:

```release-note
Add PriorityClass API object under new "scheduling" API group
```

ref/ #47604
ref/ #48646
2017-07-19 19:04:29 -07:00
deads2k 62157572cf tighten quota controller interface 2017-07-19 15:36:45 -04:00
Kubernetes Submit Queue c0287ce420 Merge pull request #47316 from k82cn/k8s_47315
Automatic merge from submit-queue (batch tested with PRs 48981, 47316, 49180)

Added golint check for pkg/kubelet.

**What this PR does / why we need it**:
Added golint check for pkg/kubelet, and make golint happy.

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

**Release note**:
```release-note-none
```
2017-07-19 11:21:25 -07:00
Kubernetes Submit Queue cb1f42ad18 Merge pull request #49137 from deads2k/proxier-01-really-nil
Automatic merge from submit-queue (batch tested with PRs 49058, 49072, 49137, 49182, 49045)

check for nil value in interface for proxier health

golang allows for a non-nil interface to have a nil value (not type).  This results in an NPE at runtime.

@sttts remember that bit about go?  Trivia becomes real :(
2017-07-19 10:27:25 -07:00
deads2k 6d21f37aee check for nil value in interface for proxier health 2017-07-19 08:13:52 -04:00
Kubernetes Submit Queue defbe45397 Merge pull request #49130 from deads2k/server-30-admission
Automatic merge from submit-queue (batch tested with PRs 48043, 48200, 49139, 36238, 49130)

expose RegisterAllAdmissionPlugins so that admission chains can be reused

Exposes the admission plugin registration functions so that sets of plugins can be re-used.

@sttts @p0lyn0mial
2017-07-19 01:57:36 -07:00
Kubernetes Submit Queue 495f5b261f Merge pull request #49139 from deads2k/cli-15-proxy-defaults
Automatic merge from submit-queue (batch tested with PRs 48043, 48200, 49139, 36238, 49130)

expose method to allow externally setting defaults on an external type

The options are an exposed type.  This allows you to set the defaults on them.

@derekwaynecarr who normally owns this bit?
2017-07-19 01:57:30 -07:00
Kubernetes Submit Queue effcdda0ce Merge pull request #49055 from mbohlool/bugfix2
Automatic merge from submit-queue (batch tested with PRs 49055, 49128, 49132, 49134, 49110)

OpenAPI bug: Array/Map Ptr Elements' handing was incorrect

If you have an array of map of pointers, OpenAPI spec generation would fail.

fixes: #49074
2017-07-18 21:54:18 -07:00
Klaus Ma 63b78a37e0 Added golint check for pkg/kubelet. 2017-07-19 11:33:06 +08:00
Kubernetes Submit Queue ccaaf5cad5 Merge pull request #48232 from caesarxuchao/move-admission-v1alph1
Automatic merge from submit-queue (batch tested with PRs 48702, 48965, 48740, 48974, 48232)

Move admission/v1alpha1 to k8s.io/api

Fix https://github.com/kubernetes/kubernetes/issues/47972
2017-07-18 20:06:21 -07:00
Kubernetes Submit Queue fc1d2b3be7 Merge pull request #48256 from xiangpengzhao/move-pkg-util
Automatic merge from submit-queue (batch tested with PRs 48481, 48256)

Refactor: pkg/util into sub-pkgs

**What this PR does / why we need it**:
- move code in pkg/util into sub-pkgs
- delete some unused funcs

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

**Special notes for your reviewer**:
This is the final work of #15634. It will close that issue.
/cc @thockin 

**Release note**:

```release-note
NONE
```
2017-07-18 18:19:19 -07:00
Bobby Salamat 33e6a476ba Add PriorityClass API
Add PriorityClass to pkg/registry

Add PriorityClass to pkg/master/master.go

Add PriorityClass to import_know_versions.go

Update linted packages

minor fix
2017-07-18 17:47:57 -07:00
Chao Xu 57a96ca40a move admission/v1alpha1 to k8s.io/api 2017-07-18 13:26:20 -07:00
Kubernetes Submit Queue bc2e5381e9 Merge pull request #49102 from aleksandra-malinowska/kubemark-node-provider-id
Automatic merge from submit-queue (batch tested with PRs 46094, 48544, 48807, 49102, 44174)

add InstanceID to fake cadvisor (used in Kubemark)

This change is for setting Node.Spec.ProviderID field in Kubemark hollow nodes. It shouldn't affect other tests using cadvisor.Fake as field is nil by default.

cc @gmarek
2017-07-18 11:20:57 -07:00
Kubernetes Submit Queue 5bbdfc6661 Merge pull request #48544 from sttts/sttts-typed-deepcopy-1.8
Automatic merge from submit-queue (batch tested with PRs 46094, 48544, 48807, 49102, 44174)

Static deepcopy – phase 1

This PR is the follow-up of https://github.com/kubernetes/kubernetes/pull/36412, replacing the
dynamic reflection based deepcopy with static DeepCopy+DeepCopyInto methods on API types.

This PR **does not yet** include the code dropping the cloner from the scheme and all the
porting of the calls to scheme.Copy. This will be part of a follow-up "Phase 2" PR.

A couple of the commits will go in first:
- [x] audit: fix deepcopy registration  https://github.com/kubernetes/kubernetes/pull/48599
- [x] apimachinery+apiserver: separate test types in their own packages #48601 
- [x] client-go: remove TPR example #48604
- [x] apimachinery: remove unneeded GetObjectKind() impls #48608 
- [x] sanity check against origin, that OpenShift's types are fine for static deepcopy https://github.com/deads2k/origin/pull/34

TODO **after** review here:
- [x] merge https://github.com/kubernetes/gengo/pull/32 and update vendoring commit
2017-07-18 11:20:51 -07:00
deads2k 41a4faa611 expose method to allow externally setting defaults on an external type 2017-07-18 13:56:25 -04:00
deads2k b00d19608a expose RegisterAllAdmissionPlugins so that admission chains can be built reused 2017-07-18 13:30:06 -04:00
Kubernetes Submit Queue 4103f40fc2 Merge pull request #49046 from luxas/kubeadm_markmaster_phase
Automatic merge from submit-queue (batch tested with PRs 48333, 48806, 49046)

kubeadm: Split out markmaster to its own phase

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

Splits out related and atomic code into its own phase that can be invokable easily from the CLI.
Makes the code much easier to read by not using recursion and `wait.InfinitePoll` _inside_ of a recursing function, etc.

**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/53
Part of this more long-term goal: https://github.com/kubernetes/kubeadm/issues/148

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
2017-07-18 06:25:05 -07:00
Aleksandra Malinowska c174625116 add InstanceID to fake cadvisor (used in Kubemark) 2017-07-18 12:10:54 +02:00
Alexander Kanevskiy ef048142a5 Cleanup usage of cmd/kubeadm/app/images in addons
Maintain kube-proxy DaemonSet definition in one place
2017-07-18 11:24:15 +03:00
Lucas Käldström 0d3218faef
kubeadm: Split out markmaster to its own phase 2017-07-18 11:08:43 +03:00
Dr. Stefan Schimanski 8dd0989b39 Update generated code 2017-07-18 09:28:49 +02:00
Dr. Stefan Schimanski 39d95b9b06 deepcopy: add interface deepcopy funcs
- add DeepCopyObject() to runtime.Object interface
- add DeepCopyObject() via deepcopy-gen
- add DeepCopyObject() manually
- add DeepCopySelector() to selector interfaces
- add custom DeepCopy func for TableRow.Cells
2017-07-18 09:28:47 +02:00
xiangpengzhao 01daf707c5 Refactor: pkg/util into sub-pkgs 2017-07-18 14:34:08 +08:00
mbohlool 4a7e1df8e0 OpenAPI bug: Array/Map Ptr Elements' handing was incorrect 2017-07-17 22:45:30 -07:00
Kubernetes Submit Queue d3ff93efff Merge pull request #49018 from luxas/kubeadm_cleanup_kubernetesdir
Automatic merge from submit-queue (batch tested with PRs 49019, 48919, 49040, 49018, 48874)

kubeadm: Remove the old KubernetesDir envparam

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

The last piece of https://github.com/kubernetes/kubernetes/issues/48053 for moving the env params into the API, and the KubernetesDir into a constant.

After this pretty mechanical change, we might offer short-hand functions in constants like `GetStaticPodManifestDir()` etc easily in order to centralize the `filepath.Join` logic into one place.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
cc @kubernetes/sig-cluster-lifecycle-pr-reviews @fabriziopandini
2017-07-17 21:25:11 -07:00
Kubernetes Submit Queue 023fed7176 Merge pull request #49019 from luxas/kubeadm_remove_old_comments
Automatic merge from submit-queue

kubeadm: Remove some old comments

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

Removes old and outdated comments.

**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
```
@dmmcquay
2017-07-17 21:13:59 -07:00
Kubernetes Submit Queue 96f7788f78 Merge pull request #48797 from FengyunPan/fix-empty-cidr
Automatic merge from submit-queue (batch tested with PRs 48231, 47377, 48797, 49020, 49033)

Fix parsing empty CIDR

Fix #48795
Checking ClusterCIDR and ServiceCIDR before parsing them.

**Release note**:
```release-note
NONE
```
2017-07-17 19:37:45 -07:00
Kubernetes Submit Queue 68fcc59214 Merge pull request #48231 from jcbsmpsn/update-kubelet-to-client-go
Automatic merge from submit-queue (batch tested with PRs 48231, 47377, 48797, 49020, 49033)

Migrate kubelet and linked code from clientset_generated to client-go

Ran a script in the kubernetes repo to migrate kubelet and linked code from clientset_generated package imports to client-go imports.

**NOTE:** There are also some manual changes that were made in order to accommodate some
differences between clientset_generated and client-go. The manual changes are isolated into a
single commit titled "Manual changes."

```sh
#! /bin/bash

for file in $(find . \( -name "clientset_generated" -o -name "informers_generated" \) -prune -o -type f -name "*.go"); do

  if [[ -d $file ]]; then
    continue
  fi

  if [[ $file == "./cmd/libs/go2idl/informer-gen/main.go" ]]; then
    continue
  fi

  sed -i '
      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"|clientset "k8s.io/client-go/kubernetes"|;

      # Correct a couple of unique cases.
      s|clientset clientset "k8s.io/client-go/kubernetes"|clientset "k8s.io/client-go/kubernetes"|;
      s|cs clientset "k8s.io/client-go/kubernetes"|clientset "k8s.io/client-go/kubernetes"|;
      s|VersionedClientSetPackage: clientset "k8s.io/client-go/kubernetes"|VersionedClientSetPackage: "k8s.io/client-go/kubernetes"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/certificates/v1beta1"|"k8s.io/client-go/kubernetes/typed/certificates/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1"|"k8s.io/client-go/kubernetes/typed/core/v1"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/extensions/v1beta1"|"k8s.io/client-go/kubernetes/typed/extensions/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/autoscaling/v1"|"k8s.io/client-go/kubernetes/typed/autoscaling/v1"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/authentication/v1"|"k8s.io/client-go/kubernetes/typed/authentication/v1"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/authorization/v1beta1"|"k8s.io/client-go/kubernetes/typed/authorization/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1"|"k8s.io/client-go/kubernetes/typed/apps/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1beta1"|"k8s.io/client-go/kubernetes/typed/rbac/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake"|"k8s.io/client-go/kubernetes/fake"|;

      s|"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1/fake"|"k8s.io/client-go/kubernetes/typed/core/v1/fake"|;

      s|k8s.io/kubernetes/pkg/client/clientset_generated/clientset|k8s.io/client-go/kubernetes|;



      s|informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions"|"k8s.io/client-go/informers"|;

      s|"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/core/v1"|"k8s.io/client-go/informers/core/v1"|;

      s|"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/apps/v1beta1"|"k8s.io/client-go/informers/apps/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/extensions/v1beta1"|"k8s.io/client-go/informers/extensions/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/batch/v1"|"k8s.io/client-go/informers/batch/v1"|;

      s|"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/autoscaling/v1"|"k8s.io/client-go/informers/autoscaling/v1"|;

      s|"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/policy/v1beta1"|"k8s.io/client-go/informers/policy/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/certificates/v1beta1"|"k8s.io/client-go/informers/certificates/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/storage/v1"|"k8s.io/client-go/informers/storage/v1"|;



      s|"k8s.io/kubernetes/pkg/client/listers/core/v1"|"k8s.io/client-go/listers/core/v1"|;

      s|"k8s.io/kubernetes/pkg/client/listers/apps/v1beta1"|"k8s.io/client-go/listers/apps/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/listers/extensions/v1beta1"|"k8s.io/client-go/listers/extensions/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/listers/autoscaling/v1"|"k8s.io/client-go/listers/autoscaling/v1"|;

      s|"k8s.io/kubernetes/pkg/client/listers/batch/v1"|"k8s.io/client-go/listers/batch/v1"|;

      s|"k8s.io/kubernetes/pkg/client/listers/certificates/v1beta1"|"k8s.io/client-go/listers/certificates/v1beta1"|;

      s|"k8s.io/kubernetes/pkg/client/listers/storage/v1"|"k8s.io/client-go/listers/storage/v1"|;

      s|"k8s.io/kubernetes/pkg/client/listers/policy/v1beta1"|"k8s.io/client-go/listers/policy/v1beta1"|;


  ' $file
done

hack/update-bazel.sh

hack/update-gofmt.sh
```
2017-07-17 19:37:41 -07:00
Kubernetes Submit Queue 290a0edaf3 Merge pull request #48808 from kad/safe-docker-tags
Automatic merge from submit-queue (batch tested with PRs 49017, 45440, 48384, 45894, 48808)

Make sure that image tags contain only allowed characters.

**What this PR does / why we need it**:
Version strings can contain symbols that are not allowed
as part of image tags. Replace those with underscores.

**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**:
Part of work related to usage of CI images which has versions like "v1.8.0-alpha.1.910+5ca03d674e1495" but image tags in registry are "v1.8.0-alpha.1.910_5ca03d674e1495"

Attn @luxas 

**Release note**:
```release-note
NONE
```
2017-07-17 16:26:59 -07:00
Jacob Simpson b565f53822 update-bazel.sh 2017-07-17 15:06:08 -07:00