Commit Graph

2735 Commits (69a1b1dbbfc40f9801b21aa33faecf120fee220b)

Author SHA1 Message Date
Kubernetes Submit Queue c07c73efbb Merge pull request #34385 from m1093782566/m109-kube-proxy-sys
Automatic merge from submit-queue

Generify kube-proxy conntracker setmax() and refactor util/sysctl

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

Fix Kube-proxy `conntrack.go` **TODO** [here](https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-proxy/app/conntrack.go#L56). This PR consists of two parts:

* Generify kube-proxy `realConntracker.SetMax(int)` 

That is, change

`ioutil.WriteFile("/sys/module/nf_conntrack/parameters/hashsize", []byte(strconv.Itoa(max/4)), 0640)` 

to

`sysctl.New().WriteValue("/sys/module/nf_conntrack/parameters/hashsize", max/4)`

* Refactor `sysctl.SetSysctl()` and `sysctl.GetSysctl()` to `WriteValue(path string, value string) error` and `GetValue(path value) (error, string)`
2016-10-21 00:18:53 -07:00
Kubernetes Submit Queue 60be3c5f57 Merge pull request #35111 from apprenda/kubeadm_normalize_reset
Automatic merge from submit-queue

kubeadm: Normalized reset command to match init and join commands.

**What this PR does / why we need it**: Overall, improves code structure. Opening single PR in order avoid big PRs in the future, when adding tests and new functionality, i.e. #34404.

```release-note
NONE
```
2016-10-20 20:02:58 -07:00
Jing Xu 34ef93aa0c Add mounterPath to mounter interface
In order to be able to use new mounter library, this PR adds the
mounterPath flag to kubelet which passes the flag to the mount
interface. If flag is empty, mount uses default mount path.
2016-10-20 14:15:27 -07:00
deads2k 9578523180 move proxytransport config out of the genericapiserver 2016-10-20 11:23:53 -04:00
Kubernetes Submit Queue f0044ea0d7 Merge pull request #35075 from pipejakob/token_validation_fix
Automatic merge from submit-queue

If token validation fails, give the user the expected format.

If a user specifies their own token to kubeadm, and it fails validation, the error they currently receive isn't the friendliest. This first change adds messaging for the expected token format, with more improvements to follow as part of #33930. It also adds some unit tests to document the behavior we have currently.

CC: @mikedanese, @krousey, @kubernetes/sig-cluster-lifecycle

Part of #33930.
2016-10-20 04:01:49 -07:00
m1093782566 ad89825065 build util function for write sys file
Change-Id: I8f122b4314c1d983e7ba1ce1d66ce876bef0dca9
2016-10-20 14:18:24 +08:00
Jacob Beacham ec7561fdef If token validation fails, give the user the expected format.
Part of #33930.
2016-10-19 14:28:17 -07:00
Paulo Pires 0699457f2b
kubeadm: Normalized reset command to match init and join commands. 2016-10-19 13:08:27 +01:00
Kubernetes Submit Queue 61e0113019 Merge pull request #34906 from luxas/remove_old_networking
Automatic merge from submit-queue

WIP: Remove the legacy networking mode

<!--  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**:
Removes the deprecated configure-cbr0 flag and networking mode to avoid having untested and maybe unstable code in kubelet, see: #33789

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

**Special notes for your reviewer**: There are a lot of deployments who rely on this networking mode. Not sure how we deal with that: force switch to kubenet or just delete the old deployment?

But please review the code changes first (the first commit)

**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
Removed the deprecated kubelet --configure-cbr0 flag, and with that the "classic" networking mode as well
```

PTAL @kubernetes/sig-network @kubernetes/sig-node @mikedanese
2016-10-19 01:03:39 -07:00
Clayton Coleman 957c0955aa
Run defaulting on the scheduler startup 2016-10-18 21:07:35 -04:00
Clayton Coleman f294175d60
Make defaulting optional during conversion generation
Set the Kubernetes default to "no defaulting"
2016-10-18 21:07:34 -04:00
Clayton Coleman 1c49fc57ed
Create a generator for defaulters
Given an object that wishes to have a top level defaulter, traverse the
object looking for nested fields that have defaulters and generate a
single function for that type that invokes all defaulters. The function
will have the name `SetObjectDefaults_NAME`.

Types use `// +k8s:defaulter-gen=true` to indicate they wish a defaulter
generated. If a function already exists with the desired name
`SetObjectDefaults_NAME` then no generation will occur. At a package
level, authors can bulk select the types to generate by setting the
value of the comment to the name of a field - all objects with that
field name without `// +k8s:defaulter-gen=false` defined on the type
will get a defaulter.

Because the defaulting behavior from conversions happens recursively,
all defaulters are expected to be invoked. We call these defaulters
"non-covering" (other defaulters may be invoked beneath them). The
defaulters we generate, by comparison, are "covering" - no nested
defaulters should be invoked. To distinguish between these two types, we
introduce the `// +k8s:defaulter-gen=covers` comment on a defaulter
function which will instruct the generator that the function should
terminate recursion.

This sets the stage for future defaulter generation from comments by
subsuming our existing generators
2016-10-18 21:07:32 -04:00
Kubernetes Submit Queue f39e86c0a5 Merge pull request #34474 from liggitt/connection-info-refactor
Automatic merge from submit-queue

Remove static kubelet client, refactor ConnectionInfoGetter

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

* Collapses the multi-valued return to a `ConnectionInfo` struct
* Removes the "raw" connection info method and interface, since it was only used in a single non-test location (by the "real" connection info method)
* Disentangles the node REST object from being a ConnectionInfoProvider itself by extracting an implementation of ConnectionInfoProvider that takes a node (using a provided NodeGetter) and determines ConnectionInfo
* Plumbs the KubeletClientConfig to the point where we construct the helper object that combines the config and the node lookup. I anticipate adding a preference order for choosing an address type in https://github.com/kubernetes/kubernetes/pull/34259
2016-10-18 13:20:25 -07:00
Kubernetes Submit Queue e62a8b9167 Merge pull request #34962 from deads2k/cotnroller-08-rs-controller
Automatic merge from submit-queue

convert replica set controller to shared informer

Switches the replicaset to a shared informer.

@kargakis fyi
2016-10-18 07:20:37 -07:00
deads2k b471398f1f convert replica set controller to shared informer 2016-10-18 08:13:37 -04:00
Kubernetes Submit Queue 67732d7383 Merge pull request #34967 from deads2k/api-27-fix-version
Automatic merge from submit-queue

make version an explicit choice so zero config and customized work

Makes `/version` key off of setting the version.  This allows composers to add a version that is correct.
2016-10-18 05:07:02 -07:00
Kubernetes Submit Queue c19569f03f Merge pull request #34502 from fabianofranz/cli_usability_improvements
Automatic merge from submit-queue

Improvements to CLI usability and maintainability

Improves `kubectl` from an usability perspective by

1. Fixing how we handle terminal width in help. Some sections like the flags use the entire available width, while others like long descriptions breaks lines but don't follow a well established max width (screenshot below). This PR adds a new responsive writer that will adjust to terminal width and set 80, 100, or 120 columns as the max width, but not more than that given POSIX best practices and recommendations for better readability.
![terminal_width](https://cloud.githubusercontent.com/assets/158611/19253184/b23a983e-8f1f-11e6-9bae-667dd5981485.png)
2. Adds our own normalizers for long descriptions and cmd examples which allows us better control about how things like lists, paragraphs, line breaks, etc are printed. Features markdown support. Looks like `templates.LongDesc` and `templates.Examples` instead of `dedent.Dedend`.
3. Allows simple reordering and reuse of help and usage sections.
3. Adds `verify-cli-conventions.sh` which intends to run tests to make sure cmd developers are using what we propose as [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md). Just a couple simple tests for now but the framework is there and it's easy to extend.
4. Update [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md) to use our own normalizers instead of `dedent.Dedent`.

**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
Improves how 'kubectl' uses the terminal size when printing help and usage.
```

@kubernetes/kubectl
2016-10-17 23:41:23 -07:00
Kubernetes Submit Queue 7414cafbeb Merge pull request #34860 from mbohlool/optional
Automatic merge from submit-queue

+optional tag for OpenAPI spec

OpenAPI rely on "omitempty" json tag to determine if a field is optional or not. This change will add "+optional" tag to all fields with "omitempty" json tag and support the tag in OpenAPI spec generator.
2016-10-17 22:07:00 -07:00
deads2k 5a9b16d40a make version an explicit choice so zero config and customized work 2016-10-17 16:10:07 -04:00
Kubernetes Submit Queue f90deb2bdd Merge pull request #34829 from deads2k/api-25-gc-admission
Automatic merge from submit-queue

add ownerref permission checks

Adds an admission plugin that ensures that anyone adding an `ownerReference` to a resource has delete rights on the resource they're setting up a delete for.

@caesarxuchao example admission plugin that tests for ownerReference diffs and uses an authorizer to drive the decision.

@liggitt @ncdc we've talked about this before
2016-10-17 09:34:31 -07:00
mbohlool c1096211d0 Support optional tag in OpenAPI generator 2016-10-17 08:52:13 -07:00
mbohlool 25afcc5522 Add +optional tag to all fields with omitempty json tag 2016-10-17 08:52:13 -07:00
Fabiano Franz 3f7579cacb Tools for checking CLI conventions 2016-10-17 11:50:02 -02:00
deads2k 14c164a328 add ownerref permission checks 2016-10-17 09:38:05 -04:00
Kubernetes Submit Queue 714f816a34 Merge pull request #34719 from errordeveloper/api-and-disco-ports
Automatic merge from submit-queue

Add flags for alternative API and discovery ports

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

We had many issues reported due to the fact that we are using port 443 by default, and we should allow users to override whatever defaults we pick. This doesn't touch on `localhost:8080` yet, which should just generally get rid of.

**Which issue this PR fixes**: fixes #34311 #34307 #33638

**Special notes for your reviewer**: cc @pires 

**Release note**:
```release-note
Add `kubeadm` flags `--api-port` and `--discovery-port`, change default API port to 6443
```
2016-10-17 05:54:38 -07:00
Kubernetes Submit Queue c4f509e65d Merge pull request #32769 from mfojtik/customize-api-path-clientgen
Automatic merge from submit-queue

clientgen: allow to pass custom apiPath when generating client sets

This PR allow to pass the `--clientset-api-path` parameter to clientgen that allows to customize the default API path set in clients. This allows projects like OpenShift to re-use the client with different API path (`/oapi` in our case).
2016-10-17 04:52:04 -07:00
Ilya Dmitrichenko 6f57775669
Ensure `MasterConfiguration` is refered to as `cfg` throughout 2016-10-17 12:08:11 +01:00
Ilya Dmitrichenko 327dec43fb
Add flags for alternative API and discovery ports (close #34311 #34307 #33638) 2016-10-17 12:08:11 +01:00
Lucas Käldström 4ac49a74aa Remove duplicate --etcd-servers arguments in kubeadm 2016-10-16 21:48:16 +03:00
Lucas Käldström 0800df74ab Remove the legacy networking mode --configure-cbr0 2016-10-16 21:26:41 +03:00
Jordan Liggitt a082a2e749
Remove static kubelet client, refactor ConnectionInfoGetter 2016-10-15 22:15:04 -04:00
Lucas Käldström d46490c21e Register the kubeadm api group in cmd/kubeadm 2016-10-15 22:18:23 +03:00
Kubernetes Submit Queue ab14c31b84 Merge pull request #34885 from apprenda/kubeadm_join_configuration
Automatic merge from submit-queue

kubeadm join: Added support for config file.

As more behavior (#34719, #34807, fix for #33641) is added to `kubeadm join`, this will be eventually very much needed. Makes sense to go in sooner rather than later.

Also references #34501 and #34884.

/cc @luxas @mikedanese
2016-10-15 10:11:49 -07:00
Kubernetes Submit Queue 864a7bacaa Merge pull request #34828 from deads2k/api-26-apiserver-annoyance
Automatic merge from submit-queue

default serializer

Everyone uses the same serializer.  Set it as the default, but still allow someone to take control if they want.

Found while trying to use genericapiserver for composition.
2016-10-15 07:29:59 -07:00
Kubernetes Submit Queue 88d6d7a677 Merge pull request #34807 from luxas/kubeadm_reset
Automatic merge from submit-queue

Implement kubeadm reset

@kubernetes/sig-cluster-lifecycle
2016-10-15 06:10:36 -07:00
Kubernetes Submit Queue 7e6fda2eb2 Merge pull request #34718 from taimir/kubeadm-disco-wait
Automatic merge from submit-queue

kubeadm join: polling discovery service API

**What this PR does / why we need it**: Enhance kubeadm to allow for parallel provisioning of API endpoints and slave nodes, in addition to https://github.com/kubernetes/kubernetes/pull/33543. This PR let's `kubeadm join` poll the discovery service API and retry connecting to it every couple of seconds. That way `kubeadm init` and `kubeadm join` can be executed in parallel.

**Fixes**: https://github.com/kubernetes/kubernetes/issues/33542

**Special notes for your reviewer**:

@pires @errordeveloper last part of the discussed changes, in addition to https://github.com/kubernetes/kubernetes/pull/33543 and https://github.com/kubernetes/kubernetes/pull/34703
2016-10-15 04:12:45 -07:00
Paulo Pires 0cc50d37e1
kubeadm join: Added support for config file. 2016-10-15 11:44:21 +01:00
Lucas Käldström ecdaa7195a Implement kubeadm reset 2016-10-15 11:58:06 +03:00
Kubernetes Submit Queue 3e9e507a9b Merge pull request #34703 from taimir/kubeadm
Automatic merge from submit-queue

kubeadm join: wait for API endpoints

**What this PR does / why we need it**: enhance kubeadm to allow for parallel provisioning of API endpoints and slave nodes, continued from https://github.com/kubernetes/kubernetes/pull/33543

**Fixes**: https://github.com/kubernetes/kubernetes/issues/33542

**Special notes for your reviewer**:

* Introduces a concurrent retry mechanism for bootstrapping with a single API endpoint during `kubeadm join` (this was left out in https://github.com/kubernetes/kubernetes/pull/33543 so that it can be implemented in a separate PR). The polling of the discovery service API itself is yet to come.

@errordeveloper @pires
2016-10-14 20:00:27 -07:00
Kubernetes Submit Queue 19848dddfd Merge pull request #24980 from aveshagarwal/master-project-node-selector
Automatic merge from submit-queue

Add support for admission controller based on namespace node selectors.

This work is to upstream openshift's project node selectors based admission controller.

Fixes https://github.com/kubernetes/kubernetes/issues/17151
2016-10-14 18:37:33 -07:00
Paulo Pires cf000bff95
kubeadm: fix preflight checks. 2016-10-14 20:16:56 +01:00
deads2k 7412be4465 default serializer 2016-10-14 11:27:32 -04:00
Kubernetes Submit Queue c3742a8fbe Merge pull request #34047 from deads2k/rbac-11-informer-cache
Automatic merge from submit-queue

Run rbac authorizer from cache

RBAC authorization can be run very effectively out of a cache.  The cache is a normal reflector backed cache (shared informer).

I've split this into three parts:
 1. slim down the authorizer interfaces
 1. boilerplate for adding rbac shared informers and associated listers which conform to the new interfaces
 1. wiring

@liggitt @ericchiang @kubernetes/sig-auth
2016-10-14 08:12:28 -07:00
Kubernetes Submit Queue 9adbbf2324 Merge pull request #34587 from resouer/stringflag
Automatic merge from submit-queue

Merge string flag into util flag

Continuing my work on https://github.com/kubernetes/kubernetes/issues/15634

This refactoring is expected to be completely finished and then I will add a verify scripts in `hack`
2016-10-14 04:22:11 -07:00
Kubernetes Submit Queue b189f5446e Merge pull request #34744 from pipejakob/typos
Automatic merge from submit-queue

Fix simple typos.
2016-10-14 03:08:46 -07:00
Kubernetes Submit Queue ca9688218d Merge pull request #34556 from deads2k/api-24-initialization
Automatic merge from submit-queue

split genericapiserver configuration apart so that you can run withou…

…t flag options

@dims Take a look at this re-slicing of the `genericapiserver.Config` creation.   I think this helps composers overall and resolves the chicken/egg problem you were having.
2016-10-14 01:09:05 -07:00
Kubernetes Submit Queue a944748ccb Merge pull request #34341 from apprenda/kubeadm-require-root
Automatic merge from submit-queue

kubeadm implement preflight checks

Checks that user running kubeamd init and join is root and will only execute
command if user is root. Moved away from using kubectl error handling to
having kubeadm handle its own errors. This should allow kubeadm to have
more meaningful errors, exit codes, and logging for specific kubeadm use
cases.

fixes #33908
2016-10-13 15:02:53 -07:00
Atanas Mirchev 072259f80f kubeadm join: wait for API endpoints
* Introduce a concurrent retry mechanism for bootstrapping
   with a single API endpoint
2016-10-13 22:16:11 +02:00
Jacob Beacham 2230714d32 Fix simple typos. 2016-10-13 11:29:26 -07:00
Avesh Agarwal b902f857c6 Add support for admission controller based on namespace node selectors.
This work is to upstream openshift's project node selectors based admission controller.

Addresses #17151.
2016-10-13 13:14:19 -04:00