Commit Graph

6633 Commits (2eb1083b9bcfbd118118f361169b327913d0d128)

Author SHA1 Message Date
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
WanLinghao f16470c3f1 This patch adds limit to the TokenRequest expiration time. It constrains a TokenRequest's expiration time to avoid extreme value which could harm the cluster. 2018-06-14 09:31:50 +08: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
ruicao 95c232ee07 Typo fix: toto -> to 2018-06-12 23:12:39 +08: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
Mikhail Mazurskiy e458cfe02c
Rename context 2018-06-09 13:06:23 +10:00
Kubernetes Submit Queue c2b27efd3b
Merge pull request #60699 from CaoShuFeng/remove-enable-custom-metrics
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 deprecated option '--enable-custom-metrics'

**Release note**:
```release-note
deprecated and inactive option '--enable-custom-metrics' is removed in 1.11
```
2018-06-08 11:23:02 -07: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
Mikhail Mazurskiy 102090d1f1
Use context.TODO() to be explicit that cancellation is not implemented 2018-06-07 14:33:03 +10:00
Mikhail Mazurskiy 3252beb02b
Propagate signal from stop to context 2018-06-07 14:24:02 +10:00
Mikhail Mazurskiy dc32a341c0
Cancellable leader election with context 2018-06-07 14:24:02 +10:00
Mikhail Mazurskiy 1d99fff1ac
Cancellable leader election with channels 2018-06-07 14:24:01 +10: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 8013bdb180
Merge pull request #64749 from Random-Liu/fix-standalone-dockershim
Automatic merge from submit-queue (batch tested with PRs 64749, 64797). 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 standalone dockershim.

Ref https://github.com/kubernetes-incubator/cri-tools/pull/320#issuecomment-394554484.

This PR fixes a bug that standalone dockershim exits immediately.

This PR:
1) Changes standalone dockershim to wait on `stopCh`, so that it won't exit immediately.
2) Removes `stopCh` from dockershim internal. It doesn't help much for graceful stop, because kubelet will exit immediately anyway. https://github.com/kubernetes/kubernetes/blob/master/cmd/kubelet/app/server.go#L748

@kubernetes/sig-node-pr-reviews @yujuhong @feiskyer 

**Release note**:

```release-note
none
```
2018-06-06 10:08:12 -07: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 b6f75ac30e
Merge pull request #63717 from ingvagabund/promote-sysctl-annotations-to-fields
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>.

Promote sysctl annotations to fields

#


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

Promoting experimental sysctl feature from annotations to API fields.

**Special notes for your reviewer**:

Following sysctl KEP: https://github.com/kubernetes/community/pull/2093

**Release note**:

```release-note
The Sysctls experimental feature has been promoted to beta (enabled by default via the `Sysctls` feature flag). PodSecurityPolicy and Pod objects now have fields for specifying and controlling sysctls. Alpha sysctl annotations will be ignored by 1.11+ kubelets. All alpha sysctl annotations in existing deployments must be converted to API fields to be effective.
```

**TODO**:

* [x] - Promote sysctl annotation in Pod spec
* [x] - Promote sysctl annotation in PodSecuritySpec spec
* [x] - Feature gate the sysctl
* [x] - Promote from alpha to beta
* [x] - docs PR - https://github.com/kubernetes/website/pull/8804
2018-06-06 00:47:36 -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
Kubernetes Submit Queue c615098a96
Merge pull request #63193 from lichuqiang/provision_0425
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>.

Volume topology aware dynamic provisioning: work based on new API

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

The PR has been split to 3 parts:

Part1: https://github.com/kubernetes/kubernetes/pull/63232 for basic scheduler and PV controller plumbing
Part2: https://github.com/kubernetes/kubernetes/pull/63233 for API change

and the PR itself includes work based on the API change:

- Dynamic provisioning allowed topologies scheduler work
- Update provisioning interface to be aware of selected node and topology

**Which issue(s) this PR fixes** 
Feature: https://github.com/kubernetes/features/issues/561
Design: https://github.com/kubernetes/community/issues/2168

**Special notes for your reviewer**:
/sig storage
/sig scheduling
/assign @msau42 @jsafrane @saad-ali @bsalamat

@kubernetes/sig-storage-pr-reviews
@kubernetes/sig-scheduling-pr-reviews

**Release note**:

```release-note
Volume topology aware dynamic provisioning
```
2018-06-05 15:31:58 -07:00
Lucas Käldström 0cb6f0f0fc
autogenerated 2018-06-06 01:31:20 +03:00
Jan Chaloupka b1b28f0fce Switch to Beta 2018-06-06 00:23:16 +02:00
Seth Jennings 6729add11c sysctls: create feature gate to track promotion 2018-06-06 00:23:11 +02:00
Lucas Käldström 041858232c
kubeadm: Upload CRISocket information and hence make kubeadm join blocking 2018-06-06 01:05:49 +03:00
Lantao Liu bc0264fbae Fix standalone dockershim. 2018-06-05 21:52:08 +00: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
Sandeep Rajan fce42e0bf6 coredns to use gcr.io repo 2018-06-05 11:08:11 -04: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
Chuck Ha 0a4b6dfe93
Fix kubeadm for v1alpha1 configs
Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-06-05 09:55:46 -04:00
lichuqiang bccc8fe979 Provision interface change 2018-06-05 16:35:16 +08:00
Nico Berlee 7ee5729eba
Run CoreDNS container only with CAP_NET_BIND_SERVICE, drop all other (root) privileges.
Run filesystem of container and config in read-only mode.
2018-06-05 08:22:47 +02:00
Cao Shufeng d767ce24a9 remove deprecated option '--enable-custom-metrics' 2018-06-05 11:19:23 +08:00
Kubernetes Submit Queue 50178d3ed3
Merge pull request #64661 from liggitt/hostname-override
Automatic merge from submit-queue (batch tested with PRs 63453, 64592, 64482, 64618, 64661). 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>.

Clarify --hostname-override and --cloud-provider interaction

pairs with a PR to the website cloud provider page defining behavior for existing cloud providers: https://github.com/kubernetes/website/pull/8873

xref https://github.com/kubernetes/kubernetes/issues/64659 https://github.com/kubernetes/kubernetes/issues/62600 https://github.com/kubernetes/kubernetes/issues/61774 https://github.com/kubernetes/kubernetes/issues/54482

```release-note
NONE
```
2018-06-04 16:56:22 -07:00
Kubernetes Submit Queue 54eeca0912
Merge pull request #64618 from chuckha/loggin
Automatic merge from submit-queue (batch tested with PRs 63453, 64592, 64482, 64618, 64661). 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>.

Replace glog.Info{f,ln} with fmt.Print{f,ln}

Please see commit message.

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

**What this PR does / why we need it**:
This PR makes kubeadm's logging output consistent for the regular case and offers verbosity with glog.

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

**Special notes for your reviewer**:
Unfortunately there is one call site in a dependency that uses a bare glog.Infof which we can't change without a bigger effort.

**Release note**:
```release-note
NONE
```
2018-06-04 16:56:18 -07:00
liz b42564a5cb
Kubeadm-initialised kubelet uses provided hostname if present
If --node-name is passed in to `kubeadm init`, `--hostname-override` will be
passed to kubelet.
2018-06-04 14:25:56 -04:00
liz 3da1228186
Bazel artefacts 2018-06-04 14:04:02 -04:00
Di Xu 9a2e58b5e7 kubeadm: use nodeselector instead of affinity in kube-dns 2018-06-04 22:48:48 +08:00
Di Xu d1949261ab kubeadm: use nodeSelector to only run kube-proxy on architecture consistent nodes 2018-06-04 22:48:04 +08:00
Chuck Ha 125f5ac61a
Replace glog.Info{f,ln} with fmt.Print{f,ln}
This follows the pattern `kubectl` uses for logging.

There are two remaining glog.Infof call that cannot be removed easily.

One glog call comes from kubelet validation which calls features.SetFromMap.
The other comes from test/e2e during kernel validation.

Mostly fixes kubernetes/kubeadm#852

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-06-04 10:34:31 -04:00
leigh schrandt b7df5cd2f8 kubeadm: Set the kubelet `--resolv-conf` flag conditionally on init
Fixes https://github.com/kubernetes/kubeadm/issues/845
2018-06-03 00:50:22 -06:00
Jordan Liggitt 32a73b3c88
Clarify --hostname-override and --cloud-provider interaction 2018-06-02 15:44:11 -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
Di Xu 34a7c2f6a6 remove deprecated/unused ProbeNetworkPlugins 2018-06-02 11:31:01 +08:00
Di Xu 5ebd40cb6a bind alpha feature network plugin flags correctly 2018-06-02 11:31:01 +08:00
Kubernetes Submit Queue d2495b8329
Merge pull request #63143 from jsafrane/containerized-subpath
Automatic merge from submit-queue (batch tested with PRs 63348, 63839, 63143, 64447, 64567). 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>.

Containerized subpath

**What this PR does / why we need it**:
Containerized kubelet needs a different implementation of `PrepareSafeSubpath` than kubelet running directly on the host.

