Commit Graph

37 Commits (9cfb0ae565c15a259f4d1fc2a6ec313b1c037e49)

Author SHA1 Message Date
Lucas Käldström f4fc98ae01
kubeadm: Remove old feature gates and unused functions 2017-06-30 17:46:34 +03:00
Lucas Käldström 051db16083
kubeadm: Cleanup version gates for the Node Authorizer when targeting v1.8 2017-06-24 19:21:41 +03:00
Chao Xu f2d3220a11 run root-rewrite-import-client-go-api-types 2017-06-22 11:30:59 -07:00
Lucas Käldström b7700ef4dd
kubeadm: Enable the Node Authorizer in v1.7 and fix some small bugs related to the enablement 2017-06-07 21:07:49 +03:00
Lucas Käldström de2ef8f0c7
kubeadm: Make kubeadm use the right CSR approver for the right version 2017-06-06 07:47:18 +03:00
Kubernetes Submit Queue 07f85565a2 Merge pull request #36721 from smarterclayton/initializers
Automatic merge from submit-queue

Add initializer support to admission and uninitialized filtering to rest storage

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

High level description:

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

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

```release-note
Kubernetes resources, when the `Initializers` admission controller is enabled, can be initialized (defaulting or other additive functions) by other agents in the system prior to those resources being visible to other clients.  An initialized resource is not visible to clients unless they request (for get, list, or watch) to see uninitialized resources with the `?includeUninitialized=true` query parameter.  Once the initializers have completed the resource is then visible.  Clients must have the the ability to perform the `initialize` action on a resource in order to modify it prior to initialization being completed.
```
2017-06-03 07:16:52 -07:00
Clayton Coleman 4ce3907639
Add Initializers to all admission control paths by default 2017-06-02 22:09:04 -04:00
xilabao 2061fa6717 1. Fix create volume of CertificatesDir.
2. Replace "manifests" to kubeadmconstants.ManifestsDirName
2017-06-01 09:17:10 +08:00
fabriziopandini 7166f185be path.Join to filepath.Join 2017-05-29 19:15:04 +02:00
Lucas Käldström b451e08e9b
kubeadm: Default to v1.6.0 stable in offline scenarios in beforehand 2017-03-15 21:01:03 +02:00
Lucas Käldström 61a284d720
Hook up kubeadm against the BootstrapSigner/BootstrapTokenAuthenticator 2017-03-04 11:17:52 +02:00
Lucas Käldström 579a743482
kubeadm: Add --cert-dir, --apiserver-cert-extra-sans, remove --api-external-dns-names and add the phase command for certs. Also use the CertificatesDir var everywhere instead of the HostPKIPath variable and fix some bugs in certs.go 2017-03-02 20:51:02 +02:00
Kubernetes Submit Queue 34a1540828 Merge pull request #41772 from xilabao/add-admission-control-option-to-config
Automatic merge from submit-queue

kubeadm: Make the CLI arguments for the control plane overridable
2017-02-28 04:10:25 -08:00
Lucas Käldström 796c3f9773
kubeadm: Implement the kubeadm token command fully and move it out of the experimental subsection 2017-02-27 12:56:03 +02:00
xilabao 8654217b12 Make the CLI arguments for the control plane overridable 2017-02-27 08:53:04 +08:00
Kubernetes Submit Queue e4c545a839 Merge pull request #41877 from bruceauyeung/k8s-branch-preflight-check-etcd-version
Automatic merge from submit-queue (batch tested with PRs 41954, 40528, 41875, 41165, 41877)

preflight check external etcd version when kubeadm init

**What this PR does / why we need it**:
1. preflight check if verson of external etcd server meets the demand of kubeadm, currently requires >= 3.0.14
2. support mixed http endpoints and https endpoints

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

**Special notes for your reviewer**:
i have tested against single endpoint including http etcd server , https etcd server,  but multiple endpoints not tested yet. i'll do it tomorrow
2017-02-26 14:54:55 -08:00
Kubernetes Submit Queue b2765427a2 Merge pull request #41897 from luxas/kubeadm_secure_controlplane
Automatic merge from submit-queue (batch tested with PRs 41701, 41818, 41897, 41119, 41562)

kubeadm: Secure the control plane communication and add the kubeconfig phase command

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

This generates kubeconfig files for the controller-manager and the scheduler, ref: https://github.com/kubernetes/kubeadm/issues/172

The second commit adds the `kubeadm alpha phase kubeconfig` command as described in the design doc: https://github.com/kubernetes/kubeadm/pull/156

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

@dmmcquay What kind of tests would you like for the kubeconfig phase command?

**Release note**:

```release-note
```
@jbeda @mikedanese @dmmcquay @pires @liggitt @deads2k @errordeveloper
2017-02-26 14:02:52 -08:00
bruceauyeung 0314dc2715 preflight check external etcd version
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-02-24 17:24:19 +08:00
Lucas Käldström 42cb8c8cb0
kubeadm: Generate kubeconfig files for controller-manager and scheduler and use them; secures the control plane communication 2017-02-23 21:28:03 +02:00
Lucas Käldström 0b16999e50
kubeadm: Use a new label for marking and tainting the master node 2017-02-23 19:43:09 +02:00
Lucas Käldström 3c322d04de
kubeadm: Always enable RBAC, validate authz mode and improve the code slightly 2017-02-23 15:30:24 +02:00
Joe Beda 3a3c2fa0c8
Ignore Bootstrap Token secrets that don't use predictable names.
This aligns with spec changes coming in https://github.com/kubernetes/community/pull/381.

