Commit Graph

67 Commits (ab344da565d8afa43763e4aa2a7266ab4b2f8781)

Author SHA1 Message Date
Lucas Käldström 9853e8e7c3
kubeadm: Add the --use-service-account-credentials to controller-manager 2017-02-20 21:26:59 +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
Derek McQuay 70e7d64b46 kubeadm: moved import to client-go, where possible
Some imports dont exist yet (or so it seems) in client-go (examples
being:

  - "k8s.io/kubernetes/pkg/api/validation"
  - "k8s.io/kubernetes/pkg/util/initsystem"
  - "k8s.io/kubernetes/pkg/util/node"

one change in kubelet to import to client-go
2017-02-15 13:06:15 -08: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
Derek McQuay 7c4d1375ad
kubeadm: changed manifest files to yaml 2017-02-10 14:00:15 -08:00
Lucas Käldström 407722b378
Remove an old proxy arg function, add clustercidr to the proxy manifest and automatically calculate the dns ip 2017-02-06 23:09:27 +02:00
Kubernetes Submit Queue 9dedf92d42 Merge pull request #39440 from apprenda/kubeadm_102-fix_proxy
Automatic merge from submit-queue (batch tested with PRs 40574, 40806, 40308, 40771, 39440)

kubeadm: kube-proxy needs to know the pod subnet CIDR

**What this PR does / why we need it**: `kube-proxy` 1.5 has a new flag `cluster-cidr` that isn't specified by `kubeadm`, thus resulting in bug https://github.com/kubernetes/kubeadm/issues/102.

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

**Special notes for your reviewer**:
/cc @luxas @dmmcquay
2017-02-01 16:12:51 -08: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
Kubernetes Submit Queue 1bc78add3e Merge pull request #40682 from dgoodwin/pod-security-context
Automatic merge from submit-queue (batch tested with PRs 38443, 40145, 40701, 40682)

Move kubeadm etcd SELinux options from container to pod.

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

Works around a bug that surfaces in Docker 1.12+ related to the pause
container's namespace and selinux labels being transferred to the etcd
container when it runs.

At present it appears that applying selinux options to a container may
be broken, or perhaps shouldn't be supported at all. Moving these to the
pod causes all containers (including pause) to run with the correct
labels.



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

Related to and partial fix for https://github.com/kubernetes/kubeadm/issues/107

This is one of several selinux related fixes in flight for upcoming releases, and newer versions of Docker. To successfully run kubeadm with selinux enforcing right now would like require a recent container-selinux build as uncovered in https://github.com/kubernetes/kubeadm/issues/107, a bugfix for the format labels in #40179, and finally this fix.

**Release note**:

```release-note
Fixed an SELinux issue in kubeadm on Docker 1.12+ by moving etcd SELinux options from container to pod.
```
2017-01-30 20:59:44 -08:00
deads2k c9a008dff3 move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
Devan Goodwin 65a48b57ff Move kubeadm etcd SELinux options from container to pod.
Works around a bug that surfaces in Docker 1.12+ related to the pause
container's namespace and selinux labels being transferred to the etcd
container when it runs.

At present it appears that applying selinux options to a container may
be broken, or perhaps shouldn't be supported at all. Moving these to the
pod causes all containers (including pause) to run with the correct
labels.
2017-01-30 10:16:22 -04:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
Kubernetes Submit Queue a812493aae Merge pull request #39302 from bruceauyeung/k8s-branch-fix-nil-check-and-typos
Automatic merge from submit-queue (batch tested with PRs 40132, 39302, 40194, 40619, 40601)

fix nil check and typos

**What this PR does / why we need it**:
1. nil error should be checked before defer statement.
2. fix some typos.

Signed-off-by: bruceauyeung ouyang.qinhua@zte.com.cn
2017-01-27 18:32:23 -08: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 6a37f450ae
Add --kubelet-client-{certificate,key} to the apiserver args and make it allowed to access the kubelets 2017-01-23 13:16:04 +02:00
Lucas Käldström 22ce0fdf2d
Set apiserver's storage backend to etcd3 2017-01-23 12:08:01 +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
Paulo Pires c80c0275da
kubeadm: add self-hosted as optional deployment type. 2017-01-20 17:41:47 +00:00
Devan Goodwin 750cdb5bc2
kubeadm: first pass at self-hosted master components. 2017-01-20 17:41:46 +00:00
Jordan Liggitt 083ffb6e93
kubeadm: clean up RBAC grants 2017-01-19 14:54:41 -05:00
Jordan Liggitt 0b5fcbe2ab
Remove kubeadm authorizer package dependency 2017-01-19 12:01:53 -05:00
Andrew Rynhard f46bf42ba0 Add authorization mode to kubeadm 2017-01-18 14:02:53 -08:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Paulo Pires cae862dadf
kubeadm: kube-proxy needs to know the pod subnet CIDR in order to understand what's internal and external traffic.
Fixes https://github.com/kubernetes/kubeadm/issues/102
2017-01-04 20:32:27 +00:00
Paulo Pires 241c530648
kubeadm: change etcd data dir to match host path.
Fixes https://github.com/kubernetes/kubeadm/issues/80
2017-01-04 16:43:13 +00:00
bruceauyeung 8537aa4a99 fix nil check and typos 2016-12-29 18:00:28 +08:00
Mike Danese 690c7e578b kubeadm: refactor discovery behind an interface 2016-12-15 13:54:49 -08: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
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
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
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
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
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
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
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Jason Brooks bf153fc1d3 change unconfined_t to spc_t
The kube etcd and discovery pods are set to unconfined_t in
order to avoid disabling selinux, but the correct type for
an unconfined container is spc_t. For more information, see
http://danwalsh.livejournal.com/2016/10/03/.
2016-11-22 16:25:31 -08:00
Paulo Pires eb6eeb704a
kubeadm: gofmt'ed cmd/kubeadm. 2016-10-29 11:38:53 -04:00
Derek McQuay b7c685d421
kubeadm: EnvParam struct and GlobalEnvParam
Previously, GetEnvParams (now called SetEnvParams) had no way of being altered unless
it was through enviroment variables. These changes allow for a global
EnvParam to be set and also altered while still initally getting their value from
set enviroment variables. This change is especially helpful for testing
(see kubeadm/app/util/kubeconfig_test.go).
2016-10-29 09:41:51 -04:00
Ilya Dmitrichenko b7b0822654
Refactor `getComponentCommand()` for readability 2016-10-19 14:56:55 +01: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
Ilya Dmitrichenko 0cb54e7eb2
Append first address from `--api-advertise-addresses` to `kube-apiserver` flags 2016-10-12 12:59:24 +01:00