On the host we safely open the subpath and then bind-mount `/proc/<pidof kubelet>/fd/<descriptor of opened subpath>`.

With kubelet running in a container, `/proc/xxx/fd/yy` on the host contains path that works only inside the container, i.e. `/rootfs/path/to/subpath` and thus any bind-mount on the host fails.

Solution:
- safely open the subpath and gets its device ID and inode number
- blindly bind-mount the subpath to `/var/lib/kubelet/pods/<uid>/volume-subpaths/<name of container>/<id of mount>`. This is potentially unsafe, because user can change the subpath source to a link to a bad place (say `/run/docker.sock`) just before the bind-mount.
- get device ID and inode number of the destination. Typical users can't modify this file, as it lies on /var/lib/kubelet on the host.
- compare these device IDs and inode numbers.

**Which issue(s) this PR fixes**
Fixes #61456

**Special notes for your reviewer**:

The PR contains some refactoring of `doBindSubPath` to extract the common code. New `doNsEnterBindSubPath` is added for the nsenter related parts.

**Release note**:

```release-note
NONE
```
2018-06-01 12:12:19 -07:00
Kubernetes Submit Queue 5710943612
Merge pull request #63839 from wgliang/master.movepkg
Automatic merge from submit-queue (batch tested with PRs 63348, 63839, 63143, 64447, 64567). 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 pkg/scheduler/schedulercache -> pkg/scheduler/cache

**What this PR does / why we need it**:
Move pkg/scheduler/schedulercache -> pkg/scheduler/cache

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

**Special notes for your reviewer**:

In order to prevent name conflicts still rename the `cache` to `schedulercache`.

**Release note**:

```release-note
NONE
```
2018-06-01 12:12:15 -07:00
Kubernetes Submit Queue 74b224eba7
Merge pull request #64570 from liztio/force-version
Automatic merge from submit-queue (batch tested with PRs 64605, 64570). 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>.

Version mismatch is now a skippable error

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

Previously, kubeadm enforced the same major and minor versions as the version of kubernetes it was installing. This is still enforced by default, but now the `--force` flag can override it. This is useful for testing and other edge cases.


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

**Special notes for your reviewer**:

**Release note**:
```release-note
kubeadm upgrade apply can now ignore version errors with --force
```
2018-06-01 07:43:05 -07:00
Lucas Käldström d01a7be2ac
fix the verify job 2018-06-01 17:14:26 +03:00
Kubernetes Submit Queue 8d10a8f74f
Merge pull request #64006 from Random-Liu/streaming-auth
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 proxy for container streaming in kubelet for streaming auth.

For https://github.com/kubernetes/kubernetes/issues/36666, option 2 of https://github.com/kubernetes/kubernetes/issues/36666#issuecomment-378440458.

This PR:
1. Removed the `DirectStreamingRuntime`, and changed `IndirectStreamingRuntime` to `StreamingRuntime`. All `DirectStreamingRuntime`s, `dockertools` and `rkt`, were removed.
2. Proxy container streaming in kubelet instead of returning redirect to apiserver. This solves the container runtime authentication issue, which is what we agreed on in https://github.com/kubernetes/kubernetes/issues/36666.

Please note that, this PR replaced the redirect with proxy directly instead of adding a knob to switch between the 2 behaviors. For existing CRI runtimes like containerd and cri-o, they should change to serve container streaming on localhost, so as to make the whole container streaming connection secure.

 If a general authentication mechanism proposed in https://github.com/kubernetes/kubernetes/issues/62747 is ready, we can switch back to redirect, and all code can be found in github history.

Please also note that this added some overhead in kubelet when there are container streaming connections. However, the actual bottleneck is in the apiserver anyway, because it does proxy for all container streaming happens in the cluster. So it seems fine to get security and simplicity with this overhead. @derekwaynecarr @mrunalp Are you ok with this? Or do you prefer a knob?

@yujuhong @timstclair @dchen1107 @mikebrow @feiskyer 
/cc @kubernetes/sig-node-pr-reviews 
**Release note**:

```release-note
Kubelet now proxies container streaming between apiserver and container runtime. The connection between kubelet and apiserver is authenticated. Container runtime should change streaming server to serve on localhost, to make the connection between kubelet and container runtime local.

In this way, the whole container streaming connection is secure. To switch back to the old behavior, set `--redirect-container-streaming=true` flag.
```
2018-05-31 22:45:29 -07:00
Kubernetes Submit Queue 440b2b6ea7
Merge pull request #61077 from islinwb/fix_ipvs_warninfo
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>.

Init ipvsInterface only when ipvs modules are present

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-31 20:01:26 -07:00
Lantao Liu 174b6d0e2f Proxy container streaming in kubelet. 2018-05-31 15:26:32 -07: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
liz c92aa1afc6
Kubeadm/k8s version mismatch is now a skippable error 2018-05-31 16:34:13 -04: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
Guoliang Wang 761cf41427 Move pkg/scheduler/schedulercache -> pkg/scheduler/cache 2018-05-31 22:55:34 +08: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
Kubernetes Submit Queue f5254dab8a
Merge pull request #58442 from m1093782566/ipvs-ga
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>.

Declare IPVS-based kube-proxy GA and remove feature gateway

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

As discussed in sig-network meeting, we decided to target IPVS-based kube-proxy GA in 1.10.

This PR declares IPVS-based kube-proxy GA and remove feature gateway.

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

Fixes: #58443

issue in feature repo: https://github.com/kubernetes/features/issues/265

**Special notes for your reviewer**:

**Release note**:

```release-note
Declare IPVS-based kube-proxy GA
```

@quinton-hoole
2018-05-30 21:21:42 -07:00
Kubernetes Submit Queue 87dfadb27a
Merge pull request #64347 from neolit123/kubeadm-docker-cgroup
Automatic merge from submit-queue (batch tested with PRs 64338, 64219, 64486, 64495, 64347). 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: conditionally set the kubelet cgroup driver for Docker

**What this PR does / why we need it**:
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.

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

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
kubeadm: conditionally set the kubelet cgroup driver for Docker
```

/area kubeadm
/kind enhancement
@kubernetes/sig-cluster-lifecycle-pr-reviews 
@luxas
2018-05-30 20:17:25 -07:00
Kubernetes Submit Queue 0340864ae9
Merge pull request #64016 from stewart-yu/stewart-controller-manager-codeclean
Automatic merge from submit-queue (batch tested with PRs 57082, 64325, 64016, 64443, 64403). 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>.

should not ignore err when convert api version

**What this PR does / why we need it**:
should not ignore err when convert api 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)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-30 18:49:17 -07:00
Kubernetes Submit Queue 9d36590e80
Merge pull request #64325 from bart0sh/PR000015-remove-CrictlChecker
Automatic merge from submit-queue (batch tested with PRs 57082, 64325, 64016, 64443, 64403). 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 CrictlChecker from preflight checks

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

CrictlChecker uses InPathCheck to check if crictl presents
in the PATH. The same check is done in CRICheck function.

CrictlChecker is also called unconditionally, producing messages
that can confuse users. CRICheck is called only when needed, i.e.
when user specifies CRI socket.

**Release note**:
```release-note
NONE
```
2018-05-30 18:49:13 -07:00
Kubernetes Submit Queue b5d21a92ad
Merge pull request #64339 from liztio/pronouns
Automatic merge from submit-queue (batch tested with PRs 61803, 64305, 64170, 64361, 64339). 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 some unnecessarily gendered pronouns in comments

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

A bunch of comments are unnecessarily gendered. I've changed them to gender-neutral they/theirs.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-30 17:34:25 -07:00
Kubernetes Submit Queue 2b1bfc3a17
Merge pull request #64361 from xlgao-zju/patch-1
Automatic merge from submit-queue (batch tested with PRs 61803, 64305, 64170, 64361, 64339). 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 the help of kubeadm completion

**What this PR does / why we need it**:
Add note that 'bash-completion' is required on Linux too.

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

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

**Release note**:
```release-note
NONE
```
2018-05-30 17:34:21 -07:00
Kubernetes Submit Queue e978c47f5e
Merge pull request #64170 from mtaufen/cap-node-num-images
Automatic merge from submit-queue (batch tested with PRs 61803, 64305, 64170, 64361, 64339). 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 flag to control the cap on images reported in node status

While I normally try to avoid adding flags, this is a short term
scalability fix for v1.11, and there are other long-term solutions in
the works, so we shouldn't commit to this in the v1beta1 Kubelet config.
Flags are our escape hatch here.

```release-note
NONE
```
2018-05-30 17:34:18 -07:00
Kubernetes Submit Queue 22919ae7e1
Merge pull request #58920 from victorgp/master
Automatic merge from submit-queue (batch tested with PRs 58920, 58327, 60577, 49388, 62306). 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>.

Possible cipher suites values and tls versions in help for apiserver and kubelet

**What this PR does / why we need it**:
Addresses a suggestion made by @lavalamp to list the possible TLS cipher suites in the kubelet and apiserver helps: https://github.com/kubernetes/kubernetes/pull/48859#discussion_r162413223

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

**Special notes for your reviewer**:
This pull request only adds to the help message the possible values of the TLS Cipher suites for Kubelet and api server.
It is an addition to the already merged PR https://github.com/kubernetes/kubernetes/pull/48859

The help output looks like this:

```
      --tls-cert-file string                                    File containing the default x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). If HTTPS serving is enabled, and --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key are generated for the public address and saved to the directory specified by --cert-dir.
      --tls-cipher-suites strings                               Comma-separated list of cipher suites for the server. Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). If omitted, the default Go cipher suites will be use.  Possible values: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_3DES_EDE_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_RC4_128_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
      --tls-min-version string                                  Minimum TLS version supported. Value must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants.
      --tls-private-key-file string                             File containing the default x509 private key matching --tls-cert-file.