Signed-off-by: Joe Beda <joe.github@bedafamily.com>
2017-02-20 11:38:21 -08:00
Lucas Käldström 60b789b1c7
kubeadm: Move {admin,kubelet}.conf out as constants and make a separate util package for kubeconfig logic 2017-02-17 21:36:58 +02:00
Kubernetes Submit Queue 2948c89433 Merge pull request #41509 from luxas/kubeadm_reorder_tokens
Automatic merge from submit-queue (batch tested with PRs 38101, 41431, 39606, 41569, 41509)

kubeadm: Reorder the token packages more logically

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

In order to be able to implement https://github.com/kubernetes/kubernetes/pull/41417, the token functionality (which now is spread across the codebase), should be in two places: a generic token functions library, which in the future _may_ [move into client-go](https://github.com/kubernetes/kubernetes/pull/41281#discussion_r101357106) in some form, and a package for the token handling against the api server.

This commit has no large functional changes.

```
kubeadm: Aggregate the token functionality in sane packages.
    
 - Factor out token constants to kubeadmconstants.
 - Move cmd/kubeadm/app/util/{,token/}tokens.go
 - Use the token-id, token-secret, etc constants provided by the bootstrapapi package
 - Move cmd/kubeadm/app/master/tokens.go to cmd/kubeadm/app/phases/token/csv.go
    
This refactor basically makes it possible to hook up kubeadm to the BootstrapSigner controller later on
```

**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
```
@mikedanese @pires @errordeveloper @dmmcquay @jbeda @GheRivero
2017-02-16 15:49:19 -08:00
Kubernetes Submit Queue 30ce5d7244 Merge pull request #41484 from deads2k/kubeadm-01-add-front-proxy
Automatic merge from submit-queue (batch tested with PRs 41505, 41484, 41544, 41514, 41022)

add front proxy to kubeadm created kube-apiservers

The front proxy authenticator configuration has been in a release or two.  It allows a front proxy (secured by mutual TLS auth) to provide user information for a request.  The kube-aggregator uses this to securely terminate authentication (has to terminate TLS and thus client-certs) and communicate user info to backing API servers.

Since the kube-apiserver always verifies the front-proxy via a client certificate, this isn't open for abuse unless you already have access to either the signing key or client cert which kubeadm creates locally.  If you got there, you already owned the box.  Therefore, this adds the authenticator unconditionally.

@luxas Are there e2e tests for `kubeadm`?
@liggitt @kubernetes/sig-auth-misc
2017-02-16 14:28:16 -08:00
Lucas Käldström 0f1124aff3
kubeadm: Aggregate the token functionality in sane packages.
- Factor out token constants to kubeadmconstants.
 - Move cmd/kubeadm/app/util/{,token/}tokens.go
 - Use the token-id, token-secret, etc constants provided by the bootstrapapi package
 - Move cmd/kubeadm/app/master/tokens.go to cmd/kubeadm/app/phases/token/csv.go

This refactor basically makes it possible to hook up kubeadm to the BootstrapSigner controller later on
2017-02-16 22:22:30 +02:00
Kubernetes Submit Queue a260db06aa Merge pull request #41238 from xilabao/add-check-to-authorization-config
Automatic merge from submit-queue (batch tested with PRs 41466, 41456, 41550, 41238, 41416)

add check to authorization config

Prompt user to create the config when using abac/webhook.
2017-02-16 10:14:10 -08:00
xilabao 60dfa6c9d7 add check to authorization config 2017-02-16 18:10:26 +08:00
Lucas Käldström 62dcce6c39
Bump the minimum kubeadm control plane version to v1.6.0-alpha.2 2017-02-15 20:09:56 +02:00
deads2k affdf829a3 add front proxy to kubeadm created kube-apiservers 2017-02-15 11:02:03 -05:00
Andrew Rynhard 3ea7b29e8e Use a dedicated key for service account token signing 2017-02-13 08:39:46 -08:00
Lucas Käldström 667dc64e79
Validate the minimum subnet cidr so there are always 10 available addresses 2017-02-06 19:34:06 +02:00
Lucas Käldström 6d7d1317cb
Move the apiCallRetryInterval constants to a common place and a little bit cleanup 2017-02-02 00:05:14 +02:00
Lucas Käldström 79515ec880
Move some code from apiclient.go to the dedicated apiconfig phase package. Add constants and somewhat refactor the RBAC code as well 2017-02-01 19:06:51 +02:00
Lucas Käldström fbc550c945
Default to control plane v1.6.0-alpha.1 for clusters deployed with kubeadm and using RBAC. Also use constants for authz modes 2017-01-31 09:24:15 +02:00
Lucas Käldström 695fb7440e
Fix up the misunderstanding about the apiserver kubelet client cert 2017-01-23 21:45:48 +02:00
Lucas Käldström 13499f443a
Generate two certs and two private keys; only the necessary ones; make the certs and kubeconfig phases work with valid files already on-disk and some cleanup 2017-01-21 00:33:06 +02:00