Commit Graph

2421 Commits (750881c0ab62a9f59d53582bc33826caa167aa83)

Author SHA1 Message Date
Kubernetes Submit Queue 1fe9fb2d69 Merge pull request #35972 from kad/proxy-warning
Automatic merge from submit-queue

kubeadm preflight checks: Warn user if connections to API or Discovery are going to be over proxy

**What this PR does / why we need it**: Continuing discussion from PR #35044, new version will provide warning if kubeadm run in environment where http connections would go over proxy.
Most of the time, it is not expected behaviour and leads to situations like in #34695

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```

kubeadm during initialization of master and slave nodes need to make
several API calls directly to the node where it is running or master.
In environments with http/https proxies, user might accidentally
have configuration where connections to API would go over proxy instead
of directly.

User can re-run kubeadm with corrected NO_PROXY variable. Example:

  $ NO_PROXY=* kubeadm join ...
2016-11-01 15:56:51 -07:00
Alexander Kanevskiy ce9a13ef13 Warn user if connections to API or Discovery are going to be over proxy
kubeadm during initialization of master and slave nodes need to make
several API calls directly to the node where it is running or master.
In environments with http/https proxies, user might accidentally
have configuration where connections to API would go over proxy instead
of directly.

User can re-run kubeadm with corrected NO_PROXY variable. Example:

  $ NO_PROXY=* kubeadm join ...
2016-11-01 16:23:10 +02:00
yupeng 7d1219fb06 Align with other cli descriptions
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-01 18:59:45 +08:00
Mike Danese 58479268e8 kubeadm: lower default component logging level 2016-10-31 15:29:10 -07:00
Jacob Beacham cf6b6778dc Adding CLI tests for kubeadm. 2016-10-31 11:12:51 -07:00
Jacob Beacham f65c58124d New command: "kubeadm token generate"
This surfaces the token generation logic so that users can first
generate and store a token, then pass it to kubeadm init/join.
Otherwise, users have to capture and parse the output of "kubeadm init"
to feed the token to "kubeadm join."
2016-10-31 11:12:51 -07:00
Kubernetes Submit Queue e4b41dd292 Merge pull request #35777 from redhatlinux10/fix-inconsistent-util-package-import
Automatic merge from submit-queue

make kubeadm version use kubeadmutil

What this PR does / why we need it:

this PR makes sure `kubeadmutil.CheckErr()` other than `cmdutil.CheckErr()` is called in `kubeadm version` subcommand. 
in `version.go`, `RunVersion()` function only returns `nil`, `kubeadmutil.CheckErr()` is enough for this

Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>
2016-10-30 18:08:27 -07:00
Kubernetes Submit Queue 9e71a65335 Merge pull request #35326 from apprenda/kubeadm-unit-tests-pkg-preflight
Automatic merge from submit-queue

kubeadm: added unit test for app/preflight pkg

Added unit test for kubeadm/app/preflight package testing functionality of checks.go.

This PR is part of the ongoing effort to add tests (#35025)

/cc @pires @jbeda
2016-10-30 10:31:56 -07:00
Kubernetes Submit Queue b4f8d88d51 Merge pull request #35843 from bulletRush/feature/pre-hostname-check
Automatic merge from submit-queue

[kubeadm] pre-flight check hostname to ensure kubelet can launch static pods li…

<!--  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**: pre-flight check hostname to ensure kubelet can launch static pods like kube-apiserver/kube-controller-manager

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

# what is the influence of this issue?

kubelet will not create api server and kcm pod if your hostname is uncorrect. It complain the config files in "/etc/kubernetes/manifests" are invlid.

# how to reproduce this issue?

change your hostname by `hostnamectl set-hostname vm_81_12_centos`. then run `kubeadm init`. you will get this error log from kubelet:

```log
Oct 27 11:12:57 vm_81_12_centos kubelet: I1027 11:12:57.279458    2695 file.go:123] Can't process config file "/etc/kubernetes/manifests/kube-controller-manager.json": invalid pod: [metadata.name: Invalid value: "kube-controller-manager-vm_81_12_centos": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com') spec.nodeName: Invalid value: "vm_81_12_centos": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com')]
```

# where the error comes from in the code?

`pkg/kubelet/config/file.go:144 sourceFile:extractFromDir`

```go
func (s *sourceFile) extractFromDir(name string) ([]*api.Pod, error) {
	dirents, err := filepath.Glob(filepath.Join(name, "[^.]*"))
	if err != nil {
		return nil, fmt.Errorf("glob failed: %v", err)
	}

	pods := make([]*api.Pod, 0)
	if len(dirents) == 0 {
		return pods, nil
	}

	sort.Strings(dirents)
	for _, path := range dirents {
		statInfo, err := os.Stat(path)
		if err != nil {
			glog.V(1).Infof("Can't get metadata for %q: %v", path, err)
			continue
		}

		switch {
		case statInfo.Mode().IsDir():
			glog.V(1).Infof("Not recursing into config path %q", path)
		case statInfo.Mode().IsRegular():
			pod, err := s.extractFromFile(path)
			if err != nil {
-->				glog.V(1).Infof("Can't process config file %q: %v", path, err)
			} else {
				pods = append(pods, pod)
			}
		default:
			glog.V(1).Infof("Config path %q is not a directory or file: %v", path, statInfo.Mode())
		}
	}
	return pods, nil
}
```

# how to fix it?

1. change hostname by `hostnamectl set-hostname <right host name>` or
2. add `hostnameOverride` config. If hostnameOverride is set, then kubelet will use this value instead of system hostname.

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

…ke kube-apiserver/kube-controller-manager and so on.
2016-10-30 09:56:25 -07:00
Kubernetes Submit Queue defb44a4d6 Merge pull request #35231 from apprenda/kubeadm-unit-tests-pkg-util
Automatic merge from submit-queue

Kubeadm added unit tests for pkg app/util

Added unit tests for kubeadm/app/util package testing functionality of tokens.go, error.go, and kubeconfig.go.

This PR is part of the ongoing effort to add tests (#35025)

/cc @pires @jbeda
2016-10-30 09:21:31 -07:00
bulletRush 590ef489c8 [kubeadm] pre-flight check hostname to ensure kubelet can launch static pods 2016-10-30 09:40:33 -04:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Paulo Pires f6bac22d69
kubeadm: updated cmd/kubeadm/app/node package related BUILD file. 2016-10-29 11:39:02 -04: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
Derek McQuay a018564975
kubeadm: added tests for util/{error,kubeconfig} 2016-10-29 09:41:51 -04:00
Derek McQuay 1bfa867088
kubeadm: added unit tests for util/tokens 2016-10-29 09:41:50 -04:00
Paulo Pires b054117c24
kubeadm: updated cmd/kubeadm/app/preflight package related BUILD file. 2016-10-29 09:40:13 -04:00
Derek McQuay a5919a9340
kubeadm: added unit test for app/preflight pkg 2016-10-29 09:40:06 -04:00
redhatlinux10 67f379e510 fix inconsistent util package import
Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>

fix inconsistent util package import

Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>
2016-10-29 04:11:01 +08:00
Kubernetes Submit Queue 0563b45772 Merge pull request #35556 from apprenda/kubeadm-alphawarning-typo
Automatic merge from submit-queue

kubeadm: fixed small typo in alpha warning

Small typo in the alpha warning that I noticed and fixed.
2016-10-27 13:49:53 -07:00
Kubernetes Submit Queue a8e9a1bce6 Merge pull request #35632 from dgoodwin/preflight-conf-fixes
Automatic merge from submit-queue

kubeadm: Stop assuming full ownership of /etc/kubernetes.

Packages may auto-create directories in /etc/kubernetes, and users also
need files such as cloud-config.json to be present and preserved at
their default locations in /etc/kubernetes. As such this modifies
pre-flight checks to only require the absence of the files and
directories we explicitly create in kubeadm.

Reset is similarly modified to not wipe out /etc/kubernetes entirely.
When resetting directories we also now preserve the directory itself,
but delete it's contents.

Also adds tests for reset command logic specifically for /etc/kubernetes
cleanup, to ensure user files are not inadvertently wiped out.
2016-10-27 11:55:27 -07:00
Devan Goodwin 2ee787c583 kubeadm: Empty directories during reset, but do not delete them.
This will allow packages to maintain ownership of config and data
directories, which may carry selinux or other attributes that should be
preserved, but we do not wish to manage within kubeadm itself.
2016-10-27 10:26:41 -03:00
Devan Goodwin 37b1ae42c0 kubeadm: Stop assuming full ownership of /etc/kubernetes.
Packages may auto-create directories in /etc/kubernetes, and users also
need files such as cloud-config.json to be present and preserved at
their default locations in /etc/kubernetes. As such this modifies
pre-flight checks to only require the absence of the files and
directories we explicitly create in kubeadm.

Reset is similarly modified to not wipe out /etc/kubernetes entirely.
When resetting directories we also now preserve the directory itself,
but delete it's contents.

Also adds tests for reset command logic specifically for /etc/kubernetes
cleanup, to ensure user files are not inadvertently wiped out.
2016-10-27 09:14:20 -03:00
Derek McQuay 89b1c950bc
kubeadm: fixed small typo in alpha warning 2016-10-25 17:30:56 -04:00
Ilya Dmitrichenko fe32eddca9
Change default service IP range to 10.96/12 2016-10-25 09:45:32 +01:00
Kubernetes Submit Queue 377967935b Merge pull request #35453 from mikedanese/build-rename
Automatic merge from submit-queue

rename build/ dirs to other things.

#35359
2016-10-24 17:03:25 -07:00
Kubernetes Submit Queue 03c69e114f Merge pull request #35270 from errordeveloper/bump-default-version-in-kubeadm
Automatic merge from submit-queue

Bump kubeadm to use v1.4.4 by default

**Release note**:

```release-note
NONE
```
2016-10-24 16:17:53 -07:00
Mike Danese 763c4987f2 autogenerated 2016-10-24 14:47:27 -07:00
Kubernetes Submit Queue ffdfe9fa9b Merge pull request #35119 from errordeveloper/tidy-up-kubeadm
Automatic merge from submit-queue

Start tidying kubeadm up

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

This PR addresses https://github.com/kubernetes/kubernetes/pull/33262#discussion_r80337511.

**Release note**:
```release-note
NONE
```
2016-10-24 02:26:36 -07:00
Kubernetes Submit Queue a7db9bccb5 Merge pull request #35332 from apprenda/kubeadm-unit-tests-pkg-images
Automatic merge from submit-queue

kubeadm: added unit tests for app/images pkg

Added unit tests for kubeadm/app/images package testing functionality of images.go.

This PR is part of the ongoing effort to add tests (#35025)

/cc @pires @jbeda
2016-10-23 16:21:37 -07:00
Kubernetes Submit Queue 1bd46e5a4e Merge pull request #35265 from redhatlinux10/master-patch-optimise-kubeadm-join-args-generation
Automatic merge from submit-queue

enhance join arguments generation logic using template

**What this PR does / why we need it**:
this PR enhances kubeadm join arguments generation logic using template, this makes code more readable and adding arguments more  easier.

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

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

Signed-off-by: 欧阳钦华10079130 <ouyang.qinhua@zte.com.cn>
2016-10-22 17:15:59 -07:00
欧阳钦华10079130 8bbeae02d3 enhance join arguments generation logic using template
Signed-off-by: 欧阳钦华10079130 <ouyang.qinhua@zte.com.cn>

change JoinArgsData to joinArgsData, improve template readability

Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>

fix extra = type

Signed-off-by: redhatlinux10 <ouyang.qinhua@zte.com.cn>
2016-10-23 06:38:14 +08:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Derek McQuay 3765c846a4
kubeadm: added unit tests for app/images pkg 2016-10-21 14:47:46 -07:00
Ilya Dmitrichenko 9703df391f
Eliminate half-baked multi-architecture support, but keep node affinity architecture-agnostic (fix #33916) 2016-10-21 14:56:02 +01:00
Ilya Dmitrichenko f09c4833bd
Bump kubeadm to use v1.4.4 by default 2016-10-21 09:25:49 +01: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
Jacob Beacham ec7561fdef If token validation fails, give the user the expected format.
Part of #33930.
2016-10-19 14:28:17 -07:00
Ilya Dmitrichenko b7b0822654
Refactor `getComponentCommand()` for readability 2016-10-19 14:56:55 +01:00
Paulo Pires 0699457f2b
kubeadm: Normalized reset command to match init and join commands. 2016-10-19 13:08:27 +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
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 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
Paulo Pires cf000bff95
kubeadm: fix preflight checks. 2016-10-14 20:16:56 +01: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 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
Kubernetes Submit Queue 33a8e5cf67 Merge pull request #34097 from mayflower/kubeadm-typo
Automatic merge from submit-queue

kubeadm: fix typo
2016-10-13 10:08:03 -07:00
Devan Goodwin 4231c046dd Fix errors and improve output in kubeadm pre-flight checks.
Add skip-preflight-checks to known flags.
Fix bug with preflight checks not returning system is-active as errors.
Fix error handling to use correct function.
2016-10-13 11:10:19 -03:00
Derek McQuay 16b159c12b kubeadm implement preflight checks
Includes checks for verifying services exist and are enabled, ports are
open, directories do not exist or are empty, and required binaries are
in the path.

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.
2016-10-13 10:09:36 -03:00
Devan Goodwin b673e2d0a0 Add kubeadm preflight check framework.
Includes checks for verifying services exist and are enabled, ports are
open, directories do not exist or are empty, and required binaries are
in the path.
2016-10-13 10:06:52 -03:00
AdoHe b2280a646a update various commands to adapt the new Factory interface 2016-10-13 21:01:14 +08:00
Atanas Mirchev 32edc87e4b kubeadm join: polling discovery service API
* `kubeadm join` will now retry to connect to the discovery service
API instead of exit on first failure. Allows for parallel install.
of master and slave nodes.
2016-10-13 14:51:04 +02:00
Kubernetes Submit Queue c1986f0fc7 Merge pull request #34501 from mikedanese/kubeadm-init-cfg
Automatic merge from submit-queue

kubeadm: allow kubeadm init to read config from file

@kubernetes/sig-cluster-lifecycle
2016-10-13 04:19:05 -07:00
Kubernetes Submit Queue 4a223efd27 Merge pull request #34573 from errordeveloper/fix-early-deployment-issue
Automatic merge from submit-queue

Test API more extensivelly before declaring readiness 

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

It's possible that first deployment kubeadm creates will hit `deployments.extensions "kube-discovery" is forbidden: not yet ready to handle request`, which comes from NamespaceLifecycle admission controller and has something to do with cache. According to @derekwaynecarr, we need to create a namespace-scoped resource to really check for this. I didn't want to make a check with deployment of whatever comes first right now, and decided to have explicit step for this in `apiclient.go`.

**Which issue this PR fixes**: fixes #34411

**Special notes for your reviewer**: @kubernetes/sig-cluster-lifecycle 

**Release note**:
```release-note
NONE
```
2016-10-13 01:44:24 -07:00
Kubernetes Submit Queue d236b84b4f Merge pull request #34555 from mikedanese/conversion
Automatic merge from submit-queue

kubeadm: fix conversion macros and add kubeadm to round trip testing

Tests are probably broken but I'll fix. @jbeda this probably fixes your change unless we decide we need generated deep copies or conversions.

@kubernetes/sig-cluster-lifecycle
2016-10-12 19:47:58 -07:00
Kubernetes Submit Queue 0357341fd5 Merge pull request #34596 from xiaopeng163/master
Automatic merge from submit-queue

fixed grammatical errors

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

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

**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-10-12 13:46:07 -07:00
Mike Danese 25e4dccefe kubeadm: fix conversion macros and add kubeadm to round trip testing 2016-10-12 13:26:23 -07:00
Kubernetes Submit Queue 346f3b3e76 Merge pull request #33543 from taimir/kubeadm
Automatic merge from submit-queue

Decouple master bootstrap from CSR in kubeadm

<!--  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**: enhance `kubeadm` to allow for parallel provisioning of API endpoints and slave nodes

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

**Special notes for your reviewer**:
This is work in progress, trying to 

 * Introduce a concurrent retry mechanism for bootstrapping
   with a single API endpoint
 * Refactor API client creation, decouple from CSR
2016-10-12 08:53:43 -07:00
Ilya Dmitrichenko 0cb54e7eb2
Append first address from `--api-advertise-addresses` to `kube-apiserver` flags 2016-10-12 12:59:24 +01:00
Peng Xiao c5b96e48ea fixed grammatical errors 2016-10-12 16:29:04 +08:00
Atanas Mirchev 8c8da393e0 Decouple master bootstrap from CSR
* Refactor API client creation, decouple from CSR
2016-10-12 09:16:38 +02:00
Ilya Dmitrichenko 53e393ad42
Test API more extensivelly before declaring readiness (close #34411) 2016-10-11 22:33:39 +01:00
Mike Danese dc616dde7c kubeadm: register all cloudproviders 2016-10-11 11:19:46 -07:00
Mike Danese 58d25e378c kubeadm: allow kubeadm init to read config from file 2016-10-11 10:25:28 -07:00
Lucas Käldström 99aaa3d8f4 Bump kubeadm to use kubernetes v1.4.1 2016-10-10 22:25:26 +03:00
Kubernetes Submit Queue 851705ea59 Merge pull request #34147 from mikedanese/kubeadm-api
Automatic merge from submit-queue

kubeadm: turn api into a real apigroup

@kubernetes/sig-cluster-lifecycle
2016-10-10 09:59:54 -07:00
Kubernetes Submit Queue 7746cb9182 Merge pull request #34352 from mikedanese/fix-cm
Automatic merge from submit-queue

kubeadm: still run cm if not pod cidr is specified

@kubernetes/sig-cluster-lifecycle
2016-10-08 18:25:43 -07:00
Mike Danese 45b92085c4 kubeadm: still run cm if not pod cidr is specified 2016-10-07 12:31:10 -07:00
Mike Danese b3dae78c62 kubeadm: turn api into a real apigroup 2016-10-07 11:14:53 -07:00
Mike Danese db963fc16d kubeadm: mark etcd flags as deprecated 2016-10-05 14:36:03 -07:00
Robin Gloster f2ae2cad0b
kubeadm: fix typo 2016-10-05 18:39:24 +02:00
Mike Danese 56ea178e7c kubeadm: refactor config
1) break object into substructures
2) seperate a config object for master and node
2016-10-03 14:44:18 -07:00
Kubernetes Submit Queue 64d2b12d21 Merge pull request #33859 from luxas/not_so_aggressve_probes
Automatic merge from submit-queue

Do not probe so aggressively which may lead to unnecessary restarts

@errordeveloper @mikedanese PTAL

I came across a case where etcd restarted about 5-10 times because the load was very high on the machine. 
The load seems to have lead to that the `etcd` container occasionally didn't respond to the probe, which caused many restart and made the whole thing even worse.

Maybe we should remove the etcd probe totally? I don't know, what do you think?
This is at least a try to loosen the limits here...
2016-10-03 05:55:42 -07:00
Kubernetes Submit Queue 347d448180 Merge pull request #33831 from rustyrobot/print-cert-info
Automatic merge from submit-queue

Kubeadm: print information about certificates

Prints basic information about certificates to the user.

Example of `kubeadm init` output:
```
<master/pki> generated Certificate Authority key and certificate:
Issuer: CN=kubernetes | Subject: CN=kubernetes | CA: true
Not before: 2016-09-30 11:19:19 +0000 UTC Not After: 2026-09-28 11:19:19 +0000 UTC
Public: /etc/kubernetes/pki/ca-pub.pem
Private: /etc/kubernetes/pki/ca-key.pem
Cert: /etc/kubernetes/pki/ca.pem
<master/pki> generated API Server key and certificate:
Issuer: CN=kubernetes | Subject: CN=kube-apiserver | CA: false
Not before: 2016-09-30 11:19:19 +0000 UTC Not After: 2017-09-30 11:19:19 +0000 UTC
Alternate Names: [172.18.76.239 10.0.0.1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local]
Public: /etc/kubernetes/pki/apiserver-pub.pem
Private: /etc/kubernetes/pki/apiserver-key.pem
Cert: /etc/kubernetes/pki/apiserver.pem
<master/pki> generated Service Account Signing keys:
Public: /etc/kubernetes/pki/sa-pub.pem
Private: /etc/kubernetes/pki/sa-key.pem
```

Example of `kubeadm join` command:
```
<node/csr> received signed certificate from the API server:
Issuer: CN=kubernetes | Subject: CN=system:node:minion | CA: false
Not before: 2016-09-30 11:28:00 +0000 UTC Not After: 2017-09-30 11:28:00 +0000 UTC
```

Fixes #33642
cc @kubernetes/sig-cluster-lifecycle
2016-10-01 11:31:25 -07:00
Lucas Käldström 60274778bc Set FailureTreshold to 8 for kubeadm components in order to not restart unless really necessary 2016-10-01 16:25:27 +03:00
Kubernetes Submit Queue 5a9acd9113 Merge pull request #33681 from zachaller/master
Automatic merge from submit-queue

fix kubeadm on AWS so that kube-controller has access to certs for am…

<!--  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 fixes an issue with kubeadm not mounting ssl certs for kube-controller

**Which issue this PR fixes** : fixes #33680

**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
Fixes Kubeadm so kube-controller has certs for using amazon api
```
2016-09-30 23:24:56 -07:00
Evgeny L 12f8c979ba kubeadm: user-friendly certificates formatting 2016-10-01 04:57:30 +00:00
Kubernetes Submit Queue 239630ce9a Merge pull request #33644 from errordeveloper/kubeadm-remove-glog
Automatic merge from submit-queue