```

**Release note**:
```release-note
NONE
```
2018-05-30 16:09:20 -07:00
Michael Taufen 0539086ff3 add a flag to control the cap on images reported in node status
While I normally try to avoid adding flags, this is a short term
scalability fix for v1.11, and there are other long-term solutions in
the works, so we shouldn't commit to this in the v1beta1 Kubelet config.
Flags are our escape hatch.
2018-05-30 12:54:30 -07:00
Kubernetes Submit Queue dd13969924
Merge pull request #64269 from kad/kubeadm-834
Automatic merge from submit-queue (batch tested with PRs 64318, 64269, 64438, 64516, 64311). 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>.

UX improvement for preflight check for external etcd client certificates

**What this PR does / why we need it**:
UX improvement for preflight check for external etcd client certificates

By using same preflight check label for all etcd client certificates, it will
allow user to use single identifier, and as result shorter command line
arguments to kubeadm, in case multiple issues found with those files.

Fixes: 

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

**Special notes for your reviewer**:

**Release note**:
```release-note
Label ExternalEtcdClientCertificates can be used for ignoring all preflight check issues related to client certificate files for external etcd.
```
2018-05-30 11:25:16 -07: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
Kubernetes Submit Queue 31815fc81e
Merge pull request #64210 from luxas/kubeadm_kubelet_extraargs
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: Move .NodeName and .CRISocket to a common sub-struct

**What this PR does / why we need it**:
Regroups some common fields for `kubeadm init` and `kubeadm join` only used for the initial node registration.
Lets the user specify ExtraArgs to the kubelet.
Now also runs the dynamic env file creation for `kubeadm join`.

**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/847
Follows-up https://github.com/kubernetes/kubernetes/pull/63887
Related to kubernetes/kubeadm#822

**Special notes for your reviewer**: WIP, but please review so we can finalize the direction of the PR

**Release note**:

```release-note
[action required] `.NodeName` and `.CRISocket` in the `MasterConfiguration` and `NodeConfiguration` v1alpha1 API objects are now `.NodeRegistration.Name` and `.NodeRegistration.CRISocket` respectively in the v1alpha2 API. The `.NoTaintMaster` field has been removed in the v1alpha2 API.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-30 10:09:07 -07:00
Kubernetes Submit Queue 1bb6fa848c
Merge pull request #64322 from bart0sh/PR0014-fix-parsing-crictl-pods
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 parsing 'crictl pods -q' output

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

fix parsing 'crictl pods -q' output
Output of crictl pods -q is a list of running pod ids, one id per line.
Current code splits this output incorrectly which makes next command
'crictl stopp' fail if there is more than one pod running.

Should be fixed by using strings.Fields instead of strings.Split.

**Release note**:
```release-note
NONE
```
2018-05-30 09:59:24 -07:00
Kubernetes Submit Queue a2d8636559
Merge pull request #64316 from krzysied/scheduling_latency_metric
Automatic merge from submit-queue (batch tested with PRs 63328, 64316, 64444, 64449, 64453). 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 scheduling latency metrics

**What this PR does / why we need it**:
Allows to measure and to display scheduling latency metrics during tests. Provides new functionality of resetting scheduler latency metrics.

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

**Special notes for your reviewer**:
E2eSchedulingLatency, SchedulingAlgorithmLatency, BindingLatency are now available 
as subtypes of OperationLatency.

**Release note**:

```release-note
NONE
```
2018-05-30 08:42:16 -07:00
Krzysztof Siedlecki 0e833bfc83 Fixing scheduling latency metrics 2018-05-30 11:20:12 +02: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
Victor Garcia 3dfa22e3fd Possible cipher suites values and tls versions in help for apiserver and kubelet 2018-05-29 22:23:07 -07:00
m1093782566 674a31e4d6 remove ipvs feature gateway 2018-05-30 10:43:16 +08: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
Kubernetes Submit Queue 8ad67d3437
Merge pull request #63068 from xmudrii/fix-62725
Automatic merge from submit-queue (batch tested with PRs 64258, 63068). 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 Establishing Controller to avoid race between Established condition and CRs actually served

**What this PR does / why we need it**: If you create CR shorty after CRD, it can happen that it returns error that CRD doesn't exists, even if it exists and is Established. This implements the Establishing Controller, is used to Establish CRD once we're sure it's ready and CRs are served. For more details, check issue #62725.

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

```release-note
Add Establishing Controller on CRDs to avoid race between Established condition and CRs actually served. In HA setups, the Established condition is delayed by 5 seconds.
```

/sig api-machinery
/area custom-resources
/cc sttts deads2k
2018-05-29 06:58:14 -07:00
Kubernetes Submit Queue af45e9cdc4
Merge pull request #64258 from rajansandeep/bumpmanifest
Automatic merge from submit-queue (batch tested with PRs 64258, 63068). 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>.

Update the CoreDNS version and manifest

**What this PR does / why we need it**:
Bumps CoreDNS to 1.1.3 and updates manifest

**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 is now v1.1.3
```
2018-05-29 06:58:10 -07:00
Kubernetes Submit Queue e3a4104479
Merge pull request #64105 from chuckha/prepull-images
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: Pull images early in `kubeadm init` by default

kubeadm now pulls container images before the init step.

* This commit also fixes a dependency cycle

**What this PR does / why we need it**:
This PR adds a check to kubeadm preflight checks that pulls images down before kubeadm tries to run them so boot up time of containers does not have to pull.

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

**Special notes for your reviewer**:
The interface stuff is to remove a dependency cycle where utils pulled in preflight and preflight pulled in utils. I do not think this utils package should be importing preflight.

**Release note**:

```release-note
kubeadm will pull required images during preflight checks if it cannot find them on the system
```
2018-05-29 05:16:47 -07:00
Marko Mudrinić 2bf66c377d
apiextensions-apiserver: add establishing controller to avoid race between established and CRs actually served 2018-05-29 13:46:47 +02:00
Kubernetes Submit Queue 046619f3ae
Merge pull request #64274 from neolit123/kubeadm-alpha-phase-addon
Automatic merge from submit-queue (batch tested with PRs 64308, 64367, 64165, 64274). 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: rename the `kube-dns` phases addon

**What this PR does / why we need it**:
The command `kubeadm alpha phases addon` has a property
called `kube-dns` which would install kube-dns, pre 1.11.

In the case of 1.11 this property will install CoreDNS,
because the property is also bound to the `CoreDNS` feature gate,
which is now `true` by default.

Fix that by renaming the property to `coredns`, updating the Cobra
info and also updating the unit tests.

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

**Special notes for your reviewer**:
Please verify if we are OK with the "hard rename".

**Release note**:

```release-note
kubeadm: rename the addon parameter `kube-dns` to `coredns` for `kubeadm alpha phases addons` as CoreDNS is now the default DNS server in 1.11.
```

@kubernetes/sig-cluster-lifecycle-pr-reviews 
/area kubeadm
2018-05-28 18:20:14 -07:00
Kubernetes Submit Queue c56e0496c5
Merge pull request #64165 from neolit123/admission-control
Automatic merge from submit-queue (batch tested with PRs 64308, 64367, 64165, 64274). 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: do not use --admission-control for the API server

**What this PR does / why we need it**:
The API server argument --admission-control is deprecated.
Use the following arguments instead:
  --enable-admission-plugins=NodeRestriction
  --disable-admission-plugins=PersistentVolumeLabel

Add comment that PersistentVolumeLabel should be removed at some
point in 1.11.

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

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
kubeadm: when starting the API server use the arguments --enable-admission-plugins and --disable-admission-plugins instead of the deprecated --admission-control.
```

@luxas
@kubernetes/sig-cluster-lifecycle-pr-reviews 
/area kubeadm
2018-05-28 18:20:11 -07:00
Kubernetes Submit Queue 0125edb460
Merge pull request #64396 from rosti/local-loadpodfromfile
Automatic merge from submit-queue (batch tested with PRs 64399, 64324, 64404, 64406, 64396). 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 loadPodSpecFromFile instead of LoadPodFromFile

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



**What this PR does / why we need it**:
Implement and use loadPodSpecFromFile which loads and returns PodSpec object
from YAML or JSON file. Use this function in the places where LoadPodFromFile
is used to load Pod object and then return the PodSpec portion of it. This
also removes the dependency on //pkg/volume/util and its dependencies (thus,
making kubeadm more lean).

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

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

