Commit Graph

3246 Commits (a6fa5c2bfdf3bc89e29e59c8b4dd0fb72fb4d73b)

Author SHA1 Message Date
Kubernetes Submit Queue ae4db79d1c Merge pull request #39118 from bowei/cleanup-dns
Automatic merge from submit-queue (batch tested with PRs 39006, 39078, 37188, 39118)

Cleanup dns

* Remove hostname endpoints annotation (was beta feature)
* Remove references to non-client-go API
* Replaces references to internal kubernetes API with client-go.
2016-12-22 17:47:31 -08:00
Andy Goldstein f0247ea595 Fix skipping - protobuf fields
Match changes in https://github.com/kubernetes/gengo/pull/19
2016-12-22 20:45:05 -05:00
wlan0 75da310757 sanitize names and add more comments, and other essential boilerplate changes 2016-12-22 14:37:15 -08:00
wlan0 1e48fd18cb add cloud-controller-manager as the first step in breaking controller-manager 2016-12-22 14:37:15 -08:00
Klaus Ma b0dfa4ad47 Add event when failed to open local port. 2016-12-23 04:51:12 +08:00
Bowei Du 820062897e Remove references to non-client-go API
Replaces references to internal kubernetes API with client-go.
2016-12-22 11:06:23 -08:00
Devan Goodwin bf69fb1747 kubeadm: Default to using token discovery.
Recent changes to support multiple methods for discovery meant that
"kubeadm init" no longer was sufficient and users would need to add
"--discovery token://" to achieve the same results.

Instead lets assume discovery if the user does not specify anything else
to maintain parity and the brevity of our original instructions.
2016-12-22 12:54:34 -04:00
pospispa ef43f82de8 Recycle Pod Template Check
The kube-controller-manager has two command line arguments (--pv-recycler-pod-template-filepath-hostpath and --pv-recycler-pod-template-filepath-nfs) that specify a recycle pod template. The recycle pod template may not contain the volume that shall be recycled.

A check is added to make sure that the recycle pod template contains at least a volume.
2016-12-22 17:44:32 +01:00
Kubernetes Submit Queue fc41bc6ec6 Merge pull request #39091 from deads2k/api-54-move-authn
Automatic merge from submit-queue

remove unneeded authenticator dependencies from genericapiserver

Refactors the authenticator options to remove unneeded dependencies.

@sttts
2016-12-22 06:48:24 -08:00
deads2k ab1b77673f decouple genericapiserver from non-generic authenticator 2016-12-22 07:48:08 -05:00
deads2k a3564c0aa8 start kubeapiserver package for sharing between kubeapiserver and federation 2016-12-22 07:43:42 -05:00
Klaus Ma e901800687 Update NodeRef to v1.ObjectReference. 2016-12-22 16:28:20 +08:00
Kubernetes Submit Queue 4ee51fcc2d Merge pull request #39107 from spxtr/fix-kubeadmtest
Automatic merge from submit-queue

Fix kubeadm test in bazel.
2016-12-21 21:53:32 -08:00
Joe Finney 8ce98ba3d4 Make one of the go2idl unit tests pass in a sandbox. 2016-12-21 16:01:11 -08:00
Joe Finney ecaeab60e3 Fix kubeadm test in bazel. 2016-12-21 15:15:00 -08:00
Alexander Kanevskiy 2ac85d762f Fix cloud-config name in reset tests
Default name is /etc/kubernetes/cloud-config, thus tests
should cover "cloud-config" and not "cloud-config.json"
2016-12-21 14:42:11 +02:00
Kubernetes Submit Queue 52df372f9b Merge pull request #35805 from dgoodwin/token-mgmt
Automatic merge from submit-queue

Implement kubeadm bootstrap token management

Creates bootstrap tokens as secrets per the specification in #30707 

_WARNING_: These are not currently hooked up to the discovery service or the token it creates.

Still TODO:
- [x] delete tokens
- [x] merge with #35144 and adopt it's testing approach
- [x] determine if we want wholesale json output & templating like kubectl (we do not have an API object with the data we want here) may require a bit of plumbing.
- [x] allow specifying a token duration on the CLI
- [x] allow configuring the default token duration
- [x] hook up the initial token created during init

Sample output:

```
(root@centos1 ~) $ kubeadm token create
Running pre-flight checks
<cmd/token> Token secret created: f6dc69.c43e491752c4a0fd
(root@centos1 ~) $ kubeadm token create
Running pre-flight checks
<cmd/token> Token secret created: 8fad2f.e7b78c8a5f7c7b9a
(root@centos1 ~) $ kubeadm token list  
Running pre-flight checks
ID        TOKEN                     EXPIRATION
44d805    44d805.a4e78b6cf6435e33   23h
4f65bb    4f65bb.d006a3c7a0e428c9   23h
6a086e    6a086e.2ff99f0823236b5b   23h
8fad2f    8fad2f.e7b78c8a5f7c7b9a   23h
f6dc69    f6dc69.c43e491752c4a0fd   23h
f81653    f81653.9ab82a2926c7e985   23h
```
2016-12-20 14:44:40 -08:00
Devan Goodwin bfe345dd86 Implement kubeadm bootstrap token management.
Adds kubeadm subcommands to create, list, and delete bootstrap tokens.
Tokens can be created with a TTL duration, or 0 for tokens that will not
expire. The create command can also be used to specify your own token
(for use when bootstrapping masters and nodes in parallel), or update an
existing token's secret or ttl.

