Commit Graph

503 Commits (750881c0ab62a9f59d53582bc33826caa167aa83)

Author SHA1 Message Date
k8s-ci-robot b47510c1bb
Merge pull request #69886 from bart0sh/PR0030-kubeadm-fix-1054-upgrade-same-version
kubeadm: skip upgrade if manifest is not changed
2018-10-19 14:52:46 -07:00
Ed Bartosh ebb0af9e8f kubeadm: sort pod Volumes and VolumeMounts
Order of Volumes and VolumeMounts in the pod objects created by
kubeadm is undefined as they're represended as maps in the
controlPlaneHostPathMounts struct.

This influences 'kubeadm upgrade' logic in a way that even when
manifest of the component is not changed kubeadm tries to upgrade
it because most of the time current and new pods are not equal
due to the different order of Volumes and VolumeMounts.

For example 'kubeadm apply diff' almost always shows difference
in Volumes and VolumeMounts because of this:
     volumeMounts:
+    - mountPath: /etc/kubernetes/pki
+      name: k8s-certs
+      readOnly: true
     - mountPath: /etc/ssl/certs
       name: ca-certs
+      readOnly: true
+    - mountPath: /etc/pki
+      name: etc-pki
+      readOnly: true
+    - mountPath: /usr/share/ca-certificates
+      name: usr-share-ca-certificates
       readOnly: true
     - mountPath: /etc/ca-certificates
       name: etc-ca-certificates
       readOnly: true
-    - mountPath: /etc/pki
-      name: etc-pki
-      readOnly: true
-    - mountPath: /etc/kubernetes/pki
-      name: k8s-certs
-      readOnly: true
-    - mountPath: /usr/share/ca-certificates
-      name: usr-share-ca-certificates
-      readOnly: true

Sorting Volumes and VolumeMounts should fix this issue and help
to avoid unnecessary upgrades.
2018-10-19 18:22:47 +03:00
Ed Bartosh ad0179897d kubeadm: skip upgrade if manifest is not changed
When doing upgrades kubeadm generates new manifest and
waits until kubelet restarts correspondent pod.

However, kubelet won't restart pod if there are no changes
in the manifest. That makes kubeadm stuck waiting for
restarted pod.

Skipping upgrade if new component manifest is the same as
current manifest should solve this.

Fixes: kubernetes/kubeadm#1054
2018-10-17 11:07:51 +03:00
k8s-ci-robot 1e4ad048fa
Merge pull request #67763 from rosti/join-discovery-split
kubeadm: Split discovery from JoinConfiguration
2018-10-16 19:25:47 -07:00
Rostislav M. Georgiev 576b8d3f4f kubeadm: Split discovery from JoinConfiguration
This change splits out discovery fields from JoinConfiguration by performing
the following changes:

- Introduce a BootstrapTokenDiscovery structure, that houses configuration
  options needed for bootstrap token based discovery.

- Introduce a FileDiscovery structure, that houses configuration options
  (currently only a single option) needed for KubeConfig based discovery.

- Introduce a Discovery structure, that houses common options (such as
  discovery timeout and TLS bootstrap token) as well as pointer to an instance
  of either BootstrapTokenDiscovery or FileDiscovery structures.

- Replace the old discovery related JoinConfiguration members with a single
  Discovery member.