**Release note**:

```release-note
NONE
```
2018-05-28 15:06:27 -07:00
Kubernetes Submit Queue 6571310141
Merge pull request #63532 from hzxuzhonghu/scheduler-not-depend-kubectl
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>.

kube-proxy and kube-scheduler should not depend on pkg/kubectl

remove dependent on pkg/kubectl/cmd/util in kube-proxy and kube-scheduler

**Release note**:

```release-note
NONE
```
2018-05-28 10:12:30 -07:00
Rostislav M. Georgiev a4e0659815 kubeadm: Use loadPodSpecFromFile instead of LoadPodFromFile
Implement and use loadPodSpecFromFile which loads and returns PodSpec object
from YAML or JSON file. Use this function in the places where LoadPodFromFile
is used to load Pod object and then return the PodSpec portion of it. This
also removes the dependency on //pkg/volume/util and its dependencies (thus,
making kubeadm more lean).

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-05-28 15:25:37 +03:00
Alexander Kanevskiy c798dfc88d UX improvement for preflight check for external etcd client certificates
By using same preflight check label for all etcd client certificates, it will
allow user to use single identifier, and as result shorter command line
arguments to kubeadm, in case multiple issues found with those files.

Fixes: kubernetes/kubeadm#834
2018-05-28 14:49:22 +03:00
Lubomir I. Ivanov 8d84ef63ad kubeadm: do not use --admission-control for the API server
The API server argument --admission-control is deprecated.
Use the following arguments instead:
  --enable-admission-plugins=NodeRestriction
  --disable-admission-plugins=PersistentVolumeLabel

Add comment that PersistentVolumeLabel should be removed at some
point in 1.11.
2018-05-27 01:35:52 +03:00
Xianglin Gao 6d95bb3fa0
Improve the help of kubeadm completion 2018-05-27 00:25:10 +08:00
Kubernetes Submit Queue da7a2b7804
Merge pull request #64304 from Random-Liu/fix-log-rotation-flag
Automatic merge from submit-queue (batch tested with PRs 62984, 64304). 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 alpha feature warning for log rotation flags.

CRI container log rotation is beta now.

@yujuhong /cc @mtaufen @kubernetes/sig-node-pr-reviews 
Signed-off-by: Lantao Liu <lantaol@google.com>

**Release note**:

```release-note
none
```
2018-05-26 03:42:06 -07:00
Kubernetes Submit Queue 5e88401cb3
Merge pull request #63859 from frobware/signal-fun
Automatic merge from submit-queue (batch tested with PRs 63859, 63979). 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 signal handler registration from pkg/kubelet

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

The goal of this change is to remove the registration of signal
handling from pkg/kubelet (i.e., library code). 
 
If you register a signal handler in `main()` to aid in a controlled
and deliberate exit then the handler registered in `pkg/kubelet` often
wins and the process exits immediately. This means all other signal
handler registrations are currently racy if `DockerServer.Start()` is
directly or indirectly invoked.

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

This change also removes another signal handler registration from
`NewAPIServerCommand()`; a stop channel is now passed to this
function.

**Release note**:
2018-05-26 00:32:08 -07:00
liz ffeca16101
Remove some unnecessarily gendered pronouns in comments 2018-05-25 17:48:17 -04: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
Ed Bartosh 25436cdc6a fix parsing 'crictl pods -q' output
Output of crictl pods -q is a list of running pod ids, one id per line.
Current code splits this output incorrectly which makes next command
'crictl stopp' fail if there is more than one pod running.

Should be fixed by using strings.Fields instead of strings.Split.
2018-05-25 21:00:24 +03:00
Ed Bartosh d38afb1367 remove CrictlChecker from preflight checks
CrictlChecker uses InPathCheck to check if crictl presents
in the PATH. The same check is done in CRICheck function.

CrictlChecker is also called unconditionally, producing messages
that can confuse users. CRICheck is called only when needed, i.e.
when user specifies CRI socket.
2018-05-25 19:25:29 +03:00
Lantao Liu d4714f5c37 Update feature warning for log rotation flags.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-05-25 02:16:01 -07:00
Kubernetes Submit Queue d7c40cf69e
Merge pull request #64275 from mtaufen/dkcfg-beta
Automatic merge from submit-queue (batch tested with PRs 63417, 64249, 64242, 64128, 64275). 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>.

graduate DynamicKubeletConfig feature to beta

Everything in the https://github.com/kubernetes/features/issues/281 beta target except a few documentation-related items is complete. Docs should be done very soon, so I'm sending this PR to graduate to beta before freeze.

```release-note
The dynamic Kubelet config feature is now beta, and the DynamicKubeletConfig feature gate is on by default. In order to use dynamic Kubelet config, ensure that the Kubelet's --dynamic-config-dir option is set. 
```

/cc @luxas
2018-05-24 20:49:22 -07:00
Andrew McDermott 9cbd54018f Remove signal handler registration from pkg/kubelet
The goal of this change is to remove the registration of signal
handling from pkg/kubelet. We now pass in a stop channel.

If you register a signal handler in `main()` to aid in a controlled
and deliberate exit then the handler registered in `pkg/kubelet` often
wins and the process exits immediately. This means all other signal
handler registrations are currently racy if `DockerServer.Start()` is
directly or indirectly invoked.

This change also removes another signal handler registration from
`NewAPIServerCommand()`; a stop channel is now passed to this
function.
2018-05-24 20:44:12 +01:00
Lubomir I. Ivanov ebc254c40f kubeadm: rename the `kube-dns` phases addon
The command `kubeadm alpha phases addon` has a property
called `kube-dns` which would install kube-dns, pre 1.11.

In the case of 1.11 this property will install CoreDNS,
because the property is also bound to the `CoreDNS` feature gate,
which is now `true` by default.

Fix that by renaming the property to `coredns`, updating the Cobra
info and also updating the unit tests.
2018-05-24 22:08:31 +03: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
Michael Taufen d4e48fd789 graduate DynamicKubeletConfig feature to beta 2018-05-24 09:59:29 -07:00
Kubernetes Submit Queue 698ac55852
Merge pull request #64187 from luxas/kubeadm_kubelet_improve_security
Automatic merge from submit-queue (batch tested with PRs 64174, 64187, 64216, 63265, 64223). 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 the kubelet default configuration security-wise