Marked "ex" for experimental for now as the boostrap controllers are not
yet hooked up in core.
2016-12-20 11:43:55 -04:00
Dr. Stefan Schimanski d582c2d46d Update bazel and linted files 2016-12-19 23:13:14 +01:00
Dr. Stefan Schimanski 90216ce721 pkg/apiserver: split code out of pkg/apiserver
- move rest handler into handlers package
- move errors into handlers/errors package
- move negotation code into handlers/negotation package
- move http response writer helpers into handlers/responsewriter package
- split up pkg/apiserver/apiserver.go

Note: this is only an intermediate step towards a proper genericapiserver
package hierarchy.
2016-12-19 23:13:11 +01:00
deads2k 8f1677b7c8 add service status detection to kubernetes-discovery 2016-12-19 14:56:20 -05:00
Kubernetes Submit Queue 7e1cacaa91 Merge pull request #38440 from justinsb/conversion_gen_safe_at_some_speeds
Automatic merge from submit-queue

conversion-gen: add --skip-unsafe flag

We should expose the SkipUnsafe option, for legacy compatability, so
that conversion-go can be used in other projects, and for platforms
where unsafe is not available.

Make unsafe code generation the default though, and have the help text
hint that the resulting code is sub-optimal.
2016-12-18 09:16:16 -08:00
Kubernetes Submit Queue 01b9d49673 Merge pull request #38677 from bruceauyeung/k8s-branch-fix-typos-and-comments
Automatic merge from submit-queue

path.Clean paths in GlobalEnvParams and remove unnecessary path.Join

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

1. clean all paths in `GlobalEnvParams`
1. remove unnecessary path.Join call in `pki.go`
2. fix some typos and comment errors

Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-17 12:16:47 -08:00
Lucas Käldström 3c5b5f5963 Remove all MAINTAINER statements in the codebase as they aren't very useful and now deprecated 2016-12-17 20:34:10 +02:00
Kubernetes Submit Queue 5b2823adb9 Merge pull request #38191 from sttts/sttts-move-master-options
Automatic merge from submit-queue

Move non-generic apiserver code out of the generic packages
2016-12-17 01:25:45 -08:00
bruceauyeung 02c1814113 remove unnecessary path.Join
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-17 11:57:00 +08:00
Maciej Szulik cdec94523e Remove extensions/v1beta1 Job - generated changes 2016-12-17 00:07:25 +01:00
Maciej Szulik 9f064c57ce Remove extensions/v1beta1 Job 2016-12-17 00:07:24 +01:00
Maciej Szulik e0ecb09fda Fix variable name conflict in clientset generation 2016-12-17 00:07:24 +01:00
Kubernetes Submit Queue faf959b522 Merge pull request #38869 from deads2k/api-52-in-cluster
Automatic merge from submit-queue

use in-cluster kubeconfig for genericapiserver

Allow the use of the in-cluster config to communicate with the core API server for delegated authn/authz for an addon API server.

@kubernetes/sig-api-machinery @sttts
2016-12-16 11:30:27 -08:00
deads2k bbcbdaffd1 use in-cluster kubeconfig for genericapiserver 2016-12-16 12:40:33 -05:00
Dr. Stefan Schimanski 7adaac79ca Update bazel 2016-12-16 17:49:23 +01:00
Dr. Stefan Schimanski aa81e1d51d pkg/apiserver: move validation.go into pkg/registry 2016-12-16 17:49:22 +01:00
Dr. Stefan Schimanski 3be6b3c045 pkg/apiserver: remove unused code 2016-12-16 17:47:47 +01:00
Dr. Stefan Schimanski 5e8ca29a76 Clean up apiserver and federation defaulting and validation 2016-12-16 17:23:43 +01:00
Dr. Stefan Schimanski 7267299c3c genericapiserver: move MasterCount and service options into master 2016-12-16 17:23:43 +01:00
Kubernetes Submit Queue de3b73bd43 Merge pull request #38826 from sttts/sttts-secret-routes-real-mux
Automatic merge from submit-queue

genericapiserver: turn APIContainer.SecretRoutes into a real ServeMux

The secret routes `Mux` is actually a `http.ServeMux` and we are type-casting to it. For downstream we want to wrap it into a restful container which also needs a real `http.ServeMux`.
2016-12-16 05:51:45 -08:00
Dr. Stefan Schimanski e49fb2f1f4 genericapiserver: rename SecretRoutes -> UnlistedRoutes 2016-12-16 11:04:29 +01:00
Kubernetes Submit Queue e2a9fc1022 Merge pull request #38841 from mikedanese/fix-tests
Automatic merge from submit-queue

bazel: fix some unit tests
2016-12-15 20:19:46 -08:00
Mike Danese 8fdec87d19 bazel: fix some unit tests 2016-12-15 18:36:22 -08:00
Mike Danese 7945c437e5 kubeadm: support --discovery token:// 2016-12-15 13:54:49 -08:00
Mike Danese 690c7e578b kubeadm: refactor discovery behind an interface 2016-12-15 13:54:49 -08:00
Kubernetes Submit Queue d8efc779ed Merge pull request #38154 from caesarxuchao/rename-release_1_5
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Rename "release_1_5" clientset to just "clientset"