Remove glog added by mistake, start converting phase1+ TODOs to issues

**What this PR does / why we need it**:
Minor cleanup in `cmd/kubeadm/app/node/csr.go`.

**Release note**:
```release-note
NONE
```
2016-09-29 08:44:28 -07:00
Kubernetes Submit Queue df0ae9f67d Merge pull request #33668 from mikedanese/private-ip
Automatic merge from submit-queue

kubeadm: default to using a private range for service subnet

We are currently using a subnet that is reserved for ISPs. Private network administrators don't control this space. Default to a subnet that private network administrators do control.

@errordeveloper @kubernetes/sig-cluster-lifecycle
2016-09-28 18:49:46 -07:00
Zach Aller bd1d93e2e0 fix kubeadm on AWS so that kube-controller has access to certs for amazon api 2016-09-28 18:47:23 +00:00
Mike Danese 3c8c71e80e default to using a private range for service subnet 2016-09-28 10:01:55 -07:00
Ilya Dmitrichenko 037ef3e50c
Remove glog added by mistake, start converting phase1+ TODOs to issues 2016-09-28 10:27:53 +01:00
Kubernetes Submit Queue 1854bdcb0c Merge pull request #29048 from justinsb/volumes_nodename_not_hostname
Automatic merge from submit-queue