**What this PR does / why we need it**:
 - Disables the readonly port for the kubelets in the cluster
 - Enables delegated SA token authentication for the secure kubelet port (GCE also did this ref: https://github.com/kubernetes/kubernetes/pull/58178)
 - Follows up https://github.com/kubernetes/kubernetes/pull/63912 to move the last flag from the system dropin to the ComponentConfig

**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/732
Fixes https://github.com/kubernetes/kubeadm/issues/650
Replaces https://github.com/kubernetes/kubernetes/pull/57997

**Special notes for your reviewer**:
In order to make sure this actually works, or that clusters actually are secure, we're adding e2e tests for this: https://github.com/kubernetes/kubeadm/issues/838 & https://github.com/kubernetes/kubernetes/pull/64140
Depends on https://github.com/kubernetes/kubernetes/pull/63912

**Release note**:

```release-note
[action required] kubeadm: kubelets in kubeadm clusters now disable the readonly port (10255). If you're relying on unauthenticated access to the readonly port, please switch to using the secure port (10250). Instead, you can now use ServiceAccount tokens when talking to the secure port, which will make it easier to get access to e.g. the `/metrics` endpoint of the kubelet securely.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews 
@kubernetes/sig-auth-pr-reviews FYI
2018-05-24 09:41:13 -07:00
Kubernetes Submit Queue fa354b3f68
Merge pull request #64174 from liggitt/correct-openapi-extensions
Automatic merge from submit-queue (batch tested with PRs 64174, 64187, 64216, 63265, 64223). 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>.

Correctly identify types served in the kube-apiserver openapi doc

Fixes https://github.com/kubernetes/kubernetes/issues/52741

Split out from https://github.com/kubernetes/kubernetes/pull/63893

```release-note
The kube-apiserver openapi doc now includes extensions identifying APIService and CustomResourceDefinition kinds
```
2018-05-24 09:41:09 -07:00
Sandeep Rajan 8d8b47596e update manifest
fix test
2018-05-24 09:02:16 -04:00
Kubernetes Submit Queue 195914d02a
Merge pull request #64013 from hzxuzhonghu/rm-duplicate
Automatic merge from submit-queue (batch tested with PRs 64013, 63896, 64139, 57527, 62102). 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>.

kubectl uses its own pkg/kubectl/util/logs

kubectl uses its own logs instead of  `staging/src/k8s.io/apiserver/pkg/util/logs`

**Release note**:

```release-note
NONE
```
2018-05-23 19:44:12 -07:00
Kubernetes Submit Queue 5fe35cdbf9
Merge pull request #61419 from enisoc/apps-v1-deploy
Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). 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 apps/v1 Deployment/ReplicaSet in controller and kubectl

This updates the Deployment controller and integration/e2e tests to use apps/v1, as part of #55714.

This also requires updating any other components that use the `deployment/util` package, most notably `kubectl`. That means client versions 1.11 and above will only work with server versions 1.9 and above. This is well within our client-server version skew policy of +/-1 minor version.

However, this PR *only* updates the parts of `kubectl` that used `deployment/util`. So although kubectl now requires apps/v1, it still also depends on extensions/v1beta1. Migrating other parts of kubectl to apps/v1 is beyond the scope of this PR, which was just to change the Deployment controller and fix all the fallout.

```release-note
kubectl: This client version requires the `apps/v1` APIs, so it will not work against a cluster version older than v1.9.0. Note that kubectl only guarantees compatibility with clusters that are +/-1 minor version away.
```
2018-05-23 18:14:13 -07:00
Kubernetes Submit Queue 42d65671eb
Merge pull request #63862 from runcom/fix-reset-crictl
Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). 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: crictl reset commands fixes

Signed-off-by: Antonio Murdaca <runcom@redhat.com>



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

change container stop/rm commands with sandbox stop/rm to properly reset using 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 https://github.com/kubernetes/kubeadm/issues/748

**Special notes for your reviewer**:

**Release note**:

```release-note
Correct the way we reset containers and pods in kubeadm via crictl
```
2018-05-23 18:14:09 -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 2d0efea35b
autogenerated 2018-05-23 21:13:42 +03:00
Lucas Käldström 099e60b1db
kubeadm: Refactor the .Etcd substruct in the v1alpha2 API 2018-05-23 21:13:32 +03:00
Kubernetes Submit Queue 65a819338a
Merge pull request #64177 from stewart-yu/stewart-kubeadconfigimage
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 flag for command

**What this PR does / why we need it**:
add missing flag for `kubeadm config images pull` command

**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 @luxas 
/cc @chuckha 

**Release note**:

```release-note
NONE
```
2018-05-23 10:07:13 -07:00
Kubernetes Submit Queue d4c314daaa
Merge pull request #64191 from stewart-yu/stewart-ctr-codeclean
Automatic merge from submit-queue (batch tested with PRs 59851, 64114, 63912, 64156, 64191). 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>.

smaller code clean for cloud-controller manager

**What this PR does / why we need it**:
As  PR [https://github.com/kubernetes/kubernetes/pull/63283](https://github.com/kubernetes/kubernetes/pull/63283) nits, do some code clean for `cloud-controller manager`.

**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 @luxas 

**Release note**:

```release-note
NONE
```
2018-05-23 09:06:23 -07:00
Kubernetes Submit Queue 02818ed092
Merge pull request #63912 from luxas/move_rotatecerts_kubelet
Automatic merge from submit-queue (batch tested with PRs 59851, 64114, 63912, 64156, 64191). 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: Move RotateCertificates to the KubeletConfiguration struct

**What this PR does / why we need it**:
Moves `.RotateCertificates` to the `KubeletConfiguration` struct, so it can be configured via the Config file smoothly.

**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/kubernetes/issues/63878
Fixes https://github.com/kubernetes/kubernetes/issues/61653

**Special notes for your reviewer**:
Pretty similar to https://github.com/kubernetes/kubernetes/pull/62352

**Release note**:

```release-note
The kubelet certificate rotation feature can now be enabled via the `.RotateCertificates` field in the kubelet's config file. The `--rotate-certificates` flag is now deprecated, and will be removed in a future release.
```
@kubernetes/sig-node-pr-reviews @kubernetes/sig-cluster-lifecycle-pr-reviews
2018-05-23 09:06:15 -07:00
stewart-yu be7f087ade do some code clean for cloud-controller manager 2018-05-23 17:28:02 +08:00
Jan Safranek 9b74125440 Pass Nsenter to NsenterMounter and NsenterWriter
So Nsenter is initialized only once and with the right parameters.
2018-05-23 10:21:21 +02:00
Jan Safranek a8a37fb714 Created directories in /var/lib/kubelet directly. 2018-05-23 10:21:21 +02:00
stewart-yu 54d8466c71 add missing flag for kubeadm config images pull command 2018-05-23 16:12:37 +08:00
stewart-yu 956bbfd1a6 should not ignore err when convert controllermanagerconfiguration api 2018-05-23 13:14:04 +08:00
Kubernetes Submit Queue 190ef1e01e
Merge pull request #63283 from stewart-yu/stewart-cleancontroller
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>.

split the generic component config and options into a kube and cloud part

**What this PR does / why we need it**:
Summary ideas:
1. Moving some substruct shared by both `kube-controller manager` and `cloud-controller manager` in `KubeControllerManagerConfiguration` struct into `GenericControllerManagerConfiguration` struct, and keep `KubeControllerManagerConfiguration` struct;
2. Construct a new `CloudControllerManagerConfiguration` struct  for `cloud-controller manager`.

As  an follow-up of [https://github.com/kubernetes/kubernetes/pull/60270](https://github.com/kubernetes/kubernetes/pull/60270).

**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-22 21:36:05 -07:00
Jordan Liggitt 43551e8208
Correctly identify types served in the kube-apiserver openapi doc 2018-05-22 20:57:18 -04:00
Kubernetes Submit Queue 773ced14ce
Merge pull request #63887 from luxas/kubeadm_kubelet_integration
Automatic merge from submit-queue (batch tested with PRs 63914, 63887, 64116, 64026, 62933). 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: Write kubelet config file to disk and persist in-cluster

**What this PR does / why we need it**:
In order to make configuration flow from the cluster level to node level, we need a way for kubeadm to tell the kubelet what config to use. As of v1.10 (I think) the kubelet can read `--config` using the kubelet Beta ComponentConfiguration API, so now we have an interface to talk to the kubelet properly.

This PR:
 - Writes the kubelet ComponentConfig to `/var/lib/kubelet/config.yaml` on init and join
 - Writes an environment file to source in the kubelet systemd dropin `/var/lib/kubelet/kubeadm-flags.env`. This file contain runtime flags that should be passed to the kubelet.
 - Uploads a ConfigMap with the name `kubelet-config-1.X`
 - Patches the node object so that it starts using the ConfigMap with updates using Dynamic Kubelet Configuration, **only if the feature gate is set** (currently alpha and off by default, not intended to be switched on in v1.11)
 - Updates the phase commands to reflect this new flow

The kubelet dropin file I used now looks like this:
```
# v1.11.x dropin as-is at HEAD
# /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
---
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
EnvironmentFile-=/var/lib/kubelet/kubeadm-flags.env
# Should default to 0 in v1.11: https://github.com/kubernetes/kubernetes/pull/63881, and hence not be here in the real v1.11 manifest
Environment="KUBELET_CADVISOR_ARGS=--cadvisor-port=0"
# Should be configurable via the config file: https://github.com/kubernetes/kubernetes/issues/63878, and hence be configured using the file in v1.11
Environment="KUBELET_CERTIFICATE_ARGS=--rotate-certificates=true"
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_CADVISOR_ARGS $KUBELET_CERTIFICATE_ARGS $KUBELET_EXTRA_ARGS
---
# v1.11.x dropin end goal
# /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
---
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
EnvironmentFile-=/var/lib/kubelet/kubeadm-flags.env
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS
---
# Environment file dynamically created at runtime by "kubeadm init"
# /var/lib/kubelet/kubeadm-flags.env
KUBELET_KUBEADM_ARGS=--cni-bin-dir=/opt/cni/bin --cni-conf-dir=/etc/cni/net.d --network-plugin=cni
```

**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/822
Fixes https://github.com/kubernetes/kubeadm/issues/571

**Special notes for your reviewer**:

**Release note**:

```release-note
"kubeadm init" now writes a structured and versioned kubelet ComponentConfiguration file to `/var/lib/kubelet/config.yaml` and an environment file with runtime flags (you can source this file in the systemd kubelet dropin) to `/var/lib/kubelet/kubeadm-flags.env`.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @mtaufen
2018-05-22 17:36:12 -07:00
Lucas Käldström 2590e127f9
kubelet: Move RotateCertificates to the KubeletConfiguration struct 2018-05-23 00:19:11 +03:00
Anthony Yeh e32a15558b
Use apps/v1 in Deployment controller. 2018-05-22 13:42:10 -07:00
Kubernetes Submit Queue 10b8665a1c
Merge pull request #63991 from neolit123/test-upgrade-diff
Automatic merge from submit-queue (batch tested with PRs 62025, 63851, 64077, 63967, 63991). 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 unit tests to `kubeadm upgrade diff` and small improvements

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

has a couple of commits:

I.
```
1) Store the io.Writer and pass it to sub-commands in upgrade.go
2) Check if the manifest path is an empty string in diff.go:runDiff()
3) Use the io.Writer that upgrade.go defines instead of writing to
os.Stdout directly.
```
II.
```
Add the file diff_test.go, which has a single test:
  TestRunDiff

The test covers most error cases for the runDiff() function,
and also performs a valid diff.
```


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

**Special notes for your reviewer**:
@liztio @luxas 

**Release note**:

```release-note
NONE
```
2018-05-22 08:40:30 -07:00
Kubernetes Submit Queue e85b81bbee
Merge pull request #59566 from stewart-yu/ipvsGAkubeadm
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>.

Automatically load ipvs required kernel modules in kubeadm

**What this PR does / why we need it**:
This PR is part of [https://github.com/kubernetes/kubernetes/issues/59402](https://github.com/kubernetes/kubernetes/issues/59402), aiming to load kernel modules 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 #[https://github.com/kubernetes/kubernetes/issues/59402](https://github.com/kubernetes/kubernetes/issues/59402)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-22 02:52:16 -07: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
xuzhonghu 46d8cf23ef kubectl use its own logs 2018-05-22 11:35:38 +08:00
stewart-yu 5f4025c029 auto generated file 2018-05-22 11:20:47 +08:00
stewart-yu 2f7941dd08 load kernel modules required by IPVS in kubeadm 2018-05-22 11:20:47 +08:00
Kubernetes Submit Queue 2a989c60ff
Merge pull request #63221 from mtaufen/dkcfg-live-configmap
Automatic merge from submit-queue (batch tested with PRs 63881, 64046, 63409, 63402, 63221). 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 responds to ConfigMap mutations for dynamic Kubelet config

This PR makes dynamic Kubelet config easier to reason about by leaving less room for silent skew scenarios. The new behavior is as follows:
- ConfigMap does not exist: Kubelet reports error status due to missing source
- ConfigMap is created: Kubelet starts using it
- ConfigMap is updated: Kubelet respects the update (but we discourage this pattern, in favor of incrementally migrating to a new ConfigMap)
- ConfigMap is deleted: Kubelet keeps using the config (non-disruptive), but reports error status due to missing source
- ConfigMap is recreated: Kubelet respects any updates (but, again, we discourage this pattern)

This PR also makes a small change to the config checkpoint file tree structure, because ResourceVersion is now taken into account when saving checkpoints. The new structure is as follows:
```
- dir named by --dynamic-config-dir (root for managing dynamic config)
| - meta
  | - assigned (encoded kubeletconfig/v1beta1.SerializedNodeConfigSource object, indicating the assigned config)
  | - last-known-good (encoded kubeletconfig/v1beta1.SerializedNodeConfigSource object, indicating the last-known-good config)
| - checkpoints
  | - uid1 (dir for versions of object identified by uid1)
    | - resourceVersion1 (dir for unpacked files from resourceVersion1)
    | - ...
  | - ...
```


fixes: #61643

```release-note
The dynamic Kubelet config feature will now update config in the event of a ConfigMap mutation, which reduces the chance for silent config skew. Only name, namespace, and kubeletConfigKey may now be set in Node.Spec.ConfigSource.ConfigMap. The least disruptive pattern for config management is still to create a new ConfigMap and incrementally roll out a new Node.Spec.ConfigSource.
```
2018-05-21 17:05:42 -07:00
Kubernetes Submit Queue 6d510f52f2
Merge pull request #63409 from mtaufen/kc-validation-feature-gates
Automatic merge from submit-queue (batch tested with PRs 63881, 64046, 63409, 63402, 63221). 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 config: Validate new config against future feature gates

This fixes an issue with KubeletConfiguration validation, where the             
feature gates set by the new config were not taken into account.                
                                                                                
Also fixes a validation issue with dynamic Kubelet config, where flag           
precedence was not enforced prior to dynamic config validation in the           
controller; this prevented rejection of dynamic configs that don't merge        
well with values set via legacy flags. 

Fixes #63305 

```release-note
NONE
```
2018-05-21 17:05:34 -07:00
Kubernetes Submit Queue 99e9db5815
Merge pull request #63881 from luxas/disable_cadvisor_default
Automatic merge from submit-queue (batch tested with PRs 63881, 64046, 63409, 63402, 63221). 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>.

Disable the public cadvisor port by default

**What this PR does / why we need it**:
Quoting @tallclair in #56523:
> We should add the deprecation warning in 1.10 along with a release note, but not change the default. The notes should warn that the default will change in 1.11. We disable the flag by default in 1.11, and remove it entirely in 1.12 or 1.13.
> If you currently depend on the UI or the API, speak up! Going forward, the recommended way of taking advantage of those features will be to run cAdvisor as a DaemonSet.

Disabling the publicly-available cAdvisor port is beneficial for security, as you might not want to expose the UI with lots of information about what your system is doing. We already did this for all kubeadm deployments in v1.7, and haven't recieved any issues for that. This should be okay to do at this stage, as this flag was deprecated in v1.10. Given we need to support this flag for one more release (v1.11), it makes perfect sense to instead switch it off in preparation for v1.12 when we can delete it (see the [deprecation policy](https://kubernetes.io/docs/reference/deprecation-policy/#deprecating-a-flag-or-cli))

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

**Special notes for your reviewer**:

I removed the e2e test that expects cAdvisor to be running, as we don't expect it to be anymore.

**Release note**:

```release-note
[action required] The formerly publicly-available cAdvisor web UI that the kubelet ran on port 4194 by default is now turned off by default. The flag configuring what port to run this UI on `--cadvisor-port` was deprecated in v1.10. Now the default is `--cadvisor-port=0`, in other words, to not run the web server. The recommended way to run cAdvisor if you still need it, is via a DaemonSet. The `--cadvisor-port` will be removed in v1.12
```
cc @kubernetes/sig-cluster-lifecycle-pr-reviews @kubernetes/sig-auth-pr-reviews @kubernetes/sig-node-pr-reviews
2018-05-21 17:05:27 -07:00
Lubomir I. Ivanov f93d064e93 kubeadm-upgrade: add unit tests for the diff command
Add the file diff_test.go, which has a single test:
  TestRunDiff

The test covers most error cases for the runDiff() function,
and also performs a valid diff.

A couple of test files are added in:
cmd/kubeadm/app/cmd/upgrade/testdata/
2018-05-22 00:25:16 +03:00
Lubomir I. Ivanov 5adee74000 kubeadm-upgrade: small improvements to diff
1) Store the io.Writer and pass it to sub-commands in upgrade.go
2) Check if the manifest path is an empty string in diff.go:runDiff()
3) Use the io.Writer that upgrade.go defines instead of writing to
os.Stdout directly.
2018-05-21 23:49:06 +03:00
Michael Taufen b5648c3f61 dynamic Kubelet config reconciles ConfigMap updates 2018-05-21 09:03:58 -07:00
Lucas Käldström ddca1be88c
kubeadm: Remove .ImagePullPolicy 2018-05-21 09:20:11 +03:00
Lucas Käldström 687fe22a6b
autogenerated 2018-05-21 08:49:58 +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
Michael Taufen 647e90341c Kubelet config: Validate new config against future feature gates
This fixes an issue with KubeletConfiguration validation, where the
feature gates set by the new config were not taken into account.