This change is required in order to cleanup the code of unnecessary logic and
make the serialized JoinConfiguration more structured (and therefore, more
intuitive).

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-10-16 15:25:32 +03:00
xichengliudui 0dba66a2a1 Delete repeated words and fix misspellings
Delete repeated words and fix misspellings
2018-10-16 01:05:05 -04:00
k8s-ci-robot 2f8b585d9c
Merge pull request #69330 from vaikas-google/json-patch
Add support for JSON patch in fake client
2018-10-15 15:04:32 -07:00
k8s-ci-robot 8f620950e2
Merge pull request #69614 from mitar/patch-1
Adding more kernel config paths
2018-10-11 03:36:22 -07:00
Ville Aikas a363b15385 Add support for JSON patch in fake client 2018-10-11 08:13:50 +00:00
k8s-ci-robot 77742ea94c
Merge pull request #69301 from neolit123/kubeadm-version-stable
kubeadm: handle stable-1 as the default version
2018-10-10 12:01:18 -07:00
Mitar 3f8ef7c6f8
Adding more kernel config paths 2018-10-10 00:37:14 -07:00
RA489 8729cade98 util/config` packages; filenames and methods should be updated to use new names 2018-10-08 14:12:17 +05:30
Christoph Blecker 97b2992dc1
Update gofmt for go1.11 2018-10-05 12:59:38 -07:00
Rostislav M. Georgiev f0d82fb5f4 kubeadm: Allow mixing Init and Join Configurations
This change allows mixing InitConfiguration/ClusterConfiguration with
JoinConfiguration in a single YAML file, by performing the following changes:

- Replace the explicit error in `DetectUnsupportedVersion` with a warning.
- Modify `NodeConfigFileAndDefaultsToInternalConfig` to use only
  `JoinConfiguration`.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-10-05 10:46:23 +03:00
Lubomir I. Ivanov 505413581e kubeadm: handle stable-1 as the default version
The default version in kubeadm is now `stable-1`. This will
pull a version from the `stable-1.txt` endpoint which might
end up being newer than the version of the client by a magnitude
of MINOR or even a MAJOR release.

To be able to prevent this scenario add the new helper function:
validateStableVersion()

This function determines if the remote version is newer than the
local client version and if that's the case it returns `stable-X.xx`
that conforms with the version of the client. If not it returns
the remote version.
2018-10-05 00:02:57 +03:00
fabriziopandini b4092acdb6 autogenerated 2018-10-04 13:20:20 +02:00
fabriziopandini 9aec633c40 Fix tests 2018-10-04 13:20:11 +02:00
fabriziopandini 488ac6825b Automated bump from v1alpha3 references to v1beta1 2018-10-04 12:03:38 +02:00
Yu Liao fc21115c3f Moved staging/src/k8s.io/client-go/tools/bootstrap to staging/src/k8s.io/cluster-bootstrap 2018-10-02 09:46:13 -07:00
RA489 824ed161d5 Rename the constant that refers to the `kubeadm-config` ConfigMap 2018-10-01 15:50:04 +05:30
k8s-ci-robot 587914c29d
Merge pull request #69055 from fabriziopandini/kubeadm-remove-v1alpha2
Kubeadm remove v1alpha2 api
2018-09-27 12:21:26 -07:00
k8s-ci-robot 3fe21e5433
Merge pull request #68922 from BenTheElder/version-staging
move pkg/util/version to staging
2018-09-26 22:59:42 -07:00
k8s-ci-robot e9fe3f77e9
Merge pull request #68890 from andrewrynhard/dnspolicy
kubeadm: Create control plane with ClusterFirstWithHostNet dns policy
2018-09-26 20:37:57 -07:00
fabriziopandini bb8eec4934 removal of v1alpha2 2018-09-26 17:39:18 +02:00
k8s-ci-robot 8c1fe2e1df
Merge pull request #68455 from Klaven/kubeadm_883
kubeadm 883 Updated logging to be consistent.
2018-09-26 02:27:47 -07:00
Benjamin Elder 8b56eb8588 hack/update-gofmt.sh 2018-09-24 12:21:29 -07:00
Benjamin Elder f828c6f662 hack/update-bazel.sh 2018-09-24 12:03:24 -07:00
Benjamin Elder 088cf3c37b find & replace version import 2018-09-24 12:03:24 -07:00
Lubomir I. Ivanov 209045ddd5 kubeadm: fix broken Docker 17.xx validation
A previous commit updated 17.xx -> 18.xx without considering
that some systems still use 17.xx.

Add handling for 17.0[3,6,9] as validated versions.
Also re-format the error message because the version is not validated
per maximum basis, but rather based on existing validation.
2018-09-21 01:00:53 +03:00
Andrew Rynhard 8f6ec989e0
Create control plane with ClusterFirstWithHostNet dns policy 2018-09-20 09:51:59 -07:00
k8s-ci-robot 9d8c9cc9fe
Merge pull request #68495 from yuansisi/fix-20180910
Upgrade kubeadm's version of docker support
2018-09-18 06:09:59 -07:00
xichengliudui 97c9fa3cb9 Upgrade kubeadm's version of docker support 2018-09-17 04:44:48 -04:00
Lubomir I. Ivanov fb365768e0 kubeadm: update MinimumControlPlaneVersion to v1.11.0
Update MinimumControlPlaneVersion to v1.11.0. Also update related
unit tests and test configurations.
2018-09-15 05:26:40 +03:00
Marek Counts a5356e5ba9 kubeadm 883 Updated logging to be consistent. There where areas in kubeadm init where glog was used and glog and was inconsistent with the rest of kubeadm init logging.
Updated logging in join.go and validators.go to use fmt.print style logging for init log messages.

removed redundant log message
2018-09-11 16:28:55 -04:00
David Ashpole 137c6d638e remove feature gate from kubelet defaulting 2018-09-06 18:17:09 -07:00
Kubernetes Submit Queue 5540edc1f9
Merge pull request #67944 from fabriziopandini/kubeadm-config-configMap
Automatic merge from submit-queue (batch tested with PRs 63011, 68089, 67944, 68132). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Kubeadm upload and fetch of kubeam config v1alpha3

**What this PR does / why we need it**:
This PR implements upload and fetch of kubeam config v1alpha3 from cluster.

More in detail:
In upload, `kubeadm-config` gets
- `ClusterConfiguration` (without components config which are already stored in separated ConfigMaps)
- `ClusterStatus`(initialised or updated with the API endpoint of the current node)

During fetch `InitConfiguration` is composed with:
- `ClusterConfiguration` from `kubeadm-config`
- The `APIEndpoint` of the current node from `ClusterStatus` in `kubeadm-config`
- Component configs from corresponding ConfigMaps

**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**:
In order to implement this it was necessary to extend current component config management with a new GetFromConfigMap operation. This is implemented in a separated commit "
implement component configs GetFromConfigMap".
The real change build on this (commi "upload and fetch kubeadm v1alpha3")

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

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/sig cluster-lifecycle
/area kubeadm
/kind enhancement
/assign @luxas
/assign @timothysc
/cc @chuckha @rosti @neolit123 @liztio
2018-09-04 10:24:43 -07:00
fabriziopandini d9b4b1fc1a autogenerated 2018-09-04 09:10:26 +02:00
fabriziopandini 3f70af3685 upload and fetch of kubeam config v1alpha3 from cluster 2018-09-04 09:09:55 +02:00
Kubernetes Submit Queue d47a513681
Merge pull request #67397 from neolit123/bind-address
Automatic merge from submit-queue (batch tested with PRs 67397, 68019). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

kubeadm: fix offline and air-gapped support

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

1.

Change the error output of getAllDefaultRoutes() so that it includes
information on which files were probed for the IP routing tables
even if such files are obvious.

Introduce a new error type which can be used to figure out of this
error is exactly of the "no routes" type.

2.

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.

3.

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().

**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#1041

**Special notes for your reviewer**:
1st and second commits fix offline support.
3rd commit fixes air-gabbed support (as discussed in the linked issue)

the api-machinery change is only fmt.Errorf() related.

**Release note**:

```release-note
kubeadm: fix air-gapped support and also allow some kubeadm commands to work without an available networking interface
```

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews 
/cc @kubernetes/sig-api-machinery-pr-reviews 
/assign @kad
/assign @xiangpengzhao 
/area UX
/area kubeadm
/kind bug
2018-09-03 08:23:28 -07:00
Sandor Szücs 588d2808b7
fix #51135 make CFS quota period configurable, adds a cli flag and config option to kubelet to be able to set cpu.cfs_period and defaults to 100ms as before.
It requires to enable feature gate CustomCPUCFSQuotaPeriod.

Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
2018-09-01 20:19:59 +02: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
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
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 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 7dfb3c7134 kubeadm config add support for more than one APIEndpoint 2018-08-27 09:00:26 +02: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
fabriziopandini 5e21c14b76 kubeadm config move ControlPlaneEndpoint to ClusterConfiguration 2018-08-24 09:42:23 +02: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 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
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
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
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
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
Chao Wang 765e2fc788 use v1 version of advanced audit policy in kubeadm 2018-08-09 19:38:05 +08:00
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
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 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
Di Xu b3dfe0c652 nodes: improve handling of erroneous host names 2018-08-01 14:57:25 +08: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 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
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
Di Xu 997a612206 kubeadm join the cluster with pre-existing client certificate 2018-07-26 19:34:09 +08: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
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
Mikhail Mazurskiy 5cab7f9a57
Handle errors 2018-07-17 20:47:14 +10: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
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 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
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
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
dkoshkin 1c5b596b77 Add a timeout when fetching latest version 2018-07-09 07:24:38 -04: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 71eda34c01
Update the config API roundtrip tests 2018-07-08 09:50:34 +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 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
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 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
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
wojtekt ffb32472bb Kubelet manager configuration 2018-06-19 22:12:55 +02: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
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
Lucas Käldström 5d96a719fb
kubeadm: Fix a couple of small-ish bugs for v1.11 2018-06-12 18:59:34 +03: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
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
liz db52cd4cdb
kubeadm lowercases all domain names passed as additional SANs
Some domains, like ELBs, output a domain name with uppercase letters. To
accept these, we lowercase all arguments passed to ----apiserver-cert-extra-sans
2018-06-05 10:14:21 -04:00
Kubernetes Submit Queue c7b71ebca9
Merge pull request #64408 from luxas/kubeadm_refactor_bt
Automatic merge from submit-queue (batch tested with PRs 64057, 63223, 64346, 64562, 64408). 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: Refactor the Bootstrap Tokens usage in the API types

**What this PR does / why we need it**:
This PR:
 - Moves some common, generic Bootstrap Token helpers and constants from `k8s.io/kubernetes/cmd/kubeadm/app/util/token` to `k8s.io/client-go/tools/bootstrap/token/`
 - Breaks out the top-level Bootstrap Token fields to a dedicated `BootstrapToken` struct with helper functions.
 - Instead of representing the Bootstrap Token as a plain `string`, there is now a wrapper struct `BootstrapTokenString` that can marshal/unmarshal correctly and supports validation on create, and splitting up the full token in the ID/Secret parts automatically.
 - Makes kubeadm support multiple Bootstrap Tokens automatically by supporting a slice of `BootstrapToken` in the `MasterConfiguration` API object
 - Consolidates the place for kubeadm to create token-related flags in an `options` package
 - Supports automatic conversion from the `v1alpha1` to `v1alpha2` API
 - Adds support to set token expiration directly instead of setting a TTL (Expiration and TTL are mutually exclusive)
 - Removes the old `TokenDiscovery` struct we're not using anymore inside of 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)*:
Related to https://github.com/kubernetes/community/pull/2131

**Special notes for your reviewer**:
This is work in progress. Please only review the first two commits for now.
I will work on splitting up this PR in smaller chunks.
I will also write unit tests tomorrow.

**Release note**:

```release-note
[action required] kubeadm: The Token-related fields in the `MasterConfiguration` object have now been refactored. Instead of the top-level `.Token`, `.TokenTTL`, `.TokenUsages`, `.TokenGroups` fields, there is now a `BootstrapTokens` slice of `BootstrapToken` objects that support the same features under the `.Token`, `.TTL`, `.Usages`, `.Groups` fields.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @mattmoyer @liztio
2018-06-02 02:10:18 -07:00
Lucas Käldström d01a7be2ac
fix the verify job 2018-06-01 17:14:26 +03:00
Kubernetes Submit Queue 9fee771b40
Merge pull request #64337 from liztio/save-etcd-dir
Automatic merge from submit-queue (batch tested with PRs 62460, 64480, 63774, 64540, 64337). 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>.