Use strongly-typed types.NodeName for a node name

We had another bug where we confused the hostname with the NodeName.

Also, if we want to use different values for the Node.Name (which is
an important step for making installation easier), we need to keep
better control over this.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName
2016-09-27 17:58:41 -07:00
Kubernetes Submit Queue cf7301f16c Merge pull request #33564 from oz123/fix_typo
Automatic merge from submit-queue

Fix typo fialed->failed

Just a tiny fix .
2016-09-27 10:06:54 -07:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Oz N Tiram ae5d5867ab Fix typo fialed->failed 2016-09-27 16:38:01 +02:00
Evgeny L 8f586d916e Kubeadm: fix SELinux rules for kubernetes discovery service 2016-09-27 13:24:29 +00:00
Luke Marsden 3a4613d3b2 fix https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/33262/kubernetes-pull-verify-all/15586/ 2016-09-26 09:13:09 +01:00
Lucas Käldström 51573860fa Update CHANGELOG and gofmt 2016-09-26 09:13:09 +01:00
Lucas Käldström b17e107def Various improvements plus added a version command 2016-09-25 22:38:39 +03:00
Ilya Dmitrichenko a023085a5f
Address comments in review 2016-09-24 17:28:34 +01:00
Ilya Dmitrichenko d0e29789b0
Fix sorting of linted packages and gofmt 2016-09-24 14:46:43 +01:00
Lucas Käldström 37dab80173
Make the Kubernetes control plane version configurable 2016-09-24 14:46:42 +01:00
Atanas Mirchev 5862ea6f38
Fix boostrap token encoding bug during master init
Currently the boostrap fails when a token is provided by the user
on `master init` and works when the token is generated. This is
because of a mismatch of how the token string in the kube-discovery
secret is encoded.
2016-09-24 14:46:42 +01:00
Evgeny L 0a68bb05ea
Rename flag `--schedule-workload` to `--schedule-pods-here` for kubeadm init 2016-09-24 14:46:41 +01:00
Atanas Mirchev ab3b2d579f
Fix package / struct naming after core refactoring. 2016-09-24 14:46:41 +01:00
Devan Goodwin 832d83efaa
Allow etcd container to work with selinux. 2016-09-24 14:46:40 +01:00
Ilya Dmitrichenko 0f05ccb019
Cleanup some low-hanging fruits and review TODOs 2016-09-24 14:46:40 +01:00
Atanas Mirchev 9eeae34581
Add node CIDR allocation as an option to kubeadm.
This is useful for users who are used to deploying with a flannel
overlay network.
2016-09-24 14:46:40 +01:00
Luke Marsden 38b53e31f3
Before declaring success, require that the discovery deployment has at least one active pod. 2016-09-24 14:46:39 +01:00
Paulo Pires 389cb2c7cd
Add support for external and optionally secured etcd cluster. 2016-09-24 14:46:39 +01:00
Paulo Pires 26aa32d32b
Reviewed help text, fix typos, go {fmt,vet,lint}. 2016-09-24 14:46:38 +01:00
Ilya Dmitrichenko a42ad6a913
Move `pkg/kubadm` to `cmd/kubeadm/app`, remove `cmd/manual.go` 2016-09-24 14:46:38 +01:00
Lucas Käldström cab23e202e
Various improvements for kubeadm. Removed the user command, as it's too little time for implementing that. Now it's possible to use multiple arches. 2016-09-24 14:46:37 +01:00
Evgeny L a2a807b50d
Mount etcd data directory to host 2016-09-24 14:46:36 +01:00
Ilya Dmitrichenko b9fd31ff7e
Refactoring improtant parts and start on docs 2016-09-24 14:46:35 +01:00
Lucas Käldström 26c4f593aa
Cleanup/refactor some things, make it possible to use individual images, hide unused flags 2016-09-24 14:46:34 +01:00
Ilya Dmitrichenko b48df06aba
Refactor kube-dns addon constructors, more labels
- also add another IP to SANs
- fix mkdir calls
- add TODO for ComponentConfig
- start tagging TODOs by phases
2016-09-24 14:46:34 +01:00
Paulo Pires 9e4fc59d39
Added DNS add-on. 2016-09-24 14:46:34 +01:00
Ilya Dmitrichenko 1c132fe974
Address comments in review
- start cleaning up `cmd/manual.go`
- refine progress and error messages
- add missing blank lines after the license headers
- run `gofmt -s -w`
- do not set fake cloud provider
- add a note on why we cannot remove `HostNetwork: true` from `kube-discovery` pod just yet
- taint master and use `role=master`, set tolerations and affinity for `kube-discovery`
- parametrise log-level flag for all components
2016-09-24 14:46:33 +01:00
Ilya Dmitrichenko f223d814da
Initial version of kubeadm 2016-09-24 14:46:24 +01:00