Commit Graph

2038 Commits (3d0c961d57bb90c112a0ee2f5ccdcb5c8570ad32)

Author SHA1 Message Date
Rostislav M. Georgiev 14dbfdcc3b kubeadm: remove arch suffix from control plane images
This change removes arch suffixes from control plane images (etcd,
kube-apiserver, kube-scheduler, kube-proxy, etc.). These are not needed, as
almost all control plane images have a fat manifest now.

We have arch suffixes only for kube-dns images now.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-08-28 11:11:48 +03:00
Kubernetes Submit Queue 029bb4e213
Merge pull request #67688 from Lion-Wei/kube-proxy-config
Automatic merge from submit-queue (batch tested with PRs 64597, 67854, 67734, 67917, 67688). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move kubeproxy ComponentConfig external types to `k8s.io/kube-proxy`

**What this PR does / why we need it**:
This PR implements most of kubernetes/community#2354 for the kube-proxy.
The PR:
- Moves k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig as-is to k8s.io/kubernetes/pkg/proxy/apis/config as agreed
- Moves the external types to the new staging repo k8s.io/kube-proxy, in the k8s.io/kube-proxy/config/v1beta1 package.
- Makes k8s.io/kubernetes/pkg/proxy/apis/config/v1beta1 source the types from k8s.io/kube-proxy/config/v1beta1. The defaulting and conversion code is kept in this package as before.
- All references to these packages have been updated.

Ref #67233

**Special notes for your reviewer**:

**Release note**:
```release-note
kube-proxy v1beta1 external ComponentConfig types are now available in the `k8s.io/kube-proxy` repo
```
2018-08-27 22:18:18 -07:00
Lion-Wei 47153803fb update autogenerated file 2018-08-28 09:14:27 +08:00
Lion-Wei 37e6266ef4 move external kube-proxy componentConfig to k8s.io/kube-proxy/config/ 2018-08-28 09:14:20 +08:00
liangwei 152e326722 referencing ClientConnectionConfiguration from k8s.io/apimachinery/pkg/apis/config 2018-08-28 09:10:11 +08:00
Kubernetes Submit Queue f0e2a24911
Merge pull request #66052 from lubinsz/master
Automatic merge from submit-queue (batch tested with PRs 66085, 66052). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use pause image with fat-manifest

What this PR does / why we need it:
Pause manifest code is merged in #57723, so we should use new image in test.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:
2018-08-27 17:47:58 -07:00
Kubernetes Submit Queue 34b1e94208
Merge pull request #67323 from chenyb4/kernel_check
Automatic merge from submit-queue (batch tested with PRs 67323, 66717, 67038). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kubeadm init kernel validator display message error

Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>



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

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#1051

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-27 16:26:59 -07:00
liz a53f478d21
Two implmentations of cert renewal 2018-08-27 16:27:14 -04:00
Lubomir I. Ivanov 90df4b4add kubeadm: update auto-generated BUILD files 2018-08-27 23:04:55 +03:00
Lubomir I. Ivanov 682b1b3d45 kubeadm: fix the air-gapped and offline support issues
1) Do not fail in case a bind address cannot be obtained

If netutil.ChooseBindAddress() fails looking up IP route tables
it will fail with an error in which case the kubeadm config
code will hard stop.

This scenario is possible if the Linux user intentionally disables
the WiFi from the distribution settings. In such a case the distro
could empty files such files as /proc/net/route and ChooseBindAddress()
will return an error.

For improved offline support, don't error on such scenarios but instead
show a warning. This is done by using the NoRoutesError type.
Also default the address to 0.0.0.0.

While doing that, prevent some commands like `init`, `join` and also
phases like `controlplane` and `certs` from using such an invalid
address.

Add unit tests for the new function for address verification.

2) Fallback to local client version

If there is no internet, label versions fail and this breaks
air-gapped setups unless the users pass an explicit version.

To work around that:
- Remain using 'release/stable-x.xx' as the default version.
- On timeout or any error different from status 404 return error
- On status 404 fallback to using the version of the client via
kubeadmVersion()

Add unit tests for kubeadmVersion().

Co-authored-by: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
2018-08-27 23:03:31 +03:00
Kubernetes Submit Queue bb70b951f8
Merge pull request #67447 from pivotal-k8s/windows-cri-socket
Automatic merge from submit-queue (batch tested with PRs 67447, 67719). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Set DefaultCRISocket on Windows