Also fixes a validation issue with dynamic Kubelet config, where flag
precedence was not enforced prior to dynamic config validation in the
controller; this prevented rejection of dynamic configs that don't merge
well with values set via legacy flags.
2018-05-20 13:15:59 -07:00
Kubernetes Submit Queue 8ea1d92d73
Merge pull request #63879 from lalyos/kubeadm-authz-extra-args-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: Fix how kubeadm handles `.AuthorizationModes` and `.APIServerExtraArgs`

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

If _authorization-mode_ is configured as `--apiserver-extra-args` for kubeadm, than 
_authorization-mode_ argument gets duplicated in the static pod manifest file.

```
$ kubeadm alpha phase controlplane apiserver --apiserver-extra-args authorization-mode=AlwaysAllow
$ grep authorization-mode /etc/kubernetes/manifests/kube-apiserver.yaml
     - --authorization-mode=AlwaysAllow
    - --authorization-mode=Node,RBAC
```

**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 @fabriziopandini
2018-05-20 13:05:10 -07:00
Kubernetes Submit Queue 2f1d0e15be
Merge pull request #63917 from luxas/kubeadm_add_api_unit_tests
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 roundtrip, defaulting, upgrading and validation unit tests for the kubeadm API types

**What this PR does / why we need it**:
Follows up from https://github.com/kubernetes/kubernetes/pull/63799, as well as net-new unit testing for our serialization/deserialization package. This tests our API machinery pretty much end to end.

This is more important now given we now support two external types: https://github.com/kubernetes/kubernetes/pull/63788

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

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-19 21:52:07 -07:00
lalyos d95c7779de kubeadm: APIServerExtraArgs should override defaultArguments 2018-05-19 23:56:27 +02:00
Kubernetes Submit Queue e04ccf5526
Merge pull request #63962 from hzxuzhonghu/fix-scheduler-options
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 little bug in kube-scheduler options

fix some little bugs in kube-scheduler options. 

**Release note**:

```release-note
NONE
```
2018-05-19 07:59:06 -07: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 6187898b60
Merge pull request #64008 from dixudx/fix_kubeadm_get_branch
Automatic merge from submit-queue (batch tested with PRs 60012, 63692, 63977, 63960, 64008). 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>.