We used to keep multiple releases in the main repo. Now that [client-go](https://github.com/kubernetes/client-go) does the versioning, there is no need to keep releases in the main repo. This PR renames the "release_1_5" clientset to just "clientset", clientset development will be done in this directory.

@kubernetes/sig-api-machinery @deads2k 

```release-note
The main repository does not keep multiple releases of clientsets anymore. Please find previous releases at https://github.com/kubernetes/client-go
```
2016-12-14 14:21:51 -08:00
Chao Xu 6709b7ada2 run hack/update-codegen.sh
run hack/verify-gofmt.sh
update bazel
2016-12-14 12:39:49 -08:00
Chao Xu b2ab99a4f4 rename cmd/kubernetes-discovery/.../release_1_5 to clientset 2016-12-14 12:39:49 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Chao Xu f6f71c32b6 change release_1_5 to clientset in staging/copy.sh
modify update-codegen.sh
2016-12-14 12:39:36 -08:00
Kubernetes Submit Queue 6fa4042211 Merge pull request #38690 from sttts/sttts-swagger-postbuildhandler
Automatic merge from submit-queue

genericapiserver: unify swagger and openapi in config

- make swagger config customizable
- remove superfluous `Config.Enable*` flags for OpenAPI and Swagger.

This is necessary for downstream projects to tweak the swagger spec.
2016-12-14 11:11:02 -08:00
Dr. Stefan Schimanski cab89a67df genericapiserver: unify swagger and openapi in config 2016-12-14 18:41:04 +01:00
Kubernetes Submit Queue bf7daae954 Merge pull request #38724 from deads2k/fed-12-fix-exec
Automatic merge from submit-queue

fix connection upgrades through kuberentes-discovery

The initial upgrade through the proxy doesn't use the passed transport to handle the communication to the remote side.  Since we need auth proxy headers, this broke the upgrade for exec.

This sets those headers once if its an upgrade request (the transport stomps them if called anyway, so it won't shadow.).

@sttts I think this is the last required piece.  Then we start wiring in for e2e.
2016-12-14 07:45:04 -08:00
Kubernetes Submit Queue 7d235e147c Merge pull request #38175 from sttts/sttts-server-fatal
Automatic merge from submit-queue

apiserver(s): Replace glog.Fatals with fmt.Errorfs
2016-12-14 02:00:39 -08:00
Dr. Stefan Schimanski e57ef4327f Document broken behaviour with KUBE_API_VERSIONS 2016-12-14 09:35:47 +01:00
Dr. Stefan Schimanski 543417dbf0 Replace apiserver glog.Fatals with fmt.Errorfs 2016-12-14 09:35:47 +01:00
deads2k cd5f8a85f0 support exec through discovery 2016-12-13 15:55:54 -05:00
deads2k 6d081e4566 wire goflags (including glog) to kubernetes-discovery 2016-12-13 11:06:51 -05:00
Lucas Käldström 96850dc600 Set --anonymous-auth to false on v1.5 clusters to preserve the locked-down v1.4 behaviour 2016-12-13 17:51:15 +02:00
Kubernetes Submit Queue f8cab39f1d Merge pull request #38624 from deads2k/fed-10-proxy
Automatic merge from submit-queue (batch tested with PRs 38315, 38624, 38572, 38544)

kubernetes-discovery proxy

The last commit adds an authenticating (but not authorizing) proxy to `kubernetes-discovery`.  The other commits are in the submit queue already.

@sttts @cjcullen This is it.  After this we can start e2e wiring.
2016-12-12 19:42:33 -08:00
Kubernetes Submit Queue 8abbedae54 Merge pull request #38315 from mikedanese/pin-gazel
Automatic merge from submit-queue

Pin gazel to a version and support cgo

This fixes the bazel build.

@krousey who is buildcop
2016-12-12 19:32:29 -08:00
Kubernetes Submit Queue 3dcbafa861 Merge pull request #36393 from apelisse/owners-cmd-kubeadm
Automatic merge from submit-queue

Curating Owners: cmd/kubeadm

cc @jbeda @mikedanese @luxas @errordeveloper

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone lgtms and then someone
experienced in the project approves), we are adding new reviewers to
existing owners files.


If You Care About the Process:
------------------------------

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
well: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.

Also, see https://github.com/kubernetes/contrib/issues/1389.

TLDR:
-----

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:

1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.

2. The pull-request is made editable, please edit the `OWNERS` file to
remove the names of people that shouldn't be reviewing code in the future in
the **reviewers** section. You probably do NOT need to modify the **approvers**
section. Names asre sorted by relevance, using some secret statistics.

3. Notify me if you want some OWNERS file to be removed.  Being an
approver or reviewer of a parent directory makes you a reviewer/approver
of the subdirectories too, so not all OWNERS files may be necessary.

4. Please use ALIAS if you want to use the same list of people over and
over again (don't hesitate to ask me for help, or use the pull-request
above as an example)
2016-12-12 17:30:24 -08:00
bruceauyeung 12e97da0c1 use bytes.Buffer instead of append for error string concat
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-13 09:10:13 +08:00
Antoine Pelisse db0f04fa20 Update OWNERS approvers and reviewers: cmd/kube-apiserver 2016-12-12 16:02:39 -08:00
Antoine Pelisse 2084e0e665 Update OWNERS approvers and reviewers: cmd/kubeadm 2016-12-12 15:48:47 -08:00
Lucas Käldström 5222bd3e34 Bump default kubernetes version when no internet is present to v1.5 2016-12-12 23:59:14 +02:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
deads2k b81645e382 add proxying capability to kubernetes-discovery 2016-12-12 16:26:33 -05:00
deads2k 6421405d0e create hack/local-up-discovery.sh 2016-12-12 08:40:00 -05:00
Kubernetes Submit Queue e732ee70f4 Merge pull request #38406 from liggitt/remove-internal-json-annotations
Automatic merge from submit-queue

Remove json serialization annotations from internal types

fixes #3933

Internal types should never be serialized, and including json serialization tags on them makes it possible to accidentally do that without realizing it.

fixes in this PR:

* types
  * [x] remove json tags from internal types
  * [x] fix references from serialized types to internal ObjectMeta
* generation
  * [x] remove generated json codecs for internal types (they should never be used)
* kubectl
  * [x] fix `apply` to operate on versioned object
  * [x] fix sorting by field to operate on versioned object
  * [x] fix `--record` to build annotation patch using versioned object
* hpa
  * [x] fix unmarshaling to internal CustomMetricTargetList in validation
* thirdpartyresources
  * [x] fix encoding API responses using internal ObjectMeta
* tests
  * [x] fix tests to use versioned objects when checking encoded content
  * [x] fix tests passing internal objects to generic printers

follow ups (will open tracking issues or additional PRs):
- [ ] remove json tags from internal kubeconfig types (`kubectl config set` pathfinding needs to work against external type)
- [ ] HPA should version CustomMetricTargetList serialization in annotations
- [ ] revisit how TPR resthandlers encoding objects
- [ ] audit and add tests for printer use (human-readable printer requires internal versions, generic printers require external versions)
- [ ] add static analysis tests preventing new internal types from adding tags
- [ ] add static analysis tests requiring json tags on external types (and enforcing lower-case first letter)
- [ ] add more tests for `kubectl get` exercising known and unknown types with all output options
2016-12-10 14:00:17 -08:00
Kubernetes Submit Queue 025c57e62b Merge pull request #37783 from brendandburns/acr
Automatic merge from submit-queue

Add support for Azure Container Registry, update Azure dependencies

@colemickens
2016-12-09 23:52:41 -08:00
Kubernetes Submit Queue ac05e7135a Merge pull request #37568 from luxas/various_kubeadm_improvements
Automatic merge from submit-queue (batch tested with PRs 37270, 38309, 37568, 34554)

kubeadm UX improvements for the v1.5 stable release

This PR targets the next stable kubeadm release.

It's work in progress, but please comment on it and review, since there are many changes.

I tried to group the commits logically, so you can review them separately.

Q: Why this large PR? Why not many small?
A: Because of the Submit Queue and the time it takes.

PTAL @kubernetes/sig-cluster-lifecycle

_Edit:_ This work was splitted up in three PRs in total
2016-12-09 14:11:19 -08:00
Jordan Liggitt 4536388909
Update bazel 2016-12-09 16:26:06 -05:00
Jordan Liggitt fcf5bbccd6
Fix references from serializable types to use v1.ObjectMeta 2016-12-09 16:26:04 -05:00
Jordan Liggitt 711986876b
Remove generated codecs for internal types 2016-12-09 16:26:04 -05:00
Jordan Liggitt d5afb71cf4
Remove json serialization annotations from internal types 2016-12-09 16:26:03 -05:00
Lucas Käldström b0603046b4 Fix review feedback, bazel files, tests and the dnsmasq-metrics spec. Set --kubelet-preferred-address-types on v1.5 and higher clusters 2016-12-09 22:16:37 +02:00
Kubernetes Submit Queue 5b5b1e7533 Merge pull request #38371 from wojtek-t/get_options_in_client
Automatic merge from submit-queue (batch tested with PRs 38354, 38371)

Add GetOptions parameter to Get() calls in client library

Ref #37473 

This PR is super mechanical - the non trivial commits are:
- Update client generator
- Register GetOptions in batch/v2alpha1 group
2016-12-09 04:12:09 -08:00
Kubernetes Submit Queue 3a85ad9514 Merge pull request #38354 from bruceauyeung/k8s-branch-blank-validate-on-env-params
Automatic merge from submit-queue

trimspace on user specified env params

**What this PR does / why we need it**:
before this PR, for example, if user `export KUBE_REPO_PREFIX=" "`, kubeadm will get an absolutely invalid repo_prefix.
this PR trims all leading and trailing white spaces from user specified env params.

Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-09 03:43:16 -08:00
Lucas Käldström 810e9e107f Refactor the whole binary, a lot of changes in one commit I know, but I just hacked on this and modified everything I thought was messy or could be done better.
Fix boilerplates, comments in the code and make the output of kubeadm more user-friendly
Start using HostPKIPath and KubernetesDir everywhere in the code, so they can be changed for real
More robust kubeadm reset code now.
Removed old glog-things from app.Run()
Renamed /etc/kubernetes/cloud-config.json to /etc/kubernetes/cloud-config since it shouldn't be a json file
Simplification of the code
Less verbose output from master/pki.go
Cleaned up dead code

Start a small logging/output framework:
 - fmt.Println("[the-stage-here] Capital first letter of this message. Tell the user what the current state is")
 - fmt.Printf("[the-stage-here] Capital first letter. Maybe a [%v] in the end if an error should be displayed. Always ends with \n")
 - fmt.Errorf("Never starts with []. Includes a short error message plus the underlying error in [%v]. Never ends with \n")
2016-12-09 12:48:12 +02:00
Lucas Käldström e46d8fef60 Run the root check before the other checks in order to fail fast if non-root to avoid strange errors. Also auto-start the kubelet if inactive 2016-12-09 12:48:11 +02:00
Lucas Käldström 95d97a0e8e Mark socat, ethtool and ebtables as soft deps, since kubelet can be run in a container. Also refactor preflight.go a little bit and improve logging 2016-12-09 12:48:11 +02:00
Wojciech Tyczynski aa7da5231f Update bazel files 2016-12-09 09:42:02 +01:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
Wojciech Tyczynski cff55e5894 Autogenerate clients 2016-12-09 09:42:01 +01:00
Wojciech Tyczynski 31a5333548 Update client generator 2016-12-09 09:42:00 +01:00
Kubernetes Submit Queue 98c4c73c71 Merge pull request #37770 from enj/enj/r/storage_decorator
Automatic merge from submit-queue (batch tested with PRs 38278, 37770)

Refactor REST storage to use generic defaults

This removes the repetition in the REST storage builders by moving the logic to `restoptions.ApplyOptions`.  `registry.StorageWithCacher`/`generic.StorageDecorator` no longer assume that they can build the `keyFunc` for arbitrary objects.  `restoptions.ApplyOptions` uses the `registry.Store`'s `KeyFunc` for its call to `generic.StorageDecorator`.

```release-note
Cluster federation servers have changed the location in etcd where federated services are stored, so existing federated services must be deleted and recreated. Before upgrading, export all federated services from the federation server and delete the services. After upgrading the cluster, recreate the federated services from the exported data.
```
2016-12-09 00:25:35 -08:00
Justin Santa Barbara dd351db799 conversion-gen: add --skip-unsafe flag
We should expose the SkipUnsafe option, for legacy compatability, so
that conversion-go can be used in other projects, and for platforms
where unsafe is not available.

Make unsafe code generation the default though, and have the help text
hint that the resulting code is sub-optimal.
2016-12-09 02:33:22 -05:00
Brendan Burns 91f19e3dfc Add an azure container registry credential provider. 2016-12-08 21:38:11 -08:00
Kubernetes Submit Queue bb792b17e4 Merge pull request #38415 from liggitt/client-status
Automatic merge from submit-queue (batch tested with PRs 38432, 36887, 38415)

Update client status generator to not use json tags

fixes dependence on json tags in internal versions and drives the generation of UpdateStatus based on type comments

caught a type we were missing an UpdateStatus for
2016-12-08 20:37:58 -08:00
Kubernetes Submit Queue e0c6b99e25 Merge pull request #36887 from hex108/pullImage
Automatic merge from submit-queue (batch tested with PRs 38432, 36887, 38415)

Add --image-pull-stuck-timeout option  to kubelet

In this PR, add --image-pull-stuck-time option to specify the stuck timeout for pulling image.

When docker extracts image layer, there is no progress. The progress will exceed 1m if the layer is big or system is busy. It happend in our cluster, so I add above option to specify the timeout. 

Related error log:
<pre>
[... kube_docker_client.go:29] Cancel pulling image "our_registry/demo/test" because of no progress for 1m0s, latest progress "c914ad57d670": Extracting [==================>] 513.5 MB/513.5MB"
[... docker_manager.go:2254] container start failed: ErrImagePull: net/http: request canceled
</pre>
2016-12-08 20:37:55 -08:00
Kubernetes Submit Queue 8f607f8906 Merge pull request #35655 from pwittrock/yaml
Automatic merge from submit-queue (batch tested with PRs 36736, 35956, 35655, 37713, 38316)

Tool to generate yaml representation of the kubectl help text

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

It generates a yaml representation of the kubectl help so we can generate higher fidelity docs.
2016-12-08 19:51:56 -08:00
Jordan Liggitt da15bd9260
Update client status generator to not use json tags 2016-12-08 21:58:01 -05:00
Jun Gong 036899ec98 Add --image-pull-progress-deadline option to kubelet 2016-12-09 09:28:57 +08:00
Monis Khan a6bafbacbf
Refactor REST storage to use generic defaults
Signed-off-by: Monis Khan <mkhan@redhat.com>
2016-12-08 17:24:21 -05:00
Kubernetes Submit Queue cc794dda1e Merge pull request #38319 from deads2k/fed-08-host-discovery
Automatic merge from submit-queue (batch tested with PRs 36310, 37349, 38319, 38402, 38338)

add summarizing discovery controller and handlers

Requires https://github.com/kubernetes/kubernetes/pull/38304 .

This adds discovery support to the new `kubernetes-discovery` that runs based on a controller wired up to the `APIService.apiregistration.k8s.io`.  It also adds in plumbing for `local-up-cluster.sh` to register the "normal" kube resources.

@kubernetes/sig-api-machinery 
@sttts
2016-12-08 13:44:55 -08:00
Kubernetes Submit Queue 53d41d036d Merge pull request #37349 from tanshanshan/httpcode
Automatic merge from submit-queue

replace HTTP status code with  HTTP status code const

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

replace HTTP status code with  HTTP status code const

Thanks!

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-08 13:44:00 -08:00
Kubernetes Submit Queue 8820922997 Merge pull request #35449 from MrHohn/kubedns-readysignal
Automatic merge from submit-queue

kubedns: use initial resource listing as ready signal

Fix #35140.

Set up the ready signal after the first resource listing finished for both endpoints and services instead of listen on kubernetes service.

@bprashanth @bowei @thockin

**Release note**:
```
```
2016-12-08 11:35:44 -08:00
deads2k fb9c109953 add summarizing discovery controller and handlers 2016-12-08 13:54:18 -05:00
Kubernetes Submit Queue a5a4d4f681 Merge pull request #38110 from deads2k/controller-15-split
Automatic merge from submit-queue (batch tested with PRs 35939, 38381, 37825, 38306, 38110)

split easy controllers from giant start func

continues work from https://github.com/kubernetes/kubernetes/pull/37976 to separate controller initialization.
2016-12-08 07:52:53 -08:00
Kubernetes Submit Queue 47181133c1 Merge pull request #35884 from foxyriver/exchange
Automatic merge from submit-queue

print log error

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

when failed to load CA,will print both "Loaded CA:" and "Error loading root CA certificate date:" ,but only need to print "Error loading root CA certificate date:" in fact.

**Special notes for your reviewer**:

**Release note**:

<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->

``` release-note
```
2016-12-08 03:29:41 -08:00
bruceauyeung 511350a369 trimspace on user specified env params
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2016-12-08 10:31:23 +08:00
Kubernetes Submit Queue 72e7adb658 Merge pull request #36735 from YuPengZTE/devHTTP
Automatic merge from submit-queue

type HttpProxyCheck should be HTTPProxyCheck

**What this PR does / why we need it**:
Change HttpProxyCheck to HTTPProxyCheck
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

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

```release-note
```

Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-12-07 16:21:21 -08:00
Kubernetes Submit Queue ca049360e2 Merge pull request #38258 from derekwaynecarr/kernel-memcg-flag
Automatic merge from submit-queue (batch tested with PRs 38318, 38258)

kernel memcg notification enabled via experimental flag

Kubelet integrates with kernel memcg notification API if and only if enabled via experimental flag.
2016-12-07 15:00:10 -08:00
Kubernetes Submit Queue 8d518d36b5 Merge pull request #38289 from deads2k/fed-07-wire-auth
Automatic merge from submit-queue (batch tested with PRs 36543, 38189, 38289, 38291, 36724)

add authentication/authorization to kubernetes-discovery

Wires authentication and authorization into `kubernetes-discovery` and re-enables the `local-up-cluster.sh` along with proper permission granting for RBAC cases.

@sttts @liggitt
2016-12-07 11:40:17 -08:00
Kubernetes Submit Queue aa08702d23 Merge pull request #37835 from luxas/kubeadm_cloudprovider_and_dns
Automatic merge from submit-queue (batch tested with PRs 38294, 37009, 36778, 38130, 37835)

Add a cloudprovider validator flag to kubeadm and update the DNS spec

Broken out from: https://github.com/kubernetes/kubernetes/pull/37568

This PR creates a flag for `cloud-provider` that validates the value before `RunInit()` is run, which makes it now act as a "real" flag
Then it removes the `k8s.io/kubernetes/pkg/cloudprovider` dependency, which makes the binary ~40MB smaller! That's _really_ worth it!

In the second commit, the DNS addon is updated to the latest version: https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/skydns-rc.yaml.base

@kubernetes/sig-cluster-lifecycle
2016-12-07 10:45:22 -08:00
Derek Carr 5b2d1c2c25 Enable kernel memcg notification via additional flag 2016-12-07 10:09:41 -05:00
deads2k 798d3edabf add authentication/authorization to kubernetes-discovery 2016-12-07 09:33:43 -05:00
Lucas Käldström f4cb405164 Update the built-in DNS addon of kubeadm to the v1.5 version 2016-12-07 16:24:21 +02:00
Lucas Käldström 342f98d516 Create a new cloud-provider flag in order to catch wrong args directly and don't import the cloudprovider package and save ~50% in binary size 2016-12-07 16:24:02 +02:00
deads2k f36a5ae9a1 separate controller initialization for easy controllers 2016-12-07 09:00:53 -05:00
deads2k 8ae8bf02a4 regenerate informers 2016-12-07 07:54:04 -05:00
deads2k 97854b8de5 update informer generator 2016-12-07 07:48:24 -05:00
deads2k 0579e86663 host apiservices resource 2016-12-07 07:47:09 -05:00
Zihong Zheng 19cf831086 kubedns: use initial resource listing as ready signal 2016-12-06 20:53:59 -08:00
Kubernetes Submit Queue 97ae7ccb56 Merge pull request #31647 from mikedanese/register-tainted
Automatic merge from submit-queue

add a configuration for kubelet to register as a node with taints

and deprecate --register-schedulable

ref #28687 #29178

cc @dchen1107 @davidopp @roberthbailey
2016-12-06 19:07:54 -08:00
Kubernetes Submit Queue cbf497b749 Merge pull request #38119 from liggitt/long-running
Automatic merge from submit-queue (batch tested with PRs 37032, 38119, 38186, 38200, 38139)

Detect long-running requests from parsed request info

Follow up to https://github.com/kubernetes/kubernetes/pull/36064

Uses parsed request info to more tightly match verbs and subresources

Removes regex-based long-running request path matching (which is easily fooled)

```release-note
The --long-running-request-regexp flag to kube-apiserver is deprecated and will be removed in a future release. Long-running requests are now detected based on specific verbs (watch, proxy) or subresources (proxy, portforward, log, exec, attach).
```
2016-12-06 18:29:35 -08:00
Kubernetes Submit Queue 87d907cafe Merge pull request #37084 from kenan435/fail-fast-on-duplicate-node
Automatic merge from submit-queue (batch tested with PRs 38194, 37594, 38123, 37831, 37084)

[kubeadm] Fail fast if there already is a node in the cluster with that name

kubeadm Fail fast if there is another node with the same name already in the cluster. 

Fixes #36255

cc @kubernetes/sig-cluster-federation
2016-12-06 17:41:37 -08:00
Kubernetes Submit Queue 4eb4777df1 Merge pull request #37831 from luxas/improve_reset
Automatic merge from submit-queue (batch tested with PRs 38194, 37594, 38123, 37831, 37084)

Improve kubeadm reset

Depends on: https://github.com/kubernetes/kubernetes/pull/36474
Broken out from: https://github.com/kubernetes/kubernetes/pull/37568
Carries: https://github.com/kubernetes/kubernetes/pull/35709, @camilocot

This makes the `kubeadm reset` command more robust and user-friendly.
I'll rebase after #36474 merges...

cc-ing reviewers: @mikedanese @errordeveloper @dgoodwin @jbeda
2016-12-06 17:41:35 -08:00
Kubernetes Submit Queue d4d6a32e9b Merge pull request #38123 from deads2k/api-48-remove-fields
Automatic merge from submit-queue (batch tested with PRs 38194, 37594, 38123, 37831, 37084)

remove unnecessary fields from genericapiserver config

Cleans up some unnecessary fields in the genericapiserver config.
2016-12-06 17:41:33 -08:00
Kubernetes Submit Queue d40710988f Merge pull request #38136 from deads2k/auth-11-join-certs
Automatic merge from submit-queue (batch tested with PRs 36990, 37494, 38152, 37561, 38136)

join client CA bundles

Last commit grabs client CA bundles from disparate parts of the auth config and makes a pool that contains all of them.

I suspect a rebase broke this because of ordering.  I'll keep these separate to make it easier for me to debug.
2016-12-06 14:13:37 -08:00
Kubernetes Submit Queue f600c94eab Merge pull request #37561 from deads2k/fed-01-types
Automatic merge from submit-queue (batch tested with PRs 36990, 37494, 38152, 37561, 38136)

api federation types

First commit adds types that can back the kubernetes-discovery server with an `kubectl` compatible way of adding federated servers.  Second commit is just generated code.

After we have types, I'd like to start splitting `kubernetes-discovery` into a "legacy" mode which will support what we have today and a "normal" mode which will provide an API federation server like this: https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/federated-api-servers.md that includes both discovery and proxy in a single server.  Something like this: https://github.com/openshift/kube-aggregator .

@kubernetes/sig-api-machinery @nikhiljindal
2016-12-06 14:13:35 -08:00
deads2k 0a6193fbe4 add apiregistration types 2016-12-06 13:45:10 -05:00
Mike Danese e225625a80 add a configuration for kubelet to register as a node with taints
and deprecate register-schedulable
2016-12-06 10:32:54 -08:00
deads2k 583dfbb0b1 generated 2016-12-06 13:10:38 -05:00
deads2k b723333be3 move APIResourceConfigSource to master 2016-12-06 10:19:25 -05:00
deads2k 6ea1d5d53d join client CA bundles into the accept path for genericapiserver 2016-12-06 09:56:13 -05:00
Kenan Karamehmedovic 16453a3334 Fail fast if there is already a node with same name as the one being joined. 2016-12-06 15:46:15 +01:00
deads2k fbb35b72ed update delegating auth to include front-proxy 2016-12-06 09:40:07 -05:00
deads2k 4f625db133 move client-ca to authentication args 2016-12-06 09:34:49 -05:00
Lucas Käldström 7a463eff08 Drain node on kubeadm reset and make it possible to specify if the node should be removed from the cluster as well 2016-12-06 15:43:59 +02:00
deads2k 985d502ed3 add basic wiring for kubernetes-discovery to become a kube-like api server 2016-12-06 08:19:39 -05:00
deads2k f255e46ee4 refactor kubernetes-discovery to use cobra and prep for genericapiserver 2016-12-06 08:08:50 -05:00
Lucas Käldström 67d4ddaf59 Improve the kubeadm reset command. Reorder the functions and log more user-friendly output 2016-12-06 14:45:29 +02:00
Lucas Käldström 51d733f418 Remove the cni directory when resetting; otherwise kubelet can pick up the wrong config on the next kubeadm init run 2016-12-06 14:45:19 +02:00
Alexander Kanevskiy 1eeb3f155f Pass proxy environment variables to static pods
To access outside world or cloud provider APIs it might be
required to use proxy.

Fixes: kubernetes/kubernetes#36573, kubernetes/kubeadm#5
2016-12-06 14:38:48 +02:00
NickrenREN 34d13c996a eventclient create error info print
Need to print error info when creating eventClient error , just as create kubeClient does 8 lines above
2016-12-06 17:55:46 +08:00
NickrenREN 48026ce655 modify startKubelet return
Since startKubelet() will always return nil, we donot need to judge its return err
2016-12-06 12:08:45 +08:00
Kubernetes Submit Queue 2c61d2f80c Merge pull request #38121 from deads2k/auth-09-remove-rbac-super
Automatic merge from submit-queue (batch tested with PRs 38111, 38121)

remove rbac super user

Cleaning up cruft and duplicated capabilities as we transition from RBAC alpha to beta.  In 1.5, we added a secured loopback connection based on the `system:masters` group name.  `system:masters` have full power in the API, so the RBAC super user is superfluous.

The flag will stay in place so that the process can still launch, but it will be disconnected.

@kubernetes/sig-auth
2016-12-05 14:14:41 -08:00
Jordan Liggitt 4359054616
Detect long-running requests from parsed request info 2016-12-05 16:46:28 -05:00
Kubernetes Submit Queue b1366bf55d Merge pull request #37976 from deads2k/controller-01-sa
Automatic merge from submit-queue (batch tested with PRs 36352, 36538, 37976, 36374)

demonstrate separation of controller intializers

Currently, controllers are all initialized in a monster method that make it difficult to individually pick out whether there are side-effects, difficult to group related controllers for selective enablement, and impossible to determine if there are hidden dependencies.

This pull demonstrates how we can break apart the monolith and start start the process of grouping and naming controllers for selective enablement.  In addition, the use of a map will help expose dependency ordering amongst these controllers and the separate methods will make it a lot harder to have side effects.

This also moves us closer to being able to author reflective unit tests that help ensure that basic RBAC bootstrap roles are at least present, even if they aren't correct.

@nikhiljindal since you were looking at the federation controller manager
@sttts since we're looking at trying out RBAC on these.
2016-12-05 11:08:47 -08:00
deads2k 2923d09091 remove rbac super user 2016-12-05 13:49:54 -05:00
Kubernetes Submit Queue 5e41d0904f Merge pull request #37830 from sttts/sttts-stratify-cert-generation
Automatic merge from submit-queue

Stratify apiserver cert generation

- move self-signed cert generation to `SecureServingOptions.MaybeDefaultWithSelfSignedCerts`
- make cert generation only depend on `ServerRunOptions`, not on an unfinished `Config` (this breaks the chicken-egg problem of a finished config in https://github.com/kubernetes/kubernetes/pull/35387#pullrequestreview-5368176)
- move loopback client config code into `config_selfclient.go`

Replaces https://github.com/kubernetes/kubernetes/pull/35387#event-833649341 by getting rid of duplicated `Complete`.
2016-12-05 10:15:47 -08:00
Kubernetes Submit Queue 0701737698 Merge pull request #36373 from vwfs/kubeadm_fix_centos_ssl
Automatic merge from submit-queue (batch tested with PRs 37366, 36373)

kubeadm: Let apiserver and controller-manager host-mount /etc/pki when required

#<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
This PR checks if /etc/pki is present on the host machine and adds a host-mount to the apiserver and controller-manager manifest if required.

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Fix incompatible host mounts for SSL certificates when deploying on CentOS with kubeadm
```
2016-12-05 08:13:42 -08:00
deads2k 5788317953 demonstrate separation of controller intializers 2016-12-05 10:24:45 -05:00
Dr. Stefan Schimanski 3f01c37b9d Update generated files 2016-12-05 16:05:52 +01:00
Dr. Stefan Schimanski a4cf364dbd Replace glog.Fatals with "return fmt.Errorf" in apiservers 2016-12-05 16:05:52 +01:00
Dr. Stefan Schimanski 5b1d45bc15 Stratify certificate loading and self-sign cert generation
This removes all dependencies on Config during cert generation, only operating
on ServerRunOptions. This way we get rid of the repeated call of Config.Complete
and cleanly stratify the GenericApiServer bootstrapping.
2016-12-05 14:58:15 +01:00
Dr. Stefan Schimanski 2dff13f332 Update generated files 2016-12-05 12:42:31 +01:00
Dr. Stefan Schimanski 24e24fc7bb Add verb support to gc and namespace controllers 2016-12-05 12:36:05 +01:00
Dr. Stefan Schimanski 458d2b2fe4 Add verb support for discovery client 2016-12-05 12:36:05 +01:00
Alexander Block fd8e6d03e6 Fix test failures in manifests_test.go 2016-12-05 10:28:23 +01:00
Alexander Block 8373ab5890 kubeadm: Let apiserver and controller-manager host-mount /etc/pki when required
fixes: #36150
2016-12-05 10:11:15 +01:00