**What this PR does / why we need it**:
Updates the default location for the CRI socket on Windows to a TCP URI. This is documented by Docker [here](https://docs.docker.com/docker-for-windows/faqs/#how-do-i-connect-to-the-remote-docker-engine-api).

**Release note**:

```release-note
kubeadm: --cri-socket now defaults to tcp://localhost:2375 when running on Windows
```
2018-08-27 12:20:02 -07:00
Kubernetes Submit Queue 74d513fae0
Merge pull request #54935 from anguslees/kubeadm-chroot
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: chroot to new --rootfs arg

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

This change adds a new --rootfs=path option to kubeadm, and (if
provided) chroot()s to this path before performing file operations.

This makes it possible to run the kubeadm binary from a container, but
perform remaining file operations against the host filesystem using
something like:

```
    docker run -v /:/rootfs --net=host --uts=host --pid=host \
       kubeadm:latest init ...
```

(Assuming something like the included `examples/kubeadm/Dockerfile` which sets CMD to `kubeadm --rootfs=/rootfs` - Edit: Dockerfile has been removed from this PR, but you get the idea)

Fixes kubernetes/kubeadm#503

**Special notes for your reviewer**:

- I'm not sure where is best to put the Dockerfile, or hook it up to the build process.  Advice sought.

- The kubeadm command line arg handling was less unified than I was expecting to find.  I've implemented this arg for `init` and `join`.   I can add it to all the others too, if we're happy with the approach. An alternative would be to add the arg in the parent `KubeadmCommand`, possibly with a `PersistantFlag` - then it would automatically exist for all kubeadm subcommands.

- It would be slightly preferable if we could order `--rootfs` _before_ the subcommand so we could apply the arg automatically with `ENTRYPOINT ["kubeadm", "--rootfs=/rootfs"]`.  This would be the only such flag in `kubeadm` however, so I have not implemented it that way atm.  (Another alternative would be an env var)

**Release note**:
```release-note
Adds a new EXPERIMENTAL `--rootfs` flag to kubeadm, which (if specified) causes kubeadm to chroot before performing any file operations.  This is expected to be useful when setting up kubernetes on a different filesystem, such as invoking kubeadm from docker.
```
2018-08-27 10:33:46 -07:00
Kubernetes Submit Queue ed3c32c3f9
Merge pull request #67832 from fabriziopandini/kubeadm-config-APIEndpoint
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm config add support for more than one APIEndpoint

**What this PR does / why we need it**:
This PR completes the changes in kubeadm for management of more than one control plane instances introducing the possibility to configure more than one APIEndpoints

**Which issue(s) this PR fixes** :
refs https://github.com/kubernetes/kubeadm/issues/911, refs https://github.com/kubernetes/kubeadm/issues/963

**Special notes for your reviewer**:
Depends on:
- [x] https://github.com/kubernetes/kubernetes/pull/67830

**Release note**:
```release-note
kubeadm: The kubeadm configuration now support definition of more than one control plane instances with their own APIEndpoint. The APIEndpoint for the "bootstrap" control plane instance should be defined using `InitConfiguration.APIEndpoint`, while the APIEndpoints for additional control plane instances should be added using `JoinConfiguration.APIEndpoint`.  
```

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/sig cluster-lifecycle
/area kubeadm
/kind api-change
/kind enhancement
/assign @luxas
/assign @timothysc
/cc @chuckha @rosti @neolit123 @liztio
2018-08-27 09:04:50 -07:00
fabriziopandini 0add7f9c62 autogenerated 2018-08-27 09:00:39 +02:00
fabriziopandini 7dfb3c7134 kubeadm config add support for more than one APIEndpoint 2018-08-27 09:00:26 +02:00
Angus Lees 7e7712449b Add "EXPERIMENTAL" to the option description 2018-08-27 12:33:55 +10:00
liangwei 6a048c3b96 Move pkg/proxy/apis/kubeproxyconfig to pkg/proxy/apis/config 2018-08-27 10:30:42 +08:00
Michael Taufen 1b7d06e025 Kubelet creates and manages node leases
This extends the Kubelet to create and periodically update leases in a
new kube-node-lease namespace. Based on [KEP-0009](https://github.com/kubernetes/community/blob/master/keps/sig-node/0009-node-heartbeat.md),
these leases can be used as a node health signal, and will allow us to
reduce the load caused by over-frequent node status reporting.

- add NodeLease feature gate
- add kube-node-lease system namespace for node leases
- add Kubelet option for lease duration
- add Kubelet-internal lease controller to create and update lease
- add e2e test for NodeLease feature
- modify node authorizer and node restriction admission controller
to allow Kubelets access to corresponding leases
2018-08-26 16:03:36 -07:00
Kubernetes Submit Queue f1feecb5c9
Merge pull request #67830 from fabriziopandini/kubeadm-config-ControlPlaneEndpoint
Automatic merge from submit-queue (batch tested with PRs 67776, 67503, 67679, 67786, 67830). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm config move ControlPlaneEndpoint to ClusterConfiguration

**What this PR does / why we need it**:
This PR moves `ControlPlaneEndpoint` from the `API` config struct to `ClusterConfiguration`.

This change is required as initial step for enabling management of more than one control plane instances in kubeadm

**Which issue(s) this PR fixes** :
refs https://github.com/kubernetes/kubeadm/issues/911, refs https://github.com/kubernetes/kubeadm/issues/963

**Special notes for your reviewer**:
just an appetizer, the main dish will be the next PR...

**Release note**:
```release-note
kubeadm: ControlPlaneEndpoint was moved from the API config struct to ClusterConfiguration
```

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/sig cluster-lifecycle
/area kubeadm
/kind api-change
/kind enhancement
/assign @luxas
/assign @timothysc
/cc @chuckha @rosti @neolit123 @liztio
2018-08-24 16:50:09 -07:00
Kubernetes Submit Queue 078961f3fb
Merge pull request #67786 from fabriziopandini/kubeadm-deprecate-featureflags
Automatic merge from submit-queue (batch tested with PRs 67776, 67503, 67679, 67786, 67830). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm - deprecate feature-gates HighAvailability, SelfHosting, CertsInSecrets

**What this PR does / why we need it**:
As for sig discussion (see meeting notes - August 22 - 2018) we are going to block usage of feature gates HighAvailability, SelfHosting, CertsInSecrets for new clusters and block updates to v1.12 of existing clusters using such features.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` 
Fixes # https://github.com/kubernetes/kubeadm/issues/1058

**Special notes for your reviewer**:
I'm going to open issue to track code cleanup in v1.13 

**Release note**:
```release-note
kubeadm - feature-gates HighAvailability, SelfHosting, CertsInSecrets are now deprecated and can't be used anymore for new clusters. Update of cluster using above feature-gates flag is not supported
```
/sig cluster-lifecycle
/kind feature
/kind cleanup
/assign @timothysc
/cc
2018-08-24 16:50:06 -07:00
fabriziopandini 689417c806 kubeadm - deprecate feature-gates HighAvailability, SelfHosting, CertsInSecrets 2018-08-24 13:19:13 +02:00
fabriziopandini 960ef7bf67 autogenerated 2018-08-24 09:42:33 +02:00
fabriziopandini 5e21c14b76 kubeadm config move ControlPlaneEndpoint to ClusterConfiguration 2018-08-24 09:42:23 +02:00
Rostislav M. Georgiev de39f49949 kubeadm: use ClusterConfiguration in images.go
Replace the unnecessary use of InitConfiguration in images.go with
ClusterConfiguration. This changes the interfaces of the following functions:

- GetKubeControlPlaneImage
- GetEtcdImage
- GetAllImages

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-08-23 17:36:33 +03:00
Kubernetes Submit Queue 74f44482ec
Merge pull request #66973 from fabriziopandini/kubeadm-ha-upgrade
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubeadm ha upgrade

**What this PR does / why we need it**:
This PR implements one of the actions defined by https://github.com/kubernetes/kubeadm/issues/751 (checklist form implementing HA in kubeadm). see [KEP 0015](https://github.com/kubernetes/community/blob/master/keps/sig-cluster-lifecycle/0015-kubeadm-join-master.md) for more context

With this PR, kubeadm implements a new command `kubeadm upgrade node experimental-control-plane` that managed upgrade of control plane components on a secondary control plane instance. 

The entire workflow in case of HA clusters will be:

- Upgrade the control plane
   - run `kubeadm upgrade apply` on a first control plane instance
   - run `kubeadm upgrade node experimental-control-plane` on secondary control plane instances
- Upgrade nodes

**Special notes for your reviewer**:
/CC @timothysc @luxas @chuckha  @kubernetes/sig-cluster-lifecycle-pr-reviews 

**Release note**:
```
kubeadm now has the `kubeadm upgrade node experimental-control-plane` command for upgrading secondary control plane instances created with `kubeadm join --experimental-control-plane`. 
```
2018-08-22 18:02:49 -07:00
Kubernetes Submit Queue 51605c395e
Merge pull request #67441 from rosti/kubeadm_clusterconfig
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[reissue] kubeadm: Split out ClusterConfiguration from InitConfiguration

As @luxas is not able to take care of #66219, I am reissuing the same change here. There are a few minor things added by me:

- The original PR is rebased on latest master.
- Some broken tests were fixed.
- Some TODOs were added.
- Run update-bazel and update-gofmt

Below is the text of the original PR by Lucas.

-----

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

Splits MasterConfiguration to InitConfiguration and ClusterConfiguration as outlined in the kubeadm Config KEP. InitConfiguration holds init-only information, and ClusterConfiguration holds cluster-wide information. In the internal representation InitConfiguration wraps ClusterConfiguration as a field, but in serialized format they're different YAML documents.

**Which issue(s) this PR fixes** (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
ref: kubernetes/kubeadm#911
Depends on:

- [X] #65776
- [X] #65628
- [X] #65629
- [X] #65631
- [X] #65940
- [X] #65787
- [X] #65945
- [X] #65951
- [X] #65952

**Special notes for your reviewer:**

**Release note**:
```release-note
kubeadm: InitConfiguration now consists of two structs: InitConfiguration and ClusterConfiguration
```

@kubernetes/sig-cluster-lifecycle-pr-reviews
2018-08-22 16:46:59 -07:00
Kubernetes Submit Queue 0cb018febb
Merge pull request #67700 from kad/fix-init-tc
Automatic merge from submit-queue (batch tested with PRs 63757, 67698, 67712, 67494, 67700). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix test case: invalid version should not trigger network operations

**What this PR does / why we need it**: current invalid version value in the test case triggers network operation to check it validity via `https://dl.k8s.io/`. Using incorrect semantic version will achieve same result of test case without possibility to trigger network connection.

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

**Special notes for your reviewer**:
@neolit123 

**Release note**:
```release-note
NONE
```
2018-08-22 14:17:28 -07:00
fabriziopandini aa641ad5e3 autogenerated 2018-08-22 23:09:28 +02:00
fabriziopandini 202e67c4a7 kubeadm-ha-upgrade 2018-08-22 23:09:16 +02:00
Kubernetes Submit Queue 9af86c5535
Merge pull request #64520 from wgliang/master.cmd-unused
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unused functions in cmd

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-22 12:49:45 -07:00
Alexander Kanevskiy 7f5b51f920 Fix test case: invalid version should not trigger network operations 2018-08-22 15:01:30 +03:00
Lucas Käldström 0fde05ac53 update some stuff 2018-08-22 11:43:15 +03:00
Lucas Käldström 5224551fa1 kubeadm: Split out ClusterConfiguration from InitConfiguration
Trivial rebasement, fixed some broken tests,
and inserted some TODOs: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-08-22 11:43:02 +03:00
Kubernetes Submit Queue 9b8f3f3cb8
Merge pull request #67648 from xlgao-zju/fix-annotate-panic
Automatic merge from submit-queue (batch tested with PRs 65788, 67648, 67660). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[kubeadm] fix panic when node annotation is nil

**What this PR does / why we need it**:
kubeadm will panic, when the node annotation is nil.

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

**Special notes for your reviewer**:
/assign @neolit123 

**Release note**:

```release-note
kubeadm:  Fix panic when node annotation is nil
```
2018-08-21 10:14:01 -07:00
Kubernetes Submit Queue 54dbbc41df
Merge pull request #67618 from liztio/fix-bazel
Automatic merge from submit-queue (batch tested with PRs 66862, 67618). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix bazel

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

`bazel test //cmd/kubeadm/...` has been broken for a while. This is incredibly annoying to me, because I use it constantly during my workflow. This should fix it.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2018-08-21 00:24:04 -07:00
Xianglin Gao 5484880351 fix panic when node annotation is nil
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-08-21 12:59:28 +08:00
Kubernetes Submit Queue 6d76e35b39
Merge pull request #67605 from liztio/cert-list-2
Automatic merge from submit-queue (batch tested with PRs 67596, 67520, 67605). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Cert list 2

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

Continuation of #67208. Uses the newly created declarative list of certificates kubeadm requires for the certs phase and upgrade steps.


**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-08-20 15:03:02 -07:00
liz b17830a312
Fix `bazel test //cmd/kubeadm/...`
kubeadm tests no longer change the default directory, they simply use the
correct absolute path
2018-08-20 17:11:13 -04:00
liz 394e6b554a
Yank out a bunch of manual tests and prose
`phase certs` and upgrade commands now all use certslist infra
2018-08-20 15:21:08 -04:00
Kubernetes Submit Queue 31420467ae
Merge pull request #67302 from dixudx/dnsmasq_add_loop_detect
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add --dns-loop-detect option to dnsmasq run by kube-dns

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

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

**Special notes for your reviewer**:
/cc @kubernetes/sig-network-pr-reviews 

**Release note**:

```release-note
add --dns-loop-detect option to dnsmasq run by kube-dns
```
2018-08-18 08:47:18 -07:00
Kubernetes Submit Queue fc0fa50265
Merge pull request #67501 from rosti/kubeadm_kubeletFailTempl_cleanup
Automatic merge from submit-queue (batch tested with PRs 66793, 67405, 67068, 67501, 67484). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Remove images from the context of kubeletFailTempl

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

Since #66658 kubeletFailTempl no longer contains any images, thus we don't need to fill them
in its context.

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

**Special notes for your reviewer**:

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/kind cleanup
/assign @timothysc
/assign @fabriziopandini

**Release note**:

```release-note
NONE
```
2018-08-17 05:05:22 -07:00
Xianglin Gao dbcc84a9ec Make kubelet healthz port a constant
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-08-17 09:09:21 +08:00
Rostislav M. Georgiev 9c35184f05 kubeadm: Remove unused piece of code
kubeletFailTempl no longer contains any images, thus we don't need to fill them
in its context.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-08-16 16:03:35 +03:00
Kubernetes Submit Queue 780f4b46e0
Merge pull request #67375 from hanxiaoshuai/fix0814
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unused code in kubeadm/app/cmd/reset_test.go

**What this PR does / why we need it**:
remove unused code in kubeadm/app/cmd/reset_test.go
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-16 00:26:29 -07:00
Kubernetes Submit Queue 7f7a967f9f
Merge pull request #66702 from xlgao-zju/search-kubeconfig
Automatic merge from submit-queue (batch tested with PRs 62441, 66702, 67254, 67421, 65309). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[kubeadm] Apply means to search for existing KubeConfig files in standard locations across kubeadm

**What this PR does / why we need it**:
Apply means to search for existing KubeConfig files in standard locations across kubeadm.

Tasklist:

- [x] Use the Join of Dir and File name instead of DefaultKubeConfig
- [x] Refactor token.go::findExistingKubeConfig() into a utility in cmd/kubeadm/app/cmd/util
- [x] Use the utility in config, upgrade and some of the phases commands that use --kubeconfig

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref [kubernetes/kubeadm/#805](https://github.com/kubernetes/kubeadm/issues/805)

**Special notes for your reviewer**:
/assign @neolit123 

**Release note**:

```release-note
NONE
```
2018-08-15 15:30:18 -07:00
Kubernetes Submit Queue 68cfa7ef10
Merge pull request #67208 from liztio/cert-list
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

First pass of cert list

**What this PR does / why we need it**:
Refactors the cert management code in kubeadm to be more extensible and resiliant.

This initial change doesn't change anything on the surface, and in fact appears to add a bunch of complexity. The goal here is to reduce duplication in the certs codebase, which is started in this PR by gutting the New*CertAndKey. Eventually, those functions will be removed altogether. The declarative list will also allow us to build a more explicit renewal function and command line interface and reduce much more duplication in the cert package.


**Special notes for your reviewer**:

**Release note**:
```
```
2018-08-15 13:43:41 -07:00
Kubernetes Submit Queue 1da4c59e46
Merge pull request #67182 from poothia/pathfix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixing kubeadm.conf file path

This patch fixed kubeadm.conf file path in this file.
2018-08-15 10:58:37 -07:00
Ben Moss 75c62e6f6b Set DefaultCRISocket on Windows
Reference: https://docs.docker.com/docker-for-windows/faqs/#how-do-i-connect-to-the-remote-docker-engine-api
2018-08-15 13:37:59 -04:00
liz f5e9eb8674
Add certlist.go - a declarative list of all certs kubeadm requires
* Sub out New*CertAndKey for functions using the new certlist
2018-08-15 11:42:13 -04:00
liz 742b258ca2
Add certlist.go - a declarative list of all certs kubeadm requires
* Sub out New*CertAndKey for functions using the new certlist
2018-08-15 11:07:23 -04:00
Kubernetes Submit Queue 6a12a280a5
Merge pull request #67409 from stewart-yu/stewart-controller-manager-codeclean#03
Automatic merge from submit-queue (batch tested with PRs 66884, 67410, 67229, 67409). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm:  coverage improvement about ValidateVersion function

**What this PR does / why we need it**:
In commit log :2ef8157644, remove the `MinimumVersion support` for all featuregate, but the `MinimumVersion` still as a parameter in `Feature` struct for `future featuregate`.
However,https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/features/features.go#L79-L87 still have judgement about `MinimumVersion` in `ValidateVersion` function, we also need test it. 
This PR  make `test coverage` about `ValidateVersion` function from `20%` to `90%`. Details as below.

Before changed, the `test coverage` are:
```
root@shap000101123:/ycj/kubernetes-community/src/k8s.io/kubernetes/cmd/kubeadm/app/features# go tool cover -func=size_coverage.out
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:71:	ValidateVersion			20.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:92:	Enabled				100.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:101:	Supports			100.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:111:	Keys				0.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:120:	KnownFeatures			90.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:139:	NewFeatureGate			94.1%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:171:	ResolveFeatureGateDependencies	100.0%
total:								(statements)			73.1%
```
After change, the `test coverage` are:
```
root@shap000101123:/ycj/kubernetes-community/src/k8s.io/kubernetes/cmd/kubeadm/app/features# go tool cover -func=size_coverage.out
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:71:	ValidateVersion			90.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:92:	Enabled				100.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:101:	Supports			100.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:111:	Keys				0.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:120:	KnownFeatures			90.0%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:139:	NewFeatureGate			94.1%
k8s.io/kubernetes/cmd/kubeadm/app/features/features.go:171:	ResolveFeatureGateDependencies	100.0%
total:								(statements)			86.5%
```
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
@luxas  @neolit123 @fabriziopandini @dixudx 

**Release note**:

```release-note
NONE
```
2018-08-15 07:10:19 -07:00
Yuanbin.Chen 732382620d Fix kubeadm init kernel validator display message error
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-08-15 12:13:27 +08:00
stewart-yu 3975d9fd07 auto-generated file 2018-08-15 09:07:38 +08:00
stewart-yu 55fa6d5fdd smaller coverage improvement about ValidateVersion function 2018-08-15 09:07:38 +08:00
Kubernetes Submit Queue 4ff782df81
Merge pull request #66657 from liangwenguo/third_person
Automatic merge from submit-queue (batch tested with PRs 66491, 66587, 66856, 66657, 66923). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix grammar error: the predicate verb should be singular.

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-14 17:55:14 -07:00
Kubernetes Submit Queue d7634dcf23
Merge pull request #66856 from charrywanganthony/scheduler_space
Automatic merge from submit-queue (batch tested with PRs 66491, 66587, 66856, 66657, 66923). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add space for output

**Release note**:
```release-note
NONE
```
2018-08-14 17:55:11 -07:00
hangaoshuai 420fb6ba02 remove unused code in kubeadm/app/cmd/reset_test.go 2018-08-14 17:02:53 +08:00
Xianglin Gao 2cccbf9d0c Use FindExistingKubeConfig in the phases which use the --kubeconfig
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-08-13 15:54:38 +08:00
Xianglin Gao 99161aa3c9 Use AddKubeConfigFlag everywhere in kubeadm
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-08-13 15:50:16 +08:00
Xianglin Gao ebce14b36e Use the Join of Dir and File name instead of DefaultKubeConfig
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-08-13 15:47:01 +08:00
Xianglin Gao 866631fab1 Move defaultKubeConfig to constants.go
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-08-13 15:45:00 +08:00
Di Xu 25f9909cba add --dns-loop-detect option to dnsmasq run by kube-dns 2018-08-11 22:30:25 +08:00
Kubernetes Submit Queue 9fdffd1e57
Merge pull request #62721 from xiangpengzhao/phase-version
Automatic merge from submit-queue (batch tested with PRs 66984, 67236, 67216, 62721, 67106). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Set kubeadm version as the default version in phase command.

**What this PR does / why we need it**:
In some phase commands which don't use kubernetes version, set kubeadm version as the kubernetes version to avoid get it from internet.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubeadm/issues/756

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

**Release note**:

```release-note
NONE
```
2018-08-10 18:59:15 -07:00
Kubernetes Submit Queue cf89c466cc
Merge pull request #66873 from fabriziopandini/kubeadm-ha-join-master
Automatic merge from submit-queue (batch tested with PRs 67017, 67190, 67110, 67140, 66873). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubeadm join --control-plane main workflow

**What this PR does / why we need it**:
This PR implements one of the actions defined by https://github.com/kubernetes/kubeadm/issues/751 (checklist form implementing HA in kubeadm).

With this PR, kubeadm implements the `kubeadm join --control-plane`workflow, as described in the [KEP 0015-kubeadm-join-master.md](https://github.com/kubernetes/community/blob/master/keps/sig-cluster-lifecycle/0015-kubeadm-join-master.md) with the exception of the update of the `kubeadm-config` ConfigMap that will be completed in a following PR as soon as the implementation in the config file will allow it. 

**Special notes for your reviewer**:
/CC @timothysc @luxas @chuckha  @kubernetes/sig-cluster-lifecycle-pr-reviews 

**Release note**:
```
`kubeadm join` now has the --experimental-control-plane flag that triggers deploy of a new control plane instance on the joining node. 
```
2018-08-10 17:01:20 -07:00
Kubernetes Submit Queue 95307254e4
Merge pull request #67017 from bart0sh/PR0027-kubeadm-fix-CRI-ListKubeContainers
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: fix CRI ListKubeContainers API

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

Current implementation of this API always returns
checks output of 'crictl pods -q' and filters out everything
that doesn't start with k8s_. 'crictl pods -q' returns only pod ids,
so everything is always filtered out.

Removing filtering by name prefix should fix this.

**Which issue this PR fixes**
Fixes: kubernetes/kubeadm#926

**Release note**:
```release-note
NONE
```
2018-08-10 16:42:48 -07:00
Kubernetes Submit Queue 5de3896d0d
Merge pull request #67176 from charrywanganthony/auditv1beta1Tov1_utils
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use v1 version of advanced audit policy in kubeadm

audit api version has been updated to v1 #65891 

**Release note**:
```release-note
kubeadm uses audit policy v1 instead of v1beta1
```
2018-08-10 08:57:11 -07:00
Kubernetes Submit Queue cd06fd4ad7
Merge pull request #67131 from rosti/kube-proxy-manifest-fix2
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Deduplicate kube-proxy image logic

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

Until now, kube-proxy image was handled in two separate places:
    
- In images.go along with the pre-pull code and without having the image override capabilities (via UnifiedControlPlaneImage)

- In the kube-proxy manifest, where image override was possible.

This duplicates the kube-proxy image logic and makes it prone to errors.
Therefore, this change aims to deduplicate it and make it more straightforward.
This is achieved in the following ways:

- GetKubeControlPlaneImage is used for kube-proxy image fetching, thus allowing for the image to be overriden by UnifiedControlPlaneImage.

- Remove duplicated logic from the manifest and use GetKubeControlPlaneImage to generate the image for the manifest.

This PR also removes GetKubeControlPlaneImageNoOverride as it's no longer needed.

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

**Special notes for your reviewer**:

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @luxas
/assign @timothysc

**Release note**:

```release-note
kubeadm: make sure pre-pulled kube-proxy image and the one specified in its daemon set manifest are the same
```
2018-08-10 03:56:19 -07:00
fabriziopandini 7d2ac1dbd6 kubeadm-ha-join-controlplane 2018-08-09 19:03:56 +02:00
fabriziopandini f3ba240e11 test files 2018-08-09 19:00:07 +02:00
fabriziopandini 23b8f19328 autogenerated 2018-08-09 18:59:52 +02:00
Chao Wang 765e2fc788 use v1 version of advanced audit policy in kubeadm 2018-08-09 19:38:05 +08:00
Rostislav M. Georgiev dedf139288 kubeadm: Deduplicate kube-proxy image logic
Until now, kube-proxy image was handled in two separate places:

- In images.go along with the pre-pull code and without having the image
override capabilities (via UnifiedControlPlaneImage)

- In the kube-proxy manifest, where image override was possible.

This duplicates the kube-proxy image logic and makes it prone to errors.
Therefore, this change aims to deduplicate it and make it more straightforward.
This is achieved in the following ways:

- GetKubeControlPlaneImage is used for kube-proxy image fetching, thus allowing
for the image to be overriden by UnifiedControlPlaneImage.

- Remove duplicated logic from the manifest and use GetKubeControlPlaneImage to
generate the image for the manifest.

Additionally, GetKubeControlPlaneImageNoOverride is removed as the only use case
for the function is now invalid.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-08-09 12:01:26 +03:00
poothia 04ca57fa4f
Update join_test.go 2018-08-09 11:04:40 +05:30
Angus Lees 16e46c8afd kubeadm: chroot to new --rootfs arg
This change adds a new --rootfs=path option to kubeadm, and (if
provided) chroot()s to this path before performing file operations.

This makes it possible to run the kubeadm binary from a container, but
perform remaining file operations against the host filesystem using
something like:

    docker run -v /:/rootfs --net=host --uts=host --pid=host \
       kubeadm:latest init --rootfs /rootfs...

Fixes kubernetes/kubeadm#503
2018-08-08 18:10:39 +10:00
xiangpengzhao 3f2c7b6fda Check config path for command "kubeadm alpha phase kubelet write-env-file" 2018-08-08 14:29:53 +08:00
xiangpengzhao 610ca1f60c Auto generated BUILD files. 2018-08-08 12:06:34 +08:00
xiangpengzhao 5cf9291e02 Set kubeadm version as the default version in phase command. 2018-08-08 12:05:36 +08:00
xiangpengzhao 9e204fe7f7 Remove the kubeadm `--skip-preflight-checks` flag 2018-08-07 20:19:54 +08:00
Ed Bartosh d64f489fa1 kubeadm: fix CRI ListKubeContainers API
Current implementation of this API always returns
checks output of 'crictl pods -q' and filters out everything
that doesn't start with k8s_. 'crictl pods -q' returns only pod ids,
so everything is always filtered out.

Removing filtering by name prefix should fix this.

Fixes: kubernetes/kubeadm#926
2018-08-07 10:59:44 +03:00
Kubernetes Submit Queue e48ccceab4
Merge pull request #66823 from bart0sh/PR0026-kubeadm-fix-ImagePullCheck-output
Automatic merge from submit-queue (batch tested with PRs 64815, 66823, 66473, 66466). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: fix ImagePullCheck output

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

ImagePullCheck outputs "pulling <image>" line even if image
already exists and is not pulled.
    
Fixed the output to reflect the reality. ImagePullCheck now outputs
either "pulling <image>" or "image <image> exists".

**Release note**:
```release-note
NONE
```
2018-08-03 18:03:00 -07:00
Kubernetes Submit Queue cb1ef9f7e8
Merge pull request #64815 from dixudx/hostname_empty
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

error out empty hostname

**What this PR does / why we need it**:
For linux, the hostname is read from file `/proc/sys/kernel/hostname` directly, which can be overwritten with whitespaces.

Should error out such invalid hostnames.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#835

**Special notes for your reviewer**:
/cc luxas timothysc 

**Release note**:

```release-note
nodes: improve handling of erroneous host names
```
2018-08-03 17:13:32 -07:00
Kubernetes Submit Queue 2cb1d64c11
Merge pull request #66822 from bart0sh/PR0025-kubeadm-runtime-fix-ImageExists
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: fix runtime.ImageExists API

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

runtime.ImageExists returns error when underlying 'inspect' command
fails. This makes ImagePullCheck to fail as it doesn't expect
runtime.ImageExists to return an error even if image doesn't exist.

**Which issue(s) this PR fixes**:
Fixes [kubeadm issue 1024](https://github.com/kubernetes/kubeadm/issues/1024)

**Release note**:
```release-note
NONE
```
2018-08-02 23:51:30 -07:00
Kubernetes Submit Queue d7bcae8b96
Merge pull request #60791 from mythi/kernel
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kernel_validator: amend kernel config check paths

**What this PR does / why we need it**:
Clear Linux Project for Intel Architecture uses its own path
to store kernel build artifacts. This PR amends the path to kernel validator's 
config check paths.

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

**Special notes for your reviewer**:

**Release note**:

```
e2e_node:  add new kernel config check paths
```
2018-08-02 22:32:46 -07:00
Ed Bartosh 84300e781c kubeadm: fix ImagePullCheck output
ImagePullCheck outputs "pulling <image>" line even if image
already exists and is not pulled.

Fixed the output to reflect the reality. ImagePullCheck now outputs
either "pulling <image>" or "image <image> exists".
2018-08-02 11:58:52 +03:00
David Eads d3bd0eb1d5 make package name match all the import aliases 2018-08-01 15:31:12 -04:00
Chao Wang 895b6d441d add space for output 2018-08-01 18:08:31 +08:00
Di Xu b3dfe0c652 nodes: improve handling of erroneous host names 2018-08-01 14:57:25 +08:00
Kubernetes Submit Queue 65ba40c2b0
Merge pull request #66445 from rosti/kubeadm-test-cmd-init
Automatic merge from submit-queue (batch tested with PRs 66445, 66643, 60551). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Improve kubeadm init cmd tests

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

This PR improves kubeadm init cmd tests in the following ways:

- Fix a few cases that were always successful (despite completely wrong).
- Add more test cases (for different configs in particular)
- Use dry run, to avoid modifying the system and using kubeadm reset

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

**Special notes for your reviewer**:
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @luxas
/assign @timothysc

**Release note**:

```release-note
NONE
```
2018-07-31 15:56:04 -07:00
Ed Bartosh c086c235f2 kubeadm: fix runtime.ImageExists API
This API return error when underlying 'inspect' command
fails. This makes ImagePullCheck to fail as it doesn't expect
runtime.ImageExists to return an error even if image doesn't exist.

Fixed this by returning error nil even when inspect command fails.
2018-07-31 13:50:12 +03:00
Kubernetes Submit Queue 2bee858a7b
Merge pull request #66284 from stewart-yu/stewart-sharedtype-move
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move the` k8s.io/kubernetes/pkg/util/pointer` package to` k8s.io/utils/pointer`

**What this PR does / why we need it**:
Move `k8s.io/kubernetes/pkg/util/pointer` to  `shared utils` directory, so that we can use it  easily.
Close #66010 accidentally, and can't reopen it, so the same as #66010 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-30 19:50:36 -07:00
stewart-yu f1343af5d7 auto-generated file 2018-07-28 07:54:17 +08:00
stewart-yu 649b46ff1d fix verify about import error 2018-07-28 07:54:16 +08:00
Kubernetes Submit Queue 2ffbaa13d0
Merge pull request #66681 from xlgao-zju/use-constant
Automatic merge from submit-queue (batch tested with PRs 66554, 66616, 66695, 66681). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[kubeadm] Use KubeletRunDirectory instead of hard-coded way

**What this PR does / why we need it**:
fix `TODO: Make hard-coded "/var/lib/kubelet" strings reference this constant.`

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

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

**Release note**:

```release-note
NONE
```
2018-07-27 10:09:14 -07:00
Kubernetes Submit Queue f7641e8710
Merge pull request #66482 from dixudx/kubeadm_use_existing_config
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm join the cluster with pre-existing client certificate if provided

**What this PR does / why we need it**:
support `kubeadm join` with a pre-existing client certificate

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#945

**Special notes for your reviewer**:
/cc @luxas @timothysc  @kubernetes/sig-cluster-lifecycle-pr-reviews 

**Release note**:

```release-note
kubeadm now can join the cluster with pre-existing client certificate if provided
```
2018-07-27 05:54:27 -07:00
stewart-yu 55251c716a update the import file for move util/pointer to k8s.io/utils 2018-07-27 19:47:02 +08:00
Mikko Ylinen cc117866bd kernel_validator: amend kernel config check paths
Clear Linux Project for Intel Architecture uses its own path
to store kernel build artifacts. This is documented, e.g.,
in https://github.com/clearlinux/clr-boot-manager.

Adapt kernel validator's config check paths to include Clear
Linux's path too.
2018-07-27 09:07:12 +03:00
Xianglin Gao 6ca1428256 Use KubeletRunDirectory instead of hard-coded way
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-07-27 12:22:57 +08:00
Di Xu 997a612206 kubeadm join the cluster with pre-existing client certificate 2018-07-26 19:34:09 +08:00
Di Xu 3c23905781 remove misleading error message on image pulling 2018-07-26 17:07:59 +08:00
liangwenguo 59a6e658d8 fix grammar error: the predicate verb should be the third person. 2018-07-26 16:51:01 +08:00
Kubernetes Submit Queue 2755000b3e
Merge pull request #66499 from rosti/kubedns-images
Automatic merge from submit-queue (batch tested with PRs 66291, 66471, 66499). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Pull sidecar and dnsmasq-nanny images when using kube-dns

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

It appears that sidecar and dnsmasq-nanny images are now required for
kube-dns deployment to work correctly. Thus the following default kube-dns
images are used now:

- k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.10
- k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.10
- k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.10

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#1016

**Special notes for your reviewer**:

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @luxas
/assign @timothysc
/kind bug

**Release note**:

```release-note
kubeadm: Pull sidecar and dnsmasq-nanny images when using kube-dns
```
2018-07-24 14:00:01 -07:00
Ed Bartosh 02bab4af63 kubeadm: make error output more verbose
Included error output of the docker/crictl into the
kubeadm error output. This should help users to understand better
why runtime is failing.
2018-07-24 13:49:23 +03:00
Rostislav M. Georgiev fb7ba52341 kubeadm: Pull sidecar and dnsmasq-nanny images when using kube-dns
It appears that sidecar and dnsmasq-nanny images are now required for
kube-dns deployment to work correctly. Thus the following default kube-dns
images are used now:

- k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.10
- k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.10
- k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.10

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-07-24 13:35:27 +03:00
Rostislav M. Georgiev 961d776fac kubeadm: Improve kubeadm init cmd tests
kubeadm init cmd tests are improved in the following ways:

- Fix a few cases that were always successful (despite completely wrong).
- Add more test cases (for different configs in particular)
- Use dry run, to avoid modifying the system and using kubeadm reset

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-07-23 12:32:51 +03:00
Ed Bartosh b9006648f2 kubeadm: rename cri-socket-path -> cri-socket
Renamed command line option cri-socket-path for 2 reasons:
- to be consistent with the rest of kubeadm code
  reset/init/join/apply subcommands use --cri-socket
- name is misleading as CRI socket can be also an url,
  not just a path
2018-07-23 11:55:04 +03:00
Kubernetes Submit Queue 098e971c68
Merge pull request #66341 from runiq/kubeadm-no-uid-in-spec
Automatic merge from submit-queue (batch tested with PRs 66341, 66405, 66403, 66264, 66447). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: stop setting UID in the kubelet ConfigMap

**What this PR does / why we need it**: kubeadm: stop setting UID in the kubelet ConfigMap

**Which issue(s) this PR fixes**:

Fixes https://github.com/kubernetes/kubeadm/issues/921#

**Release note**:
```release-note
kubeadm: stop setting UID in the kubelet ConfigMap
```
2018-07-20 16:02:05 -07:00
Kubernetes Submit Queue 4ca548201f
Merge pull request #66278 from bart0sh/PR0021-kubeadm-wrap-tests-in-T.Run
Automatic merge from submit-queue (batch tested with PRs 66152, 66406, 66218, 66278, 65660). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: wrap runtime tests in a t.Run

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

Improved runtime tests by using [T.Run API](https://golang.org/pkg/testing/#T.Run) 

This should improve testing output and make it more visible
which test is doing what.

**Which issue(s) this PR fixes**:

This PR addresses [this review comment](https://github.com/kubernetes/kubernetes/pull/64611#pullrequestreview-137441722) 

**Release note**:
```release-note
NONE
```
2018-07-20 12:12:19 -07:00
Kubernetes Submit Queue 6c500be080
Merge pull request #66218 from atlassian/handle-errors
Automatic merge from submit-queue (batch tested with PRs 66152, 66406, 66218, 66278, 65660). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Handle errors

**What this PR does / why we need it**:
This is a followup PR for https://github.com/kubernetes/kubernetes/pull/64664 to handle errors returned from `.AddToScheme()` in places where they are not handled.

**Release note**:
```release-note
NONE
```
/kind cleanup
/sig api-machinery
/cc @sttts
2018-07-20 12:12:15 -07:00
Kubernetes Submit Queue d2cc34fb07
Merge pull request #65771 from smarterclayton/untyped
Automatic merge from submit-queue (batch tested with PRs 65771, 65849). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a new conversion path to replace GenericConversionFunc

reflect.Call is very expensive. We currently use a switch block as part of AddGenericConversionFunc to avoid the bulk of top level a->b conversion for our primary types which is hand-written. Instead of having these be handwritten, we should generate them.

The pattern for generating them looks like:

```
scheme.AddConversionFunc(&v1.Type{}, &internal.Type{}, func(a, b interface{}, scope conversion.Scope) error {
  return Convert_v1_Type_to_internal_Type(a.(*v1.Type), b.(*internal.Type), scope)
})
```

which matches AddDefaultObjectFunc (which proved out the approach last year). The
conversion machinery should then do a simple map lookup based on the incoming types and invoke the function.  Like defaulting, it's up to the caller to match the types to arguments, which we do by generating this code.  This bypasses reflect.Call and in the future allows Golang mid-stack inlining to optimize this code.

As part of this change I strengthened registration of custom functions to be generated instead of hand registered, and also strengthened error checking of the generator when it sees a manual conversion to error out.  Since custom functions are automatically used by the generator, we don't really have a case for not registering the functions.

Once this is fully tested out, we can remove the reflection based path and the old registration methods, and all conversion will work from point to point methods (whether generated or custom).

Much of the need for the reflection path has been removed by changes to generation (to omit fields) and changes to Go (to make assigning equivalent structs easy).

```release-note
NONE
```
2018-07-19 09:29:00 -07:00
Patrice Peterson a20ff91c4c kubeadm: stop setting UID in the kubelet ConfigMap
Fixes #921.
2018-07-19 10:34:05 +02:00
Kubernetes Submit Queue 990b3d707c
Merge pull request #66282 from bart0sh/PR0022-kubeadm-require-crictl-only-for-CRI-runtime
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

check for crictl executable only for CRI runtime

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

crictl is not used for docker runtime, so InPathCheck check can be skipped for docker.

**Release note**:
```release-note
NONE
```
2018-07-18 10:01:53 -07:00
Clayton Coleman 90b5fbe876
generated: bazel 2018-07-17 23:02:16 -04:00
Clayton Coleman ef561ba8b5
generated: Avoid use of reflect.Call in conversion code paths 2018-07-17 23:02:16 -04:00
Mikhail Mazurskiy 5cab7f9a57
Handle errors 2018-07-17 20:47:14 +10:00
Kubernetes Submit Queue 53151500fb
Merge pull request #66212 from metadave/dp_kubeadm_upgrade_diff_todo
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kubeadm upgrade diff -config TODO

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

This PR addresses a TODO in `kubeadm upgrade diff` for the `-config` flag to use `options.AddConfigFlag()` instead of `cmd.Flags().StringVar()`.


**Which issue(s) this PR fixes** 

None

**Special notes for your reviewer**:

/sig kubernetes/sig-cluster-lifecycle-pr-reviews

**Release note**:
```release-note
NONE
```
2018-07-17 03:19:27 -07:00
Ed Bartosh 95eb821674 check for crictl executable only for CRI runtime
crictl is not used for docker runtime, so this check
can be skipped when using docker.
2018-07-17 12:51:21 +03:00
Ed Bartosh ad16fbc5a6 kubeadm: wrap runtime tests in a t.Run
Improved runtime tests by using T.Run API:
https://golang.org/pkg/testing/#T.Run

This should improve the test output and make it more visible
which test is doing what.
2018-07-17 11:34:02 +03:00
Kubernetes Submit Queue 0e097af8d8
Merge pull request #65952 from luxas/kubeadm_init_join_exclusive
Automatic merge from submit-queue (batch tested with PRs 63877, 64559, 65952). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Make the kubeadm config kinds mutually exclusive

**What this PR does / why we need it**:
Right now it would be possible to feed kubeadm with a YAML document with all the four different Config kinds kubeadm at HEAD supports, `MasterConfiguration`, `InitConfiguration`, `JoinConfiguration` and `NodeConfiguration`. This PR makes them mutually exclusive so that kubeadm can know how to handle the config file properly.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: kubernetes/kubeadm#911
Depends on:
 - [x] https://github.com/kubernetes/kubernetes/pull/65776
 - [x] https://github.com/kubernetes/kubernetes/pull/65628
 - [x] https://github.com/kubernetes/kubernetes/pull/65629
 - [x] https://github.com/kubernetes/kubernetes/pull/65631
 - [x] https://github.com/kubernetes/kubernetes/pull/65940
 - [x] https://github.com/kubernetes/kubernetes/pull/65787
 - [x] https://github.com/kubernetes/kubernetes/pull/65945
 - [x] https://github.com/kubernetes/kubernetes/pull/65951

**Special notes for your reviewer**:
Please only review the last commit

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
2018-07-16 17:00:09 -07:00
Kubernetes Submit Queue ac4715d6ac
Merge pull request #64611 from bart0sh/PR0017-kubeadm-create-Container-Runtime
Automatic merge from submit-queue (batch tested with PRs 65429, 64611). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move runtime details into ContainerRuntime

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

This PR moves all docker and CRI specifics into new ContainerRuntime
entity to isolate container runtime details from the rest of the code.

This should help to avoid having CRI and docker specific checks and code all over the place.

**NOTE: this is a not a finished work, but rather an RFC.**

Things to do:
- test manually in docker and cri-o environments

**Release note**:

```release-note
NONE
```
2018-07-16 14:17:02 -07:00
Ed Bartosh e0dd6cc3db add test cases for kubeadm/app/util/runtime
covered ContainerRuntime API with test cases
2018-07-16 12:20:10 +03:00
Ed Bartosh bfb08bbb7b move runtime details into ContainerRuntime
Created ContainerRuntime and used it in preflight checks,
'reset' and 'image' modules.
2018-07-16 12:20:04 +03:00
hangaoshuai c0cc3ee82f fixtodo: add unit test for function FetchConfigFromFileOrCluster 2018-07-16 09:53:17 +08:00
Kubernetes Submit Queue c861ceb41a
Merge pull request #66116 from chenyb4/kubeadm_check
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kubeadm checks import error

kubeadm checks package import path exist "kubernetes/test",
So change the import path.
* move "k8s.io/kubernetes/test/e2e_node/system" directory file
  tto "k8s.io/kubernetes/cmd/kubeadm/app/util/system" and change checks import
* remove "k8s.io/kubernetes/test/e2e_node/system" directory

Issues report link:
https://github.com/kubernetes/kubeadm/issues/976

Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>



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

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #https://github.com/kubernetes/kubeadm/issues/976

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-15 14:52:43 -07:00
Lucas Käldström 728b30b3f1 kubeadm: Make the kubeadm config kinds mutually exclusive 2018-07-15 12:59:58 +02:00
Dave Parfitt 107eaf1928 Fix kubeadm upgrade TODOs
Fix several TODO's related to using a generic flag registration method
for --config and --kubeconfig in kubeadm.
2018-07-14 16:32:37 -04:00
Kubernetes Submit Queue 49454a2635
Merge pull request #65576 from stewart-yu/stewart-kubelet-read#02
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[kubeadm]fix DynamicKubeletConfig feature to beta

**What this PR does / why we need it**:
As [PR](https://github.com/kubernetes/kubernetes/pull/64275) get merged,  DynamicKubeletConfig feature convert to  `beta` in v1.11, and set to `true` in default.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #[https://github.com/kubernetes/kubeadm/issues/957](https://github.com/kubernetes/kubeadm/issues/957)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-14 03:04:43 -07:00
Kubernetes Submit Queue af8a1dba68
Merge pull request #65951 from luxas/kubeadm_joinconfig
Automatic merge from submit-queue (batch tested with PRs 66138, 65951). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Rename `NodeConfiguration` to `JoinConfiguration` in the kubeadm v1alpha3 Config API

**What this PR does / why we need it**:
In v1alpha3, we have made the design decision that `NodeConfiguration` will be renamed `JoinConfiguration`. This PR implements that change. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: kubernetes/kubeadm#911
Depends on:
 - [x] https://github.com/kubernetes/kubernetes/pull/65776
 - [x] https://github.com/kubernetes/kubernetes/pull/65628
 - [x] https://github.com/kubernetes/kubernetes/pull/65629
 - [x] https://github.com/kubernetes/kubernetes/pull/65631
 - [x] https://github.com/kubernetes/kubernetes/pull/65940
 - [x] https://github.com/kubernetes/kubernetes/pull/65787
 - [ ] https://github.com/kubernetes/kubernetes/pull/65945

**Special notes for your reviewer**:

Please only review the last three commits here.

**Release note**:

```release-note
[action required] The `NodeConfiguration` kind in the kubeadm v1alpha2 API has been renamed `JoinConfiguration` in v1alpha3
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
2018-07-13 20:09:08 -07:00
Kubernetes Submit Queue bc25b1a708
Merge pull request #65676 from dkoshkin/kubeadm-version-timeout
Automatic merge from submit-queue (batch tested with PRs 66094, 65676). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a timeout when fetching latest version

**What this PR does / why we need it**:
When there is no internet on the node and `--kubernetes-versio`n is not specified running `kubeadm init` hangs forever with no text output.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubeadm/issues/986

**Special notes for your reviewer**:
Using the same duration as the existing timeout `externalEtcdRequestTimeout`

Sample output:
```
kubeadm init
unable to get URL "https://dl.k8s.io/release/stable-1.11.txt": Get https://dl.k8s.io/release/stable-1.11.txt: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
```

**Release note**:

```release-note
kubeadm: use an HTTP request timeout when fetching the latest version of Kubernetes from dl.k8s.io
```
2018-07-13 16:04:06 -07:00
fabriziopandini 21baef255b autogenerated 2018-07-13 23:06:34 +02:00
fabriziopandini 54b16cbd9e Rename NodeConfiguration to JoinConfiguration in v1alpha3, but support both names for this release of kubeadm 2018-07-13 23:06:17 +02:00
fabriziopandini a6b0410f83 Automated rename from NodeConfiguration to JoinConfiguration 2018-07-13 22:52:41 +02:00
Kubernetes Submit Queue c174e4121f
Merge pull request #65900 from bart0sh/PR0020-cri-socket-not-abspath
Automatic merge from submit-queue (batch tested with PRs 65899, 65900). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix CRI socket validatioin

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

CRI socket doesn't have to be an absolute path, it should be an url.
However, attempt to use it as an url in 'kubeadm init' command line
causes this validation error:

$ sudo ./kubeadm init --cri-socket unix:///var/run/crio/crio.sock
nodeRegistration.criSocket: Invalid value:
"unix:///var/run/crio/crio.sock": path is not absolute

Fixed by adding ValidateSocket function and using it in the 
ValidateNodeRegistrationOptions check instead of ValidateAbsolutePath.

**Which issue(s) this PR fixes** :

[#928](https://github.com/kubernetes/kubeadm/issues/928)

**Release note**:
```release-note
NONE
```
2018-07-13 10:10:05 -07:00
Yuanbin.Chen f2eee3fe2a Fix kubeadm checks import error
kubeadm checks package import path exist "kubernetes/test",
So change the import path.

  * move "k8s.io/kubernetes/test/e2e_node/system" directory file
    to "k8s.io/kubernetes/cmd/kubeadm/app/util/system"
  * change system package import path
  * remove "k8s.io/kubernetes/test/e2e_node/system" directory

Issues report link:
https://github.com/kubernetes/kubeadm/issues/976

Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-07-13 14:27:46 +08:00
Kubernetes Submit Queue 64eb015471
Merge pull request #66074 from rosti/print-default
Automatic merge from submit-queue (batch tested with PRs 66136, 64999, 65425, 66120, 66074). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Printable default component configs

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

This PR makes default component configs printable via `kubeadm config print-default`.
Component configs are not printed by default. You have to explicitly request
that for concrete API objects via the `--api-objects` command line parameter.
For a list of possible API objects use the help option.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Refs kubernetes/kubeadm#963

**Special notes for your reviewer**:
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @luxas
/assign @timothysc
/kind feature

**Release note**:

```release-note
kubeadm: Default component configs are printable via kubeadm config print-default
```
2018-07-12 15:14:23 -07:00
fabriziopandini f9000a3f8a kubeadm-ha-phases 2018-07-12 16:45:12 +02:00
Ed Bartosh 2c764c4b7f fix CRI socket validatioin
CRI socket doesn't have to be an absolute path, it should be an url.
However, attempt to use it as an url in 'kubeadm init' command line
causes this validation error:

$ sudo ./kubeadm init --cri-socket unix:///var/run/crio/crio.sock
nodeRegistration.criSocket: Invalid value:
"unix:///var/run/crio/crio.sock": path is not absolute

Fixed by adding ValidateSocket function and using it in the
ValidateNodeRegistrationOptions check instead of ValidateAbsolutePath.
2018-07-12 14:00:47 +03:00
Rostislav M. Georgiev a899760fef kubeadm: Printable default component configs
Make default component configs printable via `kubeadm config print-default`.
Component configs are not printed by default. You have to explicitly request
that for concrete API objects via the `--api-objects` command line parameter.
For a list of possible API objects use the help option.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-07-12 12:42:16 +03:00
Kubernetes Submit Queue 0972ce1acc
Merge pull request #65649 from rsc/fix-printf
Automatic merge from submit-queue (batch tested with PRs 66076, 65792, 65649). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubernetes: fix printf format errors

These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

```release-note
NONE
```
2018-07-11 14:09:08 -07:00
Bin Lu 773ab3ff70 use pause image with fat-manifest
Signed-off-by: Bin Lu <bin.lu@arm.com>
2018-07-11 11:00:44 +08:00
Russ Cox 2bd91dda64 kubernetes: fix printf format errors
These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

Lubomir I. Ivanov <neolit123@gmail.com>
applied ammend for:
  pkg/cloudprovider/provivers/vsphere/nodemanager.go
2018-07-11 00:10:15 +03:00
Lubomir I. Ivanov 8dcb980c6c kubeadm: run kube-proxy on non-master tainted nodes
kube-proxy should be able to run on all nodes, independent
on the taint of such nodes.

This restriction was previously removed in bb28449e31 but
then was brought back in d1949261ab.

Also, annotate with:
  scheduler.alpha.kubernetes.io/critical-pod: ""

and add a class in the template spec:
  priorityClassName: system-node-critical
2018-07-09 22:39:39 +03:00
dkoshkin 1c5b596b77 Add a timeout when fetching latest version 2018-07-09 07:24:38 -04:00
Lucas Käldström 23ac814999
autogenerated 2018-07-09 04:56:34 +03:00
Lucas Käldström c48dfa6fe9
Rename MasterConfiguration to InitConfiguration in v1alpha3, but support both names for this release of kubeadm 2018-07-09 04:55:45 +03:00
Lucas Käldström 52f0591ad9
Automated rename from MasterConfiguration to InitConfiguration 2018-07-09 04:55:02 +03:00
Lucas Käldström 0be8955466
autogenerated 2018-07-08 21:33:56 +03:00
Lucas Käldström 699949fc87
Update the kubeadm config API roundtrip yaml files 2018-07-08 21:33:28 +03:00
Lucas Käldström 17b3b28190
Update unit tests 2018-07-08 21:32:51 +03:00
Lucas Käldström 495ac9883d
Make kubeadm support {un,}marshalling ComponentConfig structs as different YAML documents 2018-07-08 21:32:28 +03:00
Lucas Käldström 5aef95ebe1
Remove the ComponentConfig structs from the external v1alpha3 API. Use the new componentconfigs pkg for validation and conversion 2018-07-08 21:31:35 +03:00
Lucas Käldström f96ada0c04
Add a new package for handling all ComponentConfig-related code 2018-07-08 21:27:53 +03:00
Lucas Käldström 5e6be9de77
autogenerated 2018-07-08 09:55:33 +03:00
Lucas Käldström 71eda34c01
Update the config API roundtrip tests 2018-07-08 09:50:34 +03:00
Lucas Käldström 3594d2ca39
Update unit tests 2018-07-08 09:50:10 +03:00
Lucas Käldström 35673da7c5
Start using the new path in the internal config for the ComponentConfig structs 2018-07-08 09:49:34 +03:00
Lucas Käldström 8004aad307
kubeadm: Embed the internal variants of the componentconfigs in the internal kubeadm API with conversions 2018-07-08 09:42:46 +03:00
Kubernetes Submit Queue d51bfcd4aa
Merge pull request #65920 from dims/pause-image-should-be-arch-agnostic
Automatic merge from submit-queue (batch tested with PRs 65946, 65904, 65913, 65906, 65920). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: pause image should be arch agnostic, as it is a manifest list

Signed-off-by: Davanum Srinivas <davanum@gmail.com>



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

`pause` image is backed by a manifest list. so we should not use the arch image when reporting using say `kubeadm config image list`

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubeadm/issues/962

**Special notes for your reviewer**:

**Release note**:

```release-note
kubeadm: Fix pause image to not use architecture, as it is a manifest list
```
2018-07-07 16:25:17 -07:00
Kubernetes Submit Queue 2d288a7da4
Merge pull request #65802 from xlgao-zju/improve-output
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[kubeadm] Print required flags when running kubeadm upgrade plan

**What this PR does / why we need it**:
print required flags when running kubeadm upgrade plan

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Close [kubernetes/kubeadm#935](https://github.com/kubernetes/kubeadm/issues/935)

**Special notes for your reviewer**:
/assign @chuckha 
/assign @neolit123 

**Release note**:

```release-note
kubeadm: print required flags when running kubeadm upgrade plan
```
2018-07-07 12:06:43 -07:00
Davanum Srinivas a6f86c6778
pause image should be arch agnostic
Change-Id: I4997ace30077335767bca402a8b98202c91b950b
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2018-07-06 15:18:43 -04:00
Xianglin Gao 00552765f2 add test case
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-07-07 00:48:27 +08:00
Kubernetes Submit Queue c5967fbb74
Merge pull request #64911 from bart0sh/PR0019-use-DefaultCRISocket-constant-in-reset
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: use constant instead of hardcoded path

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

Used DefaultCRISocket constant instead of hardcoded path
/var/run/dockershim.sock

**Release note**:
```release-note
NONE
```
2018-07-05 11:33:02 -07:00
Ed Bartosh 00fb7aada9 kubeadm: use constant instead of hardcoded path
Used DefaultCRISocket constant instead of hardcoded path
/var/run/dockershim.sock
2018-07-05 17:55:12 +03:00
Lucas Käldström 71f63dcc3a
autogenerated 2018-07-05 16:07:08 +03:00
Lucas Käldström 8b27e07c17
Refactor a bit of the config YAML loading code, and support loading multiple YAML documents 2018-07-05 16:00:37 +03:00
Nikhita Raghunath e05f2909dc
kubeadm: update generated files 2018-07-05 11:35:41 +05:30
Kubernetes Submit Queue 7d12718292
Merge pull request #65827 from xlgao-zju/rm-PersistentVolumeLabel
Automatic merge from submit-queue (batch tested with PRs 64593, 65117, 65629, 65827, 65686). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[kubeadm] Remove usage of `PersistentVolumeLabel` in phases/controlplane/manifests*.go

**What this PR does / why we need it**:
Remove usage of `PersistentVolumeLabel` in phases/controlplane/manifests*.go

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Close [kubernetes/kubeadm#866](https://github.com/kubernetes/kubeadm/issues/866)

**Special notes for your reviewer**:
/assign @neolit123 

**Release note**:

```release-note
kubeadm: Remove usage of `PersistentVolumeLabel`
```
2018-07-04 18:52:17 -07:00
Xianglin Gao 69350b6409 rm PersistentVolumeLabel
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-07-04 23:18:11 +08:00
Lucas Käldström 7e488e7c07
autogenerated 2018-07-04 14:08:02 +03:00
Lucas Käldström c9b52ede7e
Automated bump from v1alpha2 references to v1alpha3 2018-07-04 14:07:53 +03:00
Lucas Käldström 27d70411a9
Register the v1alpha3 API in the scheme, and update the roundtrip API tests 2018-07-04 14:07:38 +03:00
Lucas Käldström e5c0360773
Add a duplicated v1alpha3 API 2018-07-04 14:05:43 +03:00
Lucas Käldström dea6f7e2a7
Remove the v1alpha1 API folder 2018-07-04 10:46:32 +03:00
Xianglin Gao d9a5a04fa3 print required flags when running kubeadm upgrade plan
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-07-04 14:21:50 +08:00
stewart-yu 37fdd1d4c5 fix DynamicKubeletConfig feature to beta 2018-07-04 08:52:27 +08:00
Lucas Käldström 5d3b75530f
autogenerated 2018-07-04 00:09:19 +03:00
Lucas Käldström 00fccedf92
Update the roundtrip API tests to not use the v1alpha1 API 2018-07-03 21:28:10 +03:00
Lucas Käldström f0970b6d64
Stop using/supporting the kubeadm v1alpha1 API 2018-07-03 21:27:33 +03:00
Rostislav M. Georgiev 5cafed260c kubeadm: Fix CoreDNS image generation bug
With #64976 GetGenericArchImage was used for generating the CoreDNS image path.

This generated incorrect image in the form `prefix/coredns-goarch:tag` instead
of just `prefix/coredns:tag`.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-07-03 15:54:25 +03:00
Kubernetes Submit Queue af32b1c21d
Merge pull request #64976 from rosti/getetcdimage
Automatic merge from submit-queue (batch tested with PRs 65648, 65700, 64976, 65692, 65667). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Replace GetCoreImage with less error prone functions

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

GetCoreImage is a too generic function, that takes too many arguments. This
makes it prone to errors that may be difficult to trace. The solution is to
split it into the following couple of functions with a more targeted interface:

- GetKubeControlPlaneImage used to fetch Kubernetes control plane images or the
unified control plane image (if one is specified).

- GetEtcdImage is used to fetch the etcd image.

In addition to these, a couple of new utility functions are also created:

- GetKubeControlPlaneImageNoOverride used like GetKubeControlPlaneImage but
does not return the unified control plane image (even if it is set).

- GetGenericArchImage returns image path in the form of "prefix/image-goarch:tag"

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#800

**Special notes for your reviewer**:
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @luxas
/assign @timothysc
/cc @chuckha 
/kind enhancement

**Release note**:

```release-note
NONE
```
2018-07-02 19:46:16 -07:00
Kubernetes Submit Queue 7786bd8c9a
Merge pull request #64654 from atlassian/missing-error-handling
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add missing error handling in schema-related code

**What this PR does / why we need it**:
Adds missing error handling to a few places.

**Which issue(s) this PR fixes**
Updates #51457. Still more work to do to fix the issue - client generation code needs to be updated (addressed in https://github.com/kubernetes/kubernetes/pull/64664).

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

/kind bug
/sig api-machinery
2018-07-02 07:14:34 -07:00
Rostislav M. Georgiev e4f8938c58 kubeadm: Replace GetCoreImage with less error prone functions
GetCoreImage is a too generic function, that takes too many arguments. This
makes it prone to errors that may be difficult to trace. The solution is to
split it into the following couple of functions with a more targeted interface:

- GetKubeControlPlaneImage used to fetch Kubernetes control plane images or the
unified control plane image (if one is specified).

- GetEtcdImage is used to fetch the etcd image.

In addition to these, a couple of new utility functions are also created:

- GetKubeControlPlaneImageNoOverride used like GetKubeControlPlaneImage but
does not return the unified control plane image (even if it is set).

- GetGenericArchImage returns image path in the form of "prefix/image-goarch:tag"

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-07-02 17:14:21 +03:00
Di Xu b3242c4be6 kubeadm: remove redundant flags settings for kubelet 2018-07-01 21:42:43 +08:00
Kubernetes Submit Queue 4ebebfc482
Merge pull request #65402 from hanxiaoshuai/fix0623
Automatic merge from submit-queue (batch tested with PRs 65349, 65354, 65402). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Get rid of depends on kubectl in kubeadm

**What this PR does / why we need it**:
Get rif of depends on kubectl in kubeadm
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-30 10:50:08 -07:00
Kubernetes Submit Queue e8f35c02a9
Merge pull request #65354 from hanxiaoshuai/fix06222
Automatic merge from submit-queue (batch tested with PRs 65349, 65354, 65402). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fixtodo: Move these kubelet start/stop functions to phases/kubelet

**What this PR does / why we need it**:
fixtodo: Move these kubelet start/stop functions to phases/kubelet
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-30 10:50:05 -07:00
Kubernetes Submit Queue d70b8f5062
Merge pull request #65349 from hanxiaoshuai/fix0622
Automatic merge from submit-queue (batch tested with PRs 65349, 65354, 65402). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

check error when failed to prepull the images

**Special notes for your reviewer**:
return error when failed to prepull the images
**Release note**:

```release-note
NONE
```
2018-06-30 10:50:01 -07:00
hangaoshuai bf5b63350e Get rid of depends on kubectl in kubeadm 2018-06-30 17:26:10 +08:00
Dr. Stefan Schimanski f8de7cea40 Update generated files 2018-06-29 20:36:17 +02:00
Sandeep Rajan 8798640f21 add scrape port to service 2018-06-28 13:26:11 -04:00
Kubernetes Submit Queue db80cdf37f
Merge pull request #65164 from xlgao-zju/add-log-for-timeout
Automatic merge from submit-queue (batch tested with PRs 65164, 65258). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add output to give user awareness of how long timeouts are expected to be

**What this PR does / why we need it**:
Add output to give user awareness of how long manifest upgrade timeout is expected to be.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref [kubernetes/kubeadm/#914](https://github.com/kubernetes/kubeadm/issues/914)

**Special notes for your reviewer**:

**Release note**:

```release-note
kubeadm: notify the user of manifest upgrade timeouts
```
2018-06-25 14:44:04 -07:00
Xianglin Gao b309ace793 kubeadm-upgrade: notify the user of manifest upgrade timeouts
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
2018-06-26 00:03:00 +08:00
Mikhail Mazurskiy bfe313d5f3
Add missing error handling in schema-related code 2018-06-23 21:06:32 +10:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
hangaoshuai 95797f13ca fixtodo: Move these kubelet start/stop functions to phases/kubelet 2018-06-22 15:20:18 +08:00
hangaoshuai f8480f3948 return error when failed to prepull the images 2018-06-22 11:41:33 +08:00
Kubernetes Submit Queue 96c7f3a34a
Merge pull request #64752 from wojtek-t/default_to_watching_managers
Automatic merge from submit-queue (batch tested with PRs 65187, 65206, 65223, 64752, 65238). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubelet watches necessary secrets/configmaps instead of periodic polling
2018-06-21 19:48:14 -07:00
Kubernetes Submit Queue 265b9ef209
Merge pull request #65123 from tengqm/kubeadm-doc-typo-1
Automatic merge from submit-queue (batch tested with PRs 65123, 65176, 65139, 65084, 65056). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix a typo in kubeadm generated doc

Fix a typo in kubeadm comment that leads to confusing docs generated.

```release-note
None
```
2018-06-21 16:56:07 -07:00
Kubernetes Submit Queue 6300d58054
Merge pull request #64822 from hanxiaoshuai/fix0606
Automatic merge from submit-queue (batch tested with PRs 65265, 64822, 65026, 65019, 65077). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix some small mistakes in kubeadm

**What this PR does / why we need it**:
fix some small mistakes in kubeadm
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-21 11:25:10 -07:00
Kubernetes Submit Queue 218b334d26
Merge pull request #65031 from detiber/etcd_grpc_gateway
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubadm - add comment for etcd server cert clientauth usage workaround

Adds TODO requested in https://github.com/kubernetes/kubernetes/pull/65020#discussion_r194801712

**Release note**:
```release-note
NONE
```
2018-06-21 07:11:30 -07:00
Kubernetes Submit Queue d1f5cb2348
Merge pull request #65050 from sttts/sttts-deepcopy-update
Automatic merge from submit-queue (batch tested with PRs 64895, 64938, 63700, 65050, 64957). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump gengo to include uniform pointer deepcopy

This bumps k8s.io/gengo with uniform pointer support in deepcopy-gen.

Fixes https://github.com/kubernetes/code-generator/issues/45.
2018-06-21 04:15:16 -07:00
hangaoshuai 6ba9ae30ca fix some small mistakes in kubeadm 2018-06-21 09:56:36 +08:00
Kubernetes Submit Queue 051ed101a1
Merge pull request #64850 from carldanley/improve-kubeadm-reset-logging
Automatic merge from submit-queue (batch tested with PRs 65254, 64837, 64782, 64555, 64850). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve kubeadm reset output

**What this PR does / why we need it**: Improves logging when using `kubeadm reset` + external etcd
**Which issue(s) this PR fixes**: Fixes https://github.com/kubernetes/kubeadm/issues/859
2018-06-20 11:28:21 -07:00
wojtekt ffb32472bb Kubelet manager configuration 2018-06-19 22:12:55 +02:00
Lucas Käldström e2ca0f7cce
Fix kubeadm unit tests relying on internet access 2018-06-19 20:34:45 +03:00
Di Xu 988243cb83
use the release-1.11 branch by default 2018-06-19 20:13:16 +03:00
Kubernetes Submit Queue b005f2fba3
Merge pull request #65195 from luxas/kubeadm_fix_cloudprovider_upgrade
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Fix a small config upgrading issue with .CloudProvider

**What this PR does / why we need it**:
Fixes a panic in the conversion code where `.NodeRegistration.KubeletExtraArgs` could be nil :/

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
/kind bug
/priority critical-urgent
/milestone v1.11
/status approved-for-milestone
2018-06-18 17:20:27 -07:00
Lucas Käldström bdcf5859d7
kubeadm: Fix a small config upgrading issue with .CloudProvider 2018-06-18 21:49:35 +03:00
Lucas Käldström d68eea584f
kubeadm: Fix a bug where skipping all preflight checks wouldn't activate the kubelet 2018-06-18 20:23:52 +03:00
Kubernetes Submit Queue 6d3f5b75f5
Merge pull request #65162 from chuckha/coredns
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use kubernetes image repo for coredns

Fixes #927

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
**What this PR does / why we need it**:
use the coredns image from the k8s image repository when building a cluster with kubeadm

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#927

```release-note
NONE
```

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews 
/assign @luxas
2018-06-17 20:43:30 -07:00
Lucas Käldström df477a960f
kubeadm: Make the environment file writing happen on upgrade as well 2018-06-16 23:45:26 +03:00
Chuck Ha 91bfed2802
Use kubernetes image repo for coredns
Fixes #927

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-06-15 23:47:07 -04:00
Kubernetes Submit Queue 410941b40c
Merge pull request #65151 from luxas/kubeadm_dryrun_bugs
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kubeadm init/upgrade --dry-run mode

**What this PR does / why we need it**:
Split out from https://github.com/kubernetes/kubernetes/pull/65104.
Fixes `kubeadm init --dry-run` and `kubeadm upgrade apply [version] --dry-run`

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
2018-06-15 16:05:16 -07:00
Kubernetes Submit Queue 9a4263de75
Merge pull request #65068 from ashleyschuett/fix/nodetaints
Automatic merge from submit-queue (batch tested with PRs 64796, 65068). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kubeadm taints to not override existing node taints

**What this PR does / why we need it**:
If a node has existing taints they are being replaced with taints from the kubeadm config. 

An example of this is that the `uninitialized` taint that kubelet sets for external cloud provider is being removed, and replaces with the master taint if set, or removed leaving the nodes taints empty if `noTaintMaster=true` . 

```release-note
None
```
2018-06-15 14:42:10 -07:00
Lucas Käldström f2dec305ad
Fix kubeadm init/upgrade --dry-run mode 2018-06-15 23:03:24 +03:00
tengqm e41629ce7f Fix a typo in kubeadm genearted doc 2018-06-15 01:33:30 +00:00
Kubernetes Submit Queue a2de1398f8
Merge pull request #65034 from caesarxuchao/json-case-sensitive
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make kubernetes json serializer case sensitive

This PR imported the latest jsoniterator library so that case sensitivity during unmarhsaling is optional. The PR also set Kubernetes json serializer to be case sensitive.

Kubernetes json serializer had been case sensitive for 1.1-1.7 as we were using ugorji. This PR restores the behavior.

Fix #64612.

```release-notes
Kubernetes json deserializer is now case-sensitive as it was before 1.8.
If your config files contains fields with wrong case, the config files will be now invalid.
```
2018-06-14 15:41:26 -07:00
Chao Xu 72a0dc1122 fix schema for kubeproxyconfig/v1alph1 2018-06-14 12:52:17 -07:00
Chao Xu 7b0ffb8410 make json serializer case sensitive 2018-06-14 12:29:27 -07:00
Ashley 35615881e3
Update tests to reflect that kubeadm taints should not override node taints 2018-06-14 12:27:14 -04:00
Ashley 792195eaa5
Fix kubeadm taints to not override existing node taints 2018-06-13 16:19:20 -04:00
Dr. Stefan Schimanski 1208437f84 Update generated files 2018-06-13 12:35:13 +02:00
Jason DeTiberus b6450c75e7
kubadm - add comment for etcd server cert clientauth usage workaround 2018-06-12 16:31:44 -04:00
Kubernetes Submit Queue 52866471b1
Merge pull request #64974 from luxas/kubeadm_v111_bugs
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Fix small-ish bugs for v1.11

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

Fixes a bunch of bugs I noticed when I was reading the source code:
 - `--cloud-provider` should also be propagated to the kubelet when converting configs from v1alpha1 to v1alpha2
 - The validation for `.NodeRegistration.Name` is practically non-existent, just verifies the name isn't in upper case. Instead we currently do that validation in preflight checks, which is in the totally wrong place.
 - Now that we pull images in preflight checks, the timeout for the kubelet to start the Static Pods should be kinda short, as it doesn't depend on internet connection
 - I think the shorthand for `kubeadm reset --force` ought to be `-f`
 - The common flags between `upgrade apply` and `upgrade plan` were registered as global flags for the `upgrade` command, although they make no sense for `upgrade diff` and/or `upgrade node config`. Hence, I moved them to be locally registered.
 - Just because we vendor `glog` we have a lot of unnecessary/annoying flags registered in glog's `init()` function. Let's hide these properly.
 - I saw that `kubeadm upgrade apply` doesn't write down the new kubelet config that should be used, now that is the case. Also, the CRISocket annotation information is now preserved properly on upgrade (and is configurable using the `--cri-socket` flag)
 - If `kubeadm join` is run against a v1.10 cluster without the `kubelet-config-1.10` configmap,  it shouldn't fail.

What I will still investigate:
 - `kubeadm token create` should have a flag called `--ttl`, not `--token-ttl` as it is now (this snuck in in this dev cycle)
 - That `--dry-run` works properly for `upgrade`, end to end.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
2018-06-12 12:49:42 -07:00
Kubernetes Submit Queue 588e088799
Merge pull request #65020 from detiber/etcd_grpc_gateway
Automatic merge from submit-queue (batch tested with PRs 64862, 65020). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm - fix local etcd grpc gateway

**What this PR does / why we need it**:
etcd 3.2 uses the server certificate as the client cert for the grpc
gateway, this updates the generation of the etcd server certificate to
add client usage to resolve the issue.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubeadm/issues/910

**Release note**:
```release-note
NONE
```
2018-06-12 11:24:12 -07:00
Lucas Käldström f126f78266
autogenerated 2018-06-12 19:00:15 +03:00
Lucas Käldström 5d96a719fb
kubeadm: Fix a couple of small-ish bugs for v1.11 2018-06-12 18:59:34 +03:00
Jason DeTiberus b8e8e35333
kubeadm - fix local etcd grpc gateway
- etcd 3.2 uses the server certificate as the client cert for the grpc
  gateway, this updates the generation of the etcd server certificate to
  add client usage to resolve the issue.
2018-06-12 11:24:29 -04:00
Kubernetes Submit Queue 7f00fe4c3b
Merge pull request #64988 from detiber/setPeerURLs
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm - set peer urls for default etcd instance

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

Override the default peer URLs for the default etcd instance. Previously we left the defaults, which meant the peer URL was unsecured previously.

**Release note**:
```release-note
kubeadm - Ensure the peer port is secured by explicitly setting the peer URLs for the default etcd instance.
kubeadm - Ensure that the etcd certificates are generated using a proper CN
kubeadm - Update generated etcd peer certificate to include localhost addresses for the default configuration.
kubeadm - Increase the manifest update timeout to make upgrades a bit more reliable.
```
2018-06-12 08:10:11 -07:00
Jason DeTiberus 793a51cef0
kubeadm - local etcd configuration bugfixes
- Set peer urls for default etcd instance to avoid leaving peer port unsecured
- Update generated etcd peer certificate SANs to include localhost
- Use a proper CN for etcd server and peer certificates
- Increase the manifest update timeout
2018-06-11 21:29:11 -04:00
fabriziopandini d9506299ac fix-kubeadm-pull-log 2018-06-11 16:07:30 +02:00
Kubernetes Submit Queue bedb27e130
Merge pull request #64889 from dims/ensure-directory-is-created-for-kubelet-configuration
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ensure directory is created for kubelet configuration

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

Ensure directory is present before writing the config file.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-07 19:07:33 -07:00
Kubernetes Submit Queue 5825837a85
Merge pull request #64885 from chuckha/kubeadm-migrate-config
Automatic merge from submit-queue (batch tested with PRs 64881, 64885). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix output of `kubeadm migrate config`

The output should always be valid kubeadmapi.MasterConfiguration YAML.

The general problem was that we printed with fmt.Fprintf but it turns out some of the default values have `%`s in them so this caused Go to think we were missing values that we wanted substituted. We don't want to do any substitution here.

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
**What this PR does / why we need it**:
This PR fixes a small bug that cause kubeadm migrate config to print YAML that was not valid.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#904

```release-note
NONE
```

/cc @luxas @timothysc
2018-06-07 14:57:10 -07:00
Kubernetes Submit Queue 16921ae7a8
Merge pull request #64881 from chuckha/ci-cross
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use repo prefix when generating image names

CI defines its own custom repository. The function responsible
for listing all images now takes this into account.

Closes kubernetes/kubeadm#901

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>

**What this PR does / why we need it**:
This fixes ci-cross.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#901

**Special notes for your reviewer**:

```release-note
NONE
```
2018-06-07 13:44:54 -07:00
Davanum Srinivas 2072dc3ce8
Ensure directory is created for kubelet configuration 2018-06-07 15:39:40 -04:00
Chuck Ha 1235adac38
Fix output of `kubeadm migrate config`
The output should always be valid kubeadmapi.MasterConfiguration YAML.

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-06-07 15:03:11 -04:00
Chuck Ha 6cad0100ad
Use repo prefix when generating image names
CI defines its own custom repository. The function responsible
for listing all images now takes this into account.

Closes kubernetes/kubeadm#901

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-06-07 12:39:55 -04:00
carldanley 0bfcb5cb66 Improve kubeadm reset output
Let the operator know they should reset etcd manually when an external
etcd was used
2018-06-07 10:18:38 -04:00
Kubernetes Submit Queue 34f20d01b0
Merge pull request #64696 from dixudx/kubeadm_proxy_arch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: only run kube-proxy on architecture consistent nodes

**What this PR does / why we need it**:
Currently `gcr.io/google_containers/kube-proxy-{.Arch}` is not multi-arch image. We should use `affinity` or `nodeSelector` to only run the pods on the nodes with the matching architecture, like what we've done in `kube-dns`. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
partial Fixes #64647

**Special notes for your reviewer**:
/cc luxas timothysc 
**Release note**:

```release-note
kubeadm: only run kube-proxy on architecture consistent nodes
```
2018-06-06 21:35:10 -07:00
Lucas Käldström 7a87cf1c28
autogenerated 2018-06-06 23:41:10 +03:00
Lucas Käldström 1a0de9442e
Add a 'kubeadm upgrade node config' command and finish up the kubelet integration work 2018-06-06 23:17:04 +03:00
Rostislav M. Georgiev 19d2bbbc98 kubeadm: Don't match DNS versions to K8s versions
Some code in kubeadm was designed with the intent, that in the future CoreDNS
and kube-dns versions will match to specific K8s versions. This code is not
functional, since it does not perform any version matching. As of this moment,
no version matching is planned and a lot of boilerplate code is left useless.
The solution is simple - remove the unneeded parts to simplify the flow.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-06-06 12:12:50 +03:00
Kubernetes Submit Queue 7d782400db
Merge pull request #64792 from luxas/patch_node_crisocket
Automatic merge from submit-queue (batch tested with PRs 63717, 64646, 64792, 64784, 64800). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Upload CRISocket information in kubeadm init/join

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

As a side-effect, `kubeadm join` will become blocking on the kubelet doing the TLS bootstrap. This partially also fixes problems when users run `kubeadm join` and it returns successfully without anything happening as the kubelet is actually unhealthy. If that happens now `kubeadm join` will exit with a non-zero code.

What this PR does is it uploads the CRISocket information to the Node API object as a workaround until we have something like https://github.com/kubernetes/kubernetes/issues/64460 in place that will solve this problem for real. This way we won't lose the CRISocket information which we would otherwise do.
This can be used for `kubeadm upgrade` or `kubeadm reset` in future releases.

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

**Special notes for your reviewer**:
Depends on https://github.com/kubernetes/kubernetes/pull/64624

**Release note**:

```release-note
[action required] TODO
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
2018-06-06 01:24:17 -07:00
Kubernetes Submit Queue d3a797a053
Merge pull request #64670 from stealthybox/feature/kubeadm_882-etcd-zero-probe
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: When etcd is listening on all interfaces, set the etcd probe to use loopback

**What this PR does / why we need it**:
When constructing the etcd liveness probe, if the user passes an IPv4 or IPv6 address,
we set the `etcdctl` liveness probe to use the respective IPv4 or IPv6 loopback address for `--endpoints`.

The etcd probe is now always formatted with the https:// protocol and square brackets around the IP (required for IPv6 / compatible with IPv4).

`::1` is now also included in the etcd serving cert SAN by default.

/kind bug
/area kubeadm
/area etcd
/priority important-soon

/sig cluster-lifecycle
/assign @fabriziopandini

**Which issue(s) this PR fixes**
Fixes https://github.com/kubernetes/kubeadm/issues/882

**Special notes for your reviewer**:
```bash
root@vagrant:~# /vagrant/bin/882_kubeadm init --config /dev/stdin << EOF |& tail -n5
etcd:
  extraArgs:
    listen-client-urls: https://[::]:2379
EOF
I0603 19:52:15.666594   24743 tlsbootstrap.go:50] [bootstraptoken] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
I0603 19:52:15.671424   24743 tlsbootstrap.go:72] [bootstraptoken] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
I0603 19:52:15.674607   24743 tlsbootstrap.go:95] [bootstraptoken] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
I0603 19:52:15.677551   24743 clusterinfo.go:43] [bootstraptoken] creating the "cluster-info" ConfigMap in the "kube-public" namespace
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy
root@vagrant:~# cat /etc/kubernetes/manifests/etcd.yaml |grep -C4 listen
spec:
  containers:
  - command:
    - etcd
    - --listen-client-urls=https://[::]:2379
    - --advertise-client-urls=https://127.0.0.1:2379
    - --cert-file=/etc/kubernetes/pki/etcd/server.crt
    - --client-cert-auth=true
    - --data-dir=/var/lib/etcd
root@vagrant:~# cat /etc/kubernetes/manifests/etcd.yaml |grep -C4 etcdctl
      exec:
        command:
        - /bin/sh
        - -ec
        - ETCDCTL_API=3 etcdctl --endpoints=https://[::1]:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt
          --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt --key=/etc/kubernetes/pki/etcd/healthcheck-client.key
          get foo
      failureThreshold: 8
      initialDelaySeconds: 15
```

**Release note**:
```release-note
kubeadm now configures the etcd liveness probe correctly when etcd is listening on all interfaces
```
2018-06-05 23:22:48 -07:00
leigh schrandt 76c04b9b13 kubeadm: When etcd is listening on all interfaces, set the etcd probe to use loopback
Fixes https://github.com/kubernetes/kubeadm/issues/882
2018-06-05 18:33:56 -06:00
Kubernetes Submit Queue c46e8a9248
Merge pull request #64706 from liztio/kubeadm-hostname-override
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Let the `--node-name` flag flow down to `--hostname-override` for the kubelet

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

Kubeadm-initialised kubelet uses provided hostname if present

If --node-name is passed in to `kubeadm init`, `--hostname-override` will be
passed to kubelet. This prevents timeout errors for `kubeadm init`.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#846

**Special notes for your reviewer**:
Depends on #64624 to work fully, but can safely merged before hand.

**Release note**:

```release-note
[action required] The `--node-name` flag for kubeadm now dictates the Node API object name the
kubelet uses for registration, in all cases but where you might use an in-tree cloud provider.
If you're not using an in-tree cloud provider, `--node-name` will set the Node API object name.
If you're using an in-tree cloud provider, you MUST make `--node-name` match the name the
in-tree cloud provider decides to use.
```
2018-06-05 16:26:59 -07:00
Lucas Käldström 0cb6f0f0fc
autogenerated 2018-06-06 01:31:20 +03:00
Lucas Käldström 041858232c
kubeadm: Upload CRISocket information and hence make kubeadm join blocking 2018-06-06 01:05:49 +03:00
Kubernetes Submit Queue c8cecdea2f
Merge pull request #64775 from rajansandeep/imgcoredns
Automatic merge from submit-queue (batch tested with PRs 63322, 64718, 64708, 64775, 64777). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

CoreDNS to use gcr.io repo 

**What this PR does / why we need it**:
Switch CoreDNS to use the gcr.io in kubeadm

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

**Special notes for your reviewer**:

**Release note**:

```release-note
CoreDNS deployment configuration now uses k8s.gcr.io imageRepository
```
2018-06-05 14:31:15 -07:00
Kubernetes Submit Queue 11f00d1794
Merge pull request #64708 from chuckha/v1alpha1-fix
Automatic merge from submit-queue (batch tested with PRs 63322, 64718, 64708, 64775, 64777). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix kubeadm for v1alpha1 configs

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>

**What this PR does / why we need it**:
This PR allows v1alpha1 configurations to still work when running `kubeadm init`.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#884

**Special notes for your reviewer**:

```release-note
NONE
```
2018-06-05 14:31:12 -07:00
Kubernetes Submit Queue 148458a6df
Merge pull request #64718 from liztio/kubeadm-downcase-fqdn
Automatic merge from submit-queue (batch tested with PRs 63322, 64718, 64708, 64775, 64777). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm lowercases all domain names passed as additional SANs

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

Some domains, like ELBs, output a domain name with uppercase letters. To
accept these, we lowercase all arguments passed to ----apiserver-cert-extra-sans

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #[kubeadm/827](https://github.com/kubernetes/kubeadm/issues/827)

```release-note
NONE
```
2018-06-05 14:31:09 -07:00