Commit Graph

4640 Commits (11b25366bc7bfe2ad273c8bf9c332fd9d233bffc)

Author SHA1 Message Date
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
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
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