uses a more resilient way to get branch name from version

**What this PR does / why we need it**:
Currently `getBranchFromVersion` uses a hard coded way to extract branch name from the version string. This is error prone, especially when bumping the minimum supported k8s version from v1.9 to v1.10.

This follow-up PR tries to use a more resilient way to handle this.

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

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

**Release note**:

```release-note
None
```
2018-05-18 23:35:26 -07:00
Kubernetes Submit Queue ddf551c24b
Merge pull request #60012 from atlassian/dial-with-context
Automatic merge from submit-queue (batch tested with PRs 60012, 63692, 63977, 63960, 64008). 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 Dial with context

**What this PR does / why we need it**:
`net/http/Transport.Dial` field is deprecated:
```go
// DialContext specifies the dial function for creating unencrypted TCP connections.
// If DialContext is nil (and the deprecated Dial below is also nil),
// then the transport dials using package net.
DialContext func(ctx context.Context, network, addr string) (net.Conn, error)

// Dial specifies the dial function for creating unencrypted TCP connections.
//
// Deprecated: Use DialContext instead, which allows the transport
// to cancel dials as soon as they are no longer needed.
// If both are set, DialContext takes priority.
Dial func(network, addr string) (net.Conn, error)
```
This PR switches all `Dial` usages to `DialContext`. Fixes #63455.

**Special notes for your reviewer**:
Also related: https://github.com/kubernetes/kubernetes/pull/59287 https://github.com/kubernetes/kubernetes/pull/58532 https://github.com/kubernetes/kubernetes/issues/815 https://github.com/kubernetes/community/pull/1166 https://github.com/kubernetes/kubernetes/pull/58677 https://github.com/kubernetes/kubernetes/pull/57932

**Release note**:
```release-note
HTTP transport now uses `context.Context` to cancel dial operations. k8s.io/client-go/transport/Config struct has been updated to accept a function with a `context.Context` parameter. This is a breaking change if you use this field in your code.
```
/sig api-machinery
/kind enhancement
/cc @sttts
2018-05-18 23:35:13 -07:00
Kubernetes Submit Queue b056924c2e
Merge pull request #63973 from rosti/remove-internalclientset
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>.

kubeadm: Remove dependency on pkg/client/clientset_generated/internalclientset

**What this PR does / why we need it**:
This PR removes dependency in kubeadm on `pkg/client/clientset_generated/internalclientset` and blacklists it in `.import-restrictions`.
The above package is pulled in transitively by the usage of the following:

- [GetFlagString](a481f4bbe8/cmd/kubeadm/app/cmd/version.go (L63)) from `k8s.io/kubernetes/pkg/kubectl/cmd/util`

- [LeaseEndpointReconcilerType](a481f4bbe8/cmd/kubeadm/app/phases/controlplane/manifests.go (L205)) from `k8s.io/kubernetes/pkg/master/reconcilers`

Dropping the unneeded dependencies from the build shaves off 4-5MB from the amd64 executable and reduces the dependency hell 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#806

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

**Release note**:
```release-note
NONE
```
2018-05-18 15:59:22 -07: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
Mikhail Mazurskiy 5e8e570dbd
Use Dial with context 2018-05-19 08:14:37 +10:00
Kubernetes Submit Queue 53fd0b4135
Merge pull request #63980 from detiber/externalEtcdFixes
Automatic merge from submit-queue (batch tested with PRs 63569, 63918, 63980, 63295, 63989). 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 static pod etcd

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

This PR fixes a regression introduced by https://github.com/kubernetes/kubernetes/pull/63495 which broke kubeadm upgrades for installations using a static pod etcd.

**Release note**:
```release-note
NONE
```
2018-05-18 09:54:18 -07:00
Di Xu bde4fdf258 uses a more resilient way to get branch name from version 2018-05-18 21:32:23 +08:00
Antonio Murdaca 0fec56c946
kubeadm: crictl reset commands fixes
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2018-05-18 15:06:35 +02:00
Rostislav M. Georgiev 8a80c88547 kubeadm: Restrict imports from pkg/client/clientset_generated/internalclientset
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-05-18 12:14:55 +03:00
Rostislav M. Georgiev b37ae19b05 kubeadm: Add local copy of LeaseEndpointReconcilerType
kubeadm uses LeaseEndpointReconcilerType as import from
k8s.io/kubernetes/pkg/master/reconcilers. However, this pull a huge
load of extra dependencies (among which
pkg/client/clientset_generated/internalclientset). The solution is
to copy this string constant locally in kubeadm.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-05-18 12:14:39 +03:00
Kubernetes Submit Queue 6c7fb87cb6
Merge pull request #63920 from dixudx/kubeadm-support-version
Automatic merge from submit-queue (batch tested with PRs 63920, 63716, 63928, 60553, 63946). 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>.

Update kubeadm's minimum supported Kubernetes in v1.11.x to 1.10

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

* Restricts supported Kubernetes version in 1.11 cycle;
* Removes useless v190-specific variables, since the minimum version is v1.10;
* Bumps etcd version based on k8s version to 1.10.X => 3.1.12, 1.11.X => 3.2.18, 1.12.X => 3.2.18;

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

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

```release-note
Update kubeadm's minimum supported kubernetes in v1.11.x to 1.10
```
2018-05-18 01:07:12 -07:00
stewart-yu 3d20f1a99c auto generated file 2018-05-18 10:23:38 +08:00
stewart-yu f21475ac95 modify kube-controller manager config struct to adapt option change 2018-05-18 10:23:38 +08:00
stewart-yu 14f7b959ff modify cloud-controller manager config struct to adapt option change 2018-05-18 10:23:38 +08:00
stewart-yu bbb48fd068 [kube-controller manager]get rid of GenericControllerManagerOptions sub-struct 2018-05-18 10:23:38 +08:00
stewart-yu 2a8d258f66 [cloud-controller manager]get rid of GenericControllerManagerOptions sub-struct 2018-05-18 10:23:38 +08:00
xuzhonghu 6ad56325ca kube-proxy should not depend on kubectl 2018-05-18 09:24:38 +08: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 215184b923
Add a 'kubeadm config print-default' command 2018-05-17 16:19:26 +01: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 9633d00414
autogenerated 2018-05-17 15:05:28 +01:00
Lucas Käldström e0a83301d8
kubeadm: Remove the never-used .Etcd.SelfHosted field 2018-05-17 15:05:16 +01:00
Rostislav M. Georgiev 9cef24901d kubeadm: Avoid unneeded dependencies by not using GetFlagString
Using GetFlagString from k8s.io/kubernetes/pkg/kubectl/cmd/util
causes pkg/client/clientset_generated/internalclientset to be pulled
as an external dependency, thus producing larger executable and
increasing the maintainance hell.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2018-05-17 16:57:23 +03:00
Di Xu c3fad6ec12 fix error tests due to version bumping of etcd and supported k8s 2018-05-17 20:49:12 +08:00
Di Xu 563c997939 Bump etcd version based on k8s version to 1.10.X => 3.1.12, 1.11.X => 3.2.18, 1.12.X => 3.2.18 2018-05-17 20:32:25 +08:00
Di Xu fcc335c880 Remove v190alpha3 2018-05-17 20:32:25 +08:00
Di Xu 9d4021b80f Rename v180AndAboveKubeDNSDeployment to KubeDNSDeployment 2018-05-17 20:32:24 +08:00
Di Xu 2ef8157644 remove v190 from kubeadm in v1.11 cycle 2018-05-17 20:32:24 +08:00
Di Xu 95b4ce0b3c Update kubeadm's minimum supported kubernetes in v1.11.x to 1.10 2018-05-17 20:32:23 +08:00
xuzhonghu be2a234af5 fix little bug in kube-scheduler options 2018-05-17 16:59:39 +08:00
Kubernetes Submit Queue 2fda6e5e7a
Merge pull request #63930 from liztio/kubeadm-init-diff
Automatic merge from submit-queue (batch tested with PRs 63865, 57849, 63932, 63930, 63936). 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 `kubeadm init diff`

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

Some users want to see the changes `kubeadm` woulda apply before actually running `kubeadm upgrade apply`. This shows the changes that will be made to the static pod manifests before applying them. This is a narrower case than `kubeadm upgrade apply --dry-run`, which specifically focuses on the static pod manifests.