Save kubeadm manifest backup directories

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

Kubeadm will now preserves previous manifests after `kubeadm upgrade apply`. Previously these files would be deleted after the upgrade succeeded

**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/489](https://github.com/kubernetes/kubeadm/issues/489)

**Special notes for your reviewer**:

**Release note**:

```release-note
kubeadm now preserves previous manifests after upgrades
```
2018-05-31 14:12:25 -07:00
Kubernetes Submit Queue 9250d65969
Merge pull request #64540 from hanxiaoshuai/fix0531
Automatic merge from submit-queue (batch tested with PRs 62460, 64480, 63774, 64540, 64337). 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 uses its own scheme instead of kubectl scheme

**What this PR does / why we need it**:
kubeadm uses its own scheme instead of kubectl scheme
**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-05-31 14:12:21 -07:00
Kubernetes Submit Queue bb869d8389
Merge pull request #64543 from hanxiaoshuai/fix05311
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 error.go

**What this PR does / why we need it**:
remove unused code in kubeadm error.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-05-31 12:46:34 -07:00
Lucas Käldström 67a9f1bfe7
autogenerated 2018-05-31 22:21:06 +03:00
Lucas Käldström 17adbf9b08
Add unit tests for the new Bootstrap Token objects and functions 2018-05-31 22:19:47 +03:00
Lucas Käldström c473039580
kubeadm: Initial refactor of the Bootstrap Tokens. Add the new API objects, add/move helpers and start using the new flow in the code 2018-05-31 22:19:26 +03:00
liz 6ed91fc07c
Save kubeadm manifest backup directories
When kubeadm upgrades a static pod cluster, the old manifests were previously
deleted. This patch alters this behaviour so they are now stored in a
timestamped temporary directory.
2018-05-31 14:41:47 -04:00
hangaoshuai df3f1ff390 kubeadm uses its own scheme instead of kubectl scheme 2018-05-31 16:35:26 +08:00
hangaoshuai 89dd2b2807 remove unused code in kubeadm error.go 2018-05-31 13:43:04 +08:00
Lubomir I. Ivanov 2a63ba1db6 kubeadm: conditionally set the kubelet cgroup driver for Docker
Add a new utility file - util/cgroupdriver.go.
Currently it only contains the public function GetCgroupDriverDocker().
The function uses 'docker info' to obtain the cgroup driver
for Docker.

On a later stage this file can contain more methods for different
CRI.

Use GetCgroupDriverDocker() in phases/kubelet/flags.go
to conditionally set the 'cgroup-driver' argument. On error
print a warning and don't set the argument value.

Add unit tests in cgroupdriver_test.go.
2018-05-30 20:29:21 +03:00
Kubernetes Submit Queue 897a4b4968
Merge pull request #64232 from luxas/kubeadm_config_migrate
Automatic merge from submit-queue (batch tested with PRs 64322, 64210, 64458, 64232, 64370). 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: Add a 'kubeadm config migrate' command

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

This is an UX improvement so users may easier "upgrade" their **configuration files** from the an old version (e.g. `v1alpha1`) version to a new one (e.g. `v1alpha2`), can do this **locally and seamlessly without touching a cluster**. We talked about this in the SIG meeting; getting the users to be able to convert their checked-in configuration files to new API versions will be crucial.

**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
kubeadm: Add a 'kubeadm config migrate' command to convert old API types to their newer counterparts in the new, supported API types. This is just a client-side tool, it just executes locally without requiring a cluster to be running. You can think about this as an Unix pipe that upgrades config files.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-30 10:09:15 -07:00
Guoliang Wang 0726290118 remove unused functions in cmd 2018-05-30 23:05:27 +08:00
Lucas Käldström 7914dce526
autogenerated 2018-05-30 09:29:03 +03:00
Lucas Käldström 3331183daa
kubeadm: Add a 'kubeadm config migrate' command 2018-05-30 09:23:46 +03:00
Lucas Käldström 8bcbc1e9bd
autogenerated 2018-05-29 17:52:22 +03:00
Lucas Käldström fd47f8b20c
Update unit tests to use the new NodeRegistration object 2018-05-29 17:52:10 +03:00
Lucas Käldström b48f23b786
kubeadm: Move .NodeName and .CRISocket to a common sub-struct 2018-05-29 17:51:39 +03:00
Chuck Ha 2f2de31d3d
Prepulls images by default
kubeadm now pulls container images before the init step if it cannot find them on the system

* This commit also cleans up a dependency cycle

Closes #825
2018-05-25 14:26:29 -04:00
Kubernetes Submit Queue b712eaf22d
Merge pull request #64066 from luxas/kubeadm_etcd_refactor
Automatic merge from submit-queue (batch tested with PRs 64127, 63895, 64066, 64215, 64202). 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: Refactor the .Etcd substruct in the v1alpha2 API

**What this PR does / why we need it**:
Splits the monolithic `.Etcd` struct with all the options as fields to a more modular and clear design with two sub-structs for the different modes of hosting etcd we support.

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

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

Follows up: https://github.com/kubernetes/kubernetes/pull/63871
TODO: I still need to write unit tests for this.

**Release note**:

```release-note
[action required] kubeadm: The `:Etcd` struct has been refactored in the v1alpha2 API. All the options now reside under either `.Etcd.Local` or `.Etcd.External`. Automatic conversions from the v1alpha1 API are supported.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-24 10:45:21 -07:00
Lucas Käldström efc408944c
kubeadm: Improve the kubelet default configuration security-wise 2018-05-23 23:51:49 +03:00
Lucas Käldström 099e60b1db
kubeadm: Refactor the .Etcd substruct in the v1alpha2 API 2018-05-23 21:13:32 +03:00
Lucas Käldström 60b0eeb2a4
autogenerated 2018-05-22 09:31:28 +03:00
Lucas Käldström 0aa0f3208a
kubeadm: Write kubelet config file to disk and persist in-cluster. Also write runtime environment file and fixup the kubelet phases command 2018-05-22 09:12:25 +03:00
Kubernetes Submit Queue bc3aa11788
Merge pull request #64068 from luxas/kubeadm_remove_authzmodes
Automatic merge from submit-queue (batch tested with PRs 63151, 63795, 63553, 64068, 64113). 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 .AuthorizationModes in the v1alpha2 API

**What this PR does / why we need it**:
Now that we have https://github.com/kubernetes/kubernetes/pull/63879, we don't actually need to have `:AuthorizationModes` in our API anymore. This PR removes support for `.AuthorizationModes` in the v1alpha2 API, but keeps an upgrade path available (automatic conversion) from the v1alpha1 version.

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

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

**Release note**:

```release-note
[action required] kubeadm: Support for `.AuthorizationModes` in the kubeadm v1alpha2 API has been removed. Instead, you can use the `.APIServerExtraArgs` and `.APIServerExtraVolumes` fields to achieve the same effect. Files using the v1alpha1 API and setting this field will be automatically upgraded to this v1alpha2 API and the information will be preserved.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-21 21:41:21 -07:00
Lucas Käldström ddca1be88c
kubeadm: Remove .ImagePullPolicy 2018-05-21 09:20:11 +03:00
Lucas Käldström 5687f652db
kubeadm: Remove .AuthorizationModes in the v1alpha2 API 2018-05-21 08:49:12 +03:00
Lucas Käldström 4f0020d1b4
Don't support marshalling using the v1alpha1 version in kubeadm v1.11 2018-05-21 08:47:27 +03:00
Lucas Käldström 21bb44b2e0
autogenerated bazel 2018-05-19 15:04:15 +01:00
Lucas Käldström 8778937510
Add testdata that supports the unit tests testing the kubeadm API types 2018-05-19 15:03:40 +01:00
Lucas Käldström 2798d12717
Add roundtrip, defaulting, upgrading and validation unit tests for the kubeadm API types 2018-05-19 15:02:47 +01:00
Kubernetes Submit Queue d15985798e
Merge pull request #63969 from luxas/kubeadm_config_print_defaults
Automatic merge from submit-queue (batch tested with PRs 63969, 63902, 63689, 63973, 63978). 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 'kubeadm config print-default' command

**What this PR does / why we need it**:
Improves the UX around creating config files.

**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/829

**Special notes for your reviewer**:

**Release note**:

```release-note
kubeadm: A `kubeadm config print-default` command has now been added that you can use as a starting point when writing your own kubeadm configuration files
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-18 15:59:12 -07:00
Lucas Käldström 00390b6ec5
autogenerated 2018-05-18 00:55:01 +01:00
Jason DeTiberus c413aefee8
kubeadm - fix upgrades with static pod etcd 2018-05-17 11:53:31 -04:00
Lucas Käldström 3ceab591bc
Move all logic for NodeConfiguration unmarshal to the dedicated package 2018-05-17 16:19:07 +01:00
Lucas Käldström fbfe6cf443
autogenerated 2018-05-16 10:00:25 +01:00
Lucas Käldström e28242a245
autogenerated move to reference the v1alpha2 API inside of kubeadm 2018-05-16 09:59:41 +01:00
Lucas Käldström 96d2bbb450
kubeadm: Register and support loading the v1alpha2 API types 2018-05-16 09:44:23 +01:00
Kubernetes Submit Queue 2e61da137b
Merge pull request #63799 from luxas/kubeadm_restructure_internal_config_usage
Automatic merge from submit-queue (batch tested with PRs 63314, 63884, 63799, 63521, 62242). 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: Restructure internal config usage and fix bugs

**What this PR does / why we need it**:
 - Moves the generic LoadYAML function from the versioned, external API package to a helper library so it can be consumed more easily
 - Makes the upgrading code use the internal version of the API (which always should be used anyway)
 - Moves all config-loading code to `configutil`, together with the migration code needed. This way we have everything in one centralized place, instead of duplicating that logic N times.
 - Makes `kubeadm init` use `configutil` for the reasons mentioned above.

This PR is needed in order to support multiple external API groups (like v1alpha2)

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Part of https://github.com/kubernetes/community/pull/2131

**Special notes for your reviewer**:
This PR depends on:
 - https://github.com/kubernetes/kubernetes/pull/63782
 - https://github.com/kubernetes/kubernetes/pull/63783

**Please review only the last (third) commit**

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-15 19:55:12 -07:00
Kubernetes Submit Queue 5788d4de1f
Merge pull request #63495 from detiber/external_etcd_upgrade
Automatic merge from submit-queue (batch tested with PRs 63792, 63495, 63742, 63332, 63779). 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 upgrades with external etcd

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

- Allow for upgrade plan and upgrade apply to work with external etcd
  - https://github.com/kubernetes/kubeadm/issues/727
  - https://github.com/kubernetes/kubernetes/pull/62141

- Update upgrade plan output when configured for external etcd
  - Move etcd to a separate section and show available upgrades

**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/727

**Release note**:
```release-note
kubeadm upgrade now supports external etcd setups again
```

I created a gist documenting the manual testing I've been doing for this PR here: https://gist.github.com/detiber/e18d907c41901fbb5e12ffa1af5750f8
2018-05-15 09:04:20 -07:00
Lucas Käldström cae656b4f9
autogenerated bazel 2018-05-15 16:36:46 +01:00
Lucas Käldström f95e63cd10
kubeadm: Handle config loading only in one place, and only use the internal version of the API internally. Fix bugs 2018-05-15 15:44:27 +01:00
Kubernetes Submit Queue de2f1faa55
Merge pull request #63782 from luxas/kubeadm_own_scheme
Automatic merge from submit-queue (batch tested with PRs 63272, 63782, 63715, 63811, 63803). 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>.

Stop installing kubeadm types in the generic, legacy scheme

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

Right now the kubeadm API types are (wrongly from a correctness perspective) installed in the "catch-all" and now legacy `pkg/api/legacyscheme`. Instead, we should use our own, kubeadm-specific `scheme` where our API types are registered. Doing this also cuts one dependency on the internal core API types.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Part of https://github.com/kubernetes/community/pull/2131

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @sttts @liztio
2018-05-15 05:08:10 -07:00
Jason DeTiberus f40b7f389e
kubeadm - fix external etcd upgrades
- Update upgrade plan output when configured for external etcd
  - Move etcd to a separate section and show available upgrades
2018-05-14 20:51:20 -04:00
Craig Tracey ac1e940c75
Support kubeadm upgrade with remote etcd cluster
Currently kubeadm only performs an upgrade if the etcd cluster is
colocated with the control plane node. As this is only one possible
configuration, kubeadm should support upgrades with etcd clusters
that are not local to the node.

Signed-off-by: Craig Tracey <craigtracey@gmail.com>
2018-05-14 20:40:57 -04:00
Kubernetes Submit Queue ab180d808e
Merge pull request #63807 from lalyos/kubeadm-consistent-generated-manifest
Automatic merge from submit-queue (batch tested with PRs 63492, 62379, 61984, 63805, 63807). 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>.

Sort arguments before joining them, for reproducible return string

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

This PR makes kubeadm static pod manifest generation consistent. Right now when `kubeadm init` is called repeatedly, the generated pod manifest files under /etc/kubernetes/manifest/ are changing. Its really hard to test how a configuration change effects the manifest files.

The current implementation is ranging over a map[string]string which will be happening in a random order, generating different pod manifests even without changing any configuration.

The suggested solution makes pom manifest generation idempotent. It opens up integration test possibilities, like testing whole yaml result of `kubeadm alpha phase controlplane`.

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

/sig cluster-lifecycle
/assign @luxas
2018-05-14 17:11:26 -07:00
Kubernetes Submit Queue 44a1481859
Merge pull request #63400 from rajansandeep/corednsupgrade
Automatic merge from submit-queue (batch tested with PRs 55511, 63372, 63400, 63100, 63769). 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 upgrade path for CoreDNS

**What this PR does / why we need it**:
This PR achieves the following:
1. Retains the CoreDNS ConfigMap defined by the user during `kubeadm upgrade`.
2. Removes the CoreDNS deployment when user decides to install kube-dns during `kubeadm upgrade`.


**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-05-14 14:35:17 -07:00
lalyos 5308957dbc Sort arguments before joining them, for reproducible return string 2018-05-14 20:24:39 +02:00
Lucas Käldström 8074a1987e
autogenerated bazel 2018-05-14 18:12:31 +01:00
Lucas Käldström 80a31d7a5a
Stop installing kubeadm types in the generic, legacy scheme 2018-05-14 18:11:30 +01:00
Kubernetes Submit Queue c9591ee6cb
Merge pull request #63734 from liztio/kubeadm-marshal-tests
Automatic merge from submit-queue (batch tested with PRs 63783, 63734). 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 marshal tests

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

Adds tests for the marshalling utilities 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: kubernetes/kubeadm#802

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-14 09:12:12 -07:00
Lucas Käldström 68c68dfadc
Rename kubeadmapiext to the more explicit kubeadmapiv1alpha1 2018-05-14 12:31:48 +03:00
liz bed8658542
Tests for kubeadm marshal utilities 2018-05-11 17:50:41 -04:00
liz 43241992fc
Generated artefacts 2018-05-11 17:50:41 -04:00
Kubernetes Submit Queue 92ba95c39c
Merge pull request #63446 from deads2k/client-08-remove-old
Automatic merge from submit-queue (batch tested with PRs 63367, 63718, 63446, 63723, 63720). 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>.

finish new dynamic client and deprecate old dynamic client

Builds on a couple other pulls.  This completes the transition to the new dynamic client.

@kubernetes/sig-api-machinery-pr-reviews 
@caesarxuchao @sttts 

```release-note
The old dynamic client has been replaced by a new one.  The previous dynamic client will exist for one release in `client-go/deprecated-dynamic`.  Switch as soon as possible.
```
2018-05-11 14:49:16 -07:00
David Eads fd044d152e fix dynamic client name 2018-05-11 13:12:09 -04:00
Timothy St. Clair 465094f32b Add 'system-cluster-critical" to kubeadm control plane pods. 2018-05-10 13:58:12 -05:00
Sandeep Rajan 379c8e83da Improve coredns upgrade path 2018-05-09 12:37:22 -04:00
Davanum Srinivas ff26e57ba6 Improve where we load builds from for kubeadm upgrade jobs
We should stop special casing "ci-cross" and just use the
configuration in test-infra to dictate where we pick up
the builds from.

For 1.8,1.9,1.10 branches, we need to load the latest
version from ci/latest*.txt.

For master, 1.11 etc, we need to load from ci-cross/latest*.txt.

We need to update test-infra configs if things fail.

try these to verify:
```
gsutil cat gs://kubernetes-release-dev/ci/latest-1.9.txt
gsutil cat gs://kubernetes-release-dev/ci-cross/latest.txt
```
2018-05-09 12:11:41 -04:00
David Eads 7588af992c use new dynamic client 2018-05-04 08:15:06 -04:00
Kubernetes Submit Queue 67870dac16
Merge pull request #62655 from stealthybox/TLSUpgrade_+_detiber-kubeadm_hash
Automatic merge from submit-queue (batch tested with PRs 62655, 61711, 59122, 62853, 62390). 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>.

Modify the kubeadm upgrade DAG for the TLS Upgrade

**What this PR does / why we need it**:
This adds the necessary utilities to detect Etcd TLS on static pods from the file system and query Etcd.
It modifies the upgrade logic to make it support the APIServer downtime.
Tests are included and should be passing.

```bash 
bazel test //cmd/kubeadm/... \
  && bazel build //cmd/kubeadm --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 \
  && issue=TLSUpgrade ~/Repos/vagrant-kubeadm-testing/copy_kubeadm_bin.sh
```
These cases are working consistently for me
```bash
kubeadm-1.9.6 reset \
  && kubeadm-1.9.6 init --kubernetes-version 1.9.1 \
  && kubectl apply -f https://git.io/weave-kube-1.6
/vagrant/bin/TLSUpgrade_kubeadm upgrade apply 1.9.6  # non-TLS to TLS
/vagrant/bin/TLSUpgrade_kubeadm upgrade apply 1.10.0 # TLS to TLS
/vagrant/bin/TLSUpgrade_kubeadm upgrade apply 1.10.1 # TLS to TLS
/vagrant/bin/TLSUpgrade_kubeadm upgrade apply 1.9.1  # TLS to TLS /w major version downgrade
```

This branch is based on top of #61942, as resolving the hash race condition is necessary for consistent behavior.
It looks to fit in pretty well with @craigtracey's PR: #62141
The interfaces are pretty similar

/assign @detiber @timothysc

**Which issue(s) this PR fixes**
Helps with https://github.com/kubernetes/kubeadm/issues/740

**Special notes for your reviewer**:

278b322a1c
   [kubeadm] Implement ReadStaticPodFromDisk

c74b56372d
   Implement etcdutils with Cluster.HasTLS()

   - Test HasTLS()
   - Instrument throughout upgrade plan and apply
   - Update plan_test and apply_test to use new fake Cluster interfaces
   - Add descriptions to upgrade range test
   - Support KubernetesDir and EtcdDataDir in upgrade tests
   - Cover etcdUpgrade in upgrade tests
   - Cover upcoming TLSUpgrade in upgrade tests

8d8e5fe33b
   Update test-case, fix nil-pointer bug, and improve error message

97117fa873
   Modify the kubeadm upgrade DAG for the TLS Upgrade

   - Calculate `beforePodHashMap` before the etcd upgrade in anticipation of
   KubeAPIServer downtime
   - Detect if pre-upgrade etcd static pod cluster `HasTLS()==false` to switch
   on the Etcd TLS Upgrade if TLS Upgrade:
      - Skip L7 Etcd check (could implement a waiter for this)
      - Skip data rollback on etcd upgrade failure due to lack of L7 check
    (APIServer is already down unable to serve new requests)
      - On APIServer upgrade failure, also rollback the etcd manifest to
    maintain protocol compatibility

   - Add logging

**Release note**:
```release-note
kubeadm upgrade no longer races leading to unexpected upgrade behavior on pod restarts
kubeadm upgrade now successfully upgrades etcd and the controlplane to use TLS
kubeadm upgrade now supports external etcd setups
kubeadm upgrade can now rollback and restore etcd after an upgrade failure
```
2018-04-24 13:28:13 -07:00
Jason DeTiberus 4c768bb2ca [kubeadm] Add etcd L7 check on upgrade
- Adds L7 check for kubeadm etcd static pod upgrade
2018-04-24 09:56:35 -06:00
leigh schrandt 99a1143676 [kubeadm] Implement etcdutils with Cluster.HasTLS()
- Test HasTLS()
- Instrument throughout upgrade plan and apply
- Update plan_test and apply_test to use new fake Cluster interfaces
- Add descriptions to upgrade range test
- Support KubernetesDir and EtcdDataDir in upgrade tests
- Cover etcdUpgrade in upgrade tests
- Cover upcoming TLSUpgrade in upgrade tests
2018-04-24 09:55:51 -06:00
fabriziopandini 8abc54d257 make API.ControlPlaneEndpoint accept IP 2018-04-23 00:16:13 +02:00
leigh schrandt 3b45b021ee [kubeadm] Implement ReadStaticPodFromDisk 2018-04-20 18:32:04 -06:00
Jason DeTiberus d55d1b6fbe [kubeadm] fix mirror-pod hash race condition
- Update kubeadm static pod upgrades to use the
  kubetypes.ConfigHashAnnotationKey annotation on the mirror pod rather
  than generating a hash from the full object info. Previously, a status
  update for the pod would allow the upgrade to proceed before the
  new static pod manifest was actually deployed.

Signed-off-by: Jason DeTiberus <detiber@gmail.com>
2018-04-20 18:32:03 -06:00
Kubernetes Submit Queue 500b63aed6
Merge pull request #62726 from xiangpengzhao/kubeadm-json-name
Automatic merge from submit-queue (batch tested with PRs 62726, 60085, 62583). 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>.

 Refactor kubeadm api validation.

**What this PR does / why we need it**:
This PR refactor kubeadm api validation to use field json name. When users get a validation error, they can easily know which field is invalid in their config files.

**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**:
@fabriziopandini I remember we mentioned this refactoring in some comment. I didn't see this change was done, so I send this PR to address this.

**Release note**:

```release-note
NONE
```
2018-04-19 11:00:13 -07:00
Kubernetes Submit Queue 9931a60630
Merge pull request #62632 from xiangpengzhao/fix-gc
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 garbled code in kubeadm output

**What this PR does / why we need it**:
This fixes the garbled code:
![image](https://user-images.githubusercontent.com/15881573/38799293-afa3f392-4196-11e8-88c4-a0783a288f7e.png)

**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-04-19 08:39:58 -07:00
Mike Danese f427531179 boring 2018-04-18 09:55:57 -07:00
xiangpengzhao 579602bba2 Refactor kubeadm api validation. 2018-04-18 10:26:02 +08:00
xiangpengzhao b0bdaa3a4c Fix garbled code in kubeadm output 2018-04-16 16:56:20 +08:00
Kubernetes Submit Queue c048cbcf93
Merge pull request #62314 from rjosephwright/endpoint-port
Automatic merge from submit-queue (batch tested with PRs 58540, 62314). 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 ability to specify port for kubeadm `API.ControlPlaneEndpoint`

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

When `API.ControlPlaneEndpoint` is used, the `BindPort` of the
apiserver is currently assumed, which means a load balancer cannot
listen on a different port than the apiserver. This extends the
`ControlPlaneEndpoint` to take an optional port which may differ
from the apiserver's `BindPort`.

**Release note**:

```release-note
The kubeadm config option `API.ControlPlaneEndpoint` has been extended to take an optional port which may differ from the apiserver's bind port.
```
2018-04-13 17:00:04 -07:00
Joseph Wright f558359315 Add ability to specify port for kubeadm `API.ControlPlaneEndpoint`
When `API.ControlPlaneEndpoint` is used, the `BindPort` of the
apiserver is currently assumed, which means a load balancer cannot
listen on a different port than the apiserver. This extends the
`ControlPlaneEndpoint` to take an optional port which may differ
from the apiserver's `BindPort`.
2018-04-13 16:46:12 -04:00
Kubernetes Submit Queue c8cded58d7
Merge pull request #56956 from Lion-Wei/kubeadm-1
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>.

validate AdvertiseAddress in kubeadm init and other case

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

When using `kubeadm init --apiserver-advertise-address=****, `apiserver-advertise-address` can only be ipv4 or ipv6 address, if people use domain name in this field, will not use it and silently get hostIP.

Add a warning in this case.

**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#590

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-04-11 14:33:31 -07:00
Kubernetes Submit Queue 0023c4112b
Merge pull request #57661 from vbmade2000/KUBE-ISSUE-340
Automatic merge from submit-queue (batch tested with PRs 59027, 62333, 57661, 62086, 61584). 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>.

Implement verbosity feature for kubeadm

[WIP] Adds verbosity feature to init command hierarchy of kubeadm utility.



**What this PR does / why we need it**:
Implements verbosity feature to 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#340

**Special notes for your reviewer**:
I will be splitting this work into a smaller PR to keep it separate and clean.

**Release note**:

```release-note
Implements verbosity logging feature for kubeadm commands
```
2018-04-10 22:53:19 -07:00
Malhar Vora 9c4706f519 Implement verbosity feature for kubeadm init
Fixes #340

Adds functionality to see logs with various level of verbosity.

Currently there are two verbosity levels: 0 and 1
2018-03-25 09:43:31 -07:00
leigh schrandt 9bbf3fd539 Update liveness probes to exec etcdctl /w mTLS for kubeadm etcd static pods 2018-03-04 19:25:19 -07:00
Lion-Wei a0acc28b62 Add validation of apiserver-advertise-address 2018-02-24 10:23:27 +08:00
test a3fb9b4443
kubeadm: use localhost for API server liveness probe 2018-02-23 18:02:36 -08:00
Kubernetes Submit Queue d7cadf5d18
Merge pull request #59288 from stevesloka/apiServerDNS
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 configuration item to allow kubeadm join to use a dns name pointing to control plane

This adds a new flag (`--apiserver-advertise-dns-address`) to kubeadm which is used in node kubelet.confg to point to API server allowing users to define a DNS entry instead of an IP address.

Fixes kubernetes/kubeadm#411

```release-note
Adds new flag `--apiserver-advertise-dns-address` which is used in node kubelet.confg to point to API server
```
// @timothysc @craigtracey
2018-02-21 23:01:08 -08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00