**Which issue(s) this PR fixes**:
Part of [kubeadm/489](https://github.com/kubernetes/kubeadm/issues/489#issuecomment-388974795)

**Special notes for your reviewer**:

**Release note**:

```release-note
adds the `kubeadm upgrade diff` command to show how static pod manifests will be changed by an upgrade.
```
2018-05-17 00:28:26 -07:00
Kubernetes Submit Queue 0519170e26
Merge pull request #63865 from bart0sh/PR0013-kubeadm-minor-fixes
Automatic merge from submit-queue (batch tested with PRs 63865, 57849, 63932, 63930, 63936). 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>.

Minor fixes for kubeadm reset

This set of fixes was proposed by @neolit123 in [PR 63849](https://github.com/kubernetes/kubernetes/pull/63849) review
comments:

- Capitalized output after [reset]
- Used %v format for Go errors
- Fixed spelling: Trying using -> Trying to use

**Release note**:
```release-note
NONE
```
2018-05-17 00:28:13 -07:00
Weibin Lin ff8b70c409 Init ipvsInterface only when ipvs modules are present 2018-05-17 15:04:20 +08:00
liz 15bbc4db6c
Add a `kubeadm upgrade diff` command
This command takes an upgrade version, and shows how the static pod manifests
will be changed by a given upgrade.
2018-05-16 15:23:33 -04:00
Kubernetes Submit Queue bef2ab3c20
Merge pull request #63866 from luxas/kubeadm_remove_cloudprovider
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: Remove the `.CloudProvider` and `.PrivilegedPods` configuration option

**What this PR does / why we need it**:
Removes the `.CloudProvider` option, it has been experimental for a long time. People should now use external cloud providers, which is beta in v1.11. Most importantly, you can get the exact same behavior in the API by utilizing the `.*ExtraArgs` and `.*ExtraVolumes` fields.
Removes `.PrivilegedPods` as that serves a super small edge case with the legacy cloud provider, and only for openstack.

**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**:
Depends on PRs:
 - [x] #63799
 - [x] #63788

**Release note**:

```release-note
[action required] In the new v1alpha2 kubeadm Configuration API, the `.CloudProvider` and `.PrivilegedPods` fields don't exist anymore.
Instead, you should use the out-of-tree cloud provider implementations which are beta in v1.11.
If you have to use the legacy in-tree cloud providers, you can rearrange your config like the example below.
If you need to use the `.PrivilegedPods` functionality, you can still edit the manifests in
`/etc/kubernetes/manifests/`, and set `.SecurityContext.Privileged=true` for the apiserver
and controller manager.
---
kind: MasterConfiguration
apiVersion: kubeadm.k8s.io/v1alpha2
apiServerExtraArgs:
  cloud-provider: "{cloud}"
  cloud-config: "{path}"
apiServerExtraVolumes:
- name: cloud
  hostPath: "{path}"
  mountPath: "{path}"
controllerManagerExtraArgs:
  cloud-provider: "{cloud}"
  cloud-config: "{path}"
controllerManagerExtraVolumes:
- name: cloud
  hostPath: "{path}"
  mountPath: "{path}"
---
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @dims @liztio
2018-05-16 12:23:16 -07:00
liz 1f4927936b
Bazel artifacts 2018-05-16 12:52:36 -04:00
Chuck Ha 7ecab96dcd
Adds a kubeadm config images pull command
This command will use crictl or docker to pull images locally.

The dockerfall back is needed because in some cases the kubelet is not
yet running so there is no CRI dockershim socket available.

Fixes kubernetes/kubeadm#812

Signed-off-by: Chuck Ha <ha.chuck@gmail.com>
2018-05-16 11:36:11 -04:00
Lucas Käldström 1b58149ad7
autogenerated 2018-05-16 15:59:15 +01:00
Lucas Käldström 05559c0404
kubeadm: Remove the .PrivilegedPods configuration option 2018-05-16 15:46:55 +01:00
Lucas Käldström adb60f4064
kubeadm: Remove the .CloudProvider configuration option 2018-05-16 15:46:34 +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
Lucas Käldström 56846a8b60
kubeadm: Add duplicated v1alpha2 API types 2018-05-16 09:43:40 +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 2fcac6abf2
Merge pull request #63314 from mtaufen/dkcfg-structured-status
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 to a structured status for dynamic kubelet config

This PR updates dynamic Kubelet config to use a structured status, rather than a node condition. This makes the status machine-readable, and thus more useful for config orchestration. 

Fixes: #56896

```release-note
The status of dynamic Kubelet config is now reported via Node.Status.Config, rather than the KubeletConfigOk node condition.
```
2018-05-15 19:41:36 -07:00
Kubernetes Submit Queue e3b0e85138
Merge pull request #63852 from hzxuzhonghu/node-controller-run-with-stopch
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>.

pass stop channel to node-controller

node controller run with stop channel passed from outside.

**Release note**:

```release-note
NONE
```
2018-05-15 18:00:41 -07:00
Kubernetes Submit Queue 6f286dbc84
Merge pull request #63872 from kad/ipforward
Automatic merge from submit-queue (batch tested with PRs 63589, 63644, 63861, 63872, 63847). 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 preflight check for IPv4 and IPv6 forwarding

**What this PR does / why we need it**: adds preflight check for IP forwarding

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

**Special notes for your reviewer**:

**Release note**:
```release-note
kubeadm now checks that IPv4/IPv6 forwarding is enabled
```
2018-05-15 17:09:17 -07:00
Kubernetes Submit Queue 67200c92bf
Merge pull request #63509 from detiber/CoreDNSDefault
Automatic merge from submit-queue (batch tested with PRs 63658, 63509, 63800, 63586, 63840). 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 - default CoreDNS FeatureGate to true

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

This PR updates kubeadm to deploy CoreDNS rather than KubeDNS by default for new installs.

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

**Release note**:
```release-note
kubeadm will now deploy CoreDNS by default instead of KubeDNS
```

Currently, this does not effect upgrades. Also, documentation updates will need to be coordinated with this change.
2018-05-15 14:23:13 -07:00
Michael Taufen fcc1f8e7b6 Move to a structured status for dynamic Kubelet config
Updates dynamic Kubelet config to use a structured status, rather than a
node condition. This makes the status machine-readable, and thus more
useful for config orchestration.

Fixes: #56896
2018-05-15 11:25:12 -07:00
Jason DeTiberus 08ba47b237
kubeadm - set CoreDNS FeatureGate to true by default 2018-05-15 14:00:00 -04:00
Sandeep Rajan 9a868b387d
bump coredns to GA in kubeadm 2018-05-15 13:59:08 -04:00
Lucas Käldström f4d0708341
Disable the public cadvisor port by default 2018-05-15 18:43:52 +01:00
Kubernetes Submit Queue 41a531317a
Merge pull request #63410 from sttts/sttts-scheduler-insecure-server-start
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>.

scheduler: remove nested retry loops and fix serving metrics under healthz server port

This PR fixes the issues of #63404:

- The Serve func for metrics and healthz does not block. Inside, there is a retry loop. This PR fixes this and gets rid of the error messages every 5 seconds.
- The separate metrics server is only to be started if it is configured on another port. Before this PR we were wrongly checking for the healthz service to be activated and then launched the metrics server instead. Because both server startups are in a go routine, they were racing against each other. If you were unlucky, the metrics endpoint was winning and it returned 404 on /healthz (while it should not have been active in the first place). The kubemark tests run the scheduler with a liveness probe which failed, restarting the scheduler after some minutes.
2018-05-15 09:54:07 -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
Alexander Kanevskiy 510ce3ce53 kubeadm preflight check for IPv4 and IPv6 forwarding
Fixes: kubernetes/kubeadm#580
2018-05-15 18:40:29 +03:00
Lucas Käldström cae656b4f9
autogenerated bazel 2018-05-15 16:36:46 +01:00
Ed Bartosh 3080b22b93 Minor fixes for kubeadm reset
This set of fixes was proposed by @neolit123 in PR 63849 review
comments:

- Capitalized output after [reset]
- Used %v format for Go errors
- Fixed spelling: Trying using -> Trying to use
2018-05-15 18:07:36 +03: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 8673c64d09
Merge pull request #63811 from chuckha/list-images
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>.

Refactor kubeadm config list-images

In preparation for creating a `kubeadm config images pull`
this commit refactors `kubeadm config list-images` into
`kubeadm config images list`.

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

**What this PR does / why we need it**:
Prepares the `kubeadm config images` subcommand so we can add more functionality to 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)*:
Related to kubernetes/kubeadm#812

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-15 05:08:17 -07: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
Dr. Stefan Schimanski e333ba061f scheduler: remove nested retry loops 2018-05-15 13:09:55 +02:00
Dr. Stefan Schimanski a3a52a8cf7 Revert "Revert "scheduler: align with ctrl-managers and apiservers, add https+auth in options""
This reverts commit 7b93d81a97.
2018-05-15 13:09:55 +02:00
xuzhonghu 7e894b33ee pass stop channel to node-controller 2018-05-15 17:08:35 +08:00
Kubernetes Submit Queue dc62a73742
Merge pull request #63812 from luxas/kubeadm_cut_kubelet_readonly_dep
Automatic merge from submit-queue (batch tested with PRs 57536, 63812). 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: Contact the kubelet on its healthz port instead of its readonly port

**What this PR does / why we need it**:
In order for us to disable the kubelet's readonly port in v1.11 (https://github.com/kubernetes/kubeadm/issues/732), we need to cut the dependency on that port being open. Instead, we can use the dedicated healthz port (using the defaults `--healthz-bind-address=127.0.0.1` and `--healthz-port=10248`, xref: https://kubernetes.io/docs/reference/command-line-tools-reference/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)*:
Part of https://github.com/kubernetes/kubeadm/issues/732

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio
2018-05-14 19:44:11 -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