Commit Graph

4020 Commits (c2595909e9d0124d6ff75f5d3ea8d2aa453b1a99)

Author SHA1 Message Date
Kubernetes Submit Queue 14a557b1a2 Merge pull request #44346 from mikedanese/build-static
Automatic merge from submit-queue (batch tested with PRs 41106, 44346, 44929, 44979, 45027)

bazel: statically link dockerized components
2017-04-27 12:11:00 -07:00
Kubernetes Submit Queue c446132a97 Merge pull request #44974 from caesarxuchao/remove-client-go-api-listers
Automatic merge from submit-queue (batch tested with PRs 44940, 44974, 44935)

Remove import of internal api package in generated external-versioned listers

Follow up of https://github.com/kubernetes/kubernetes/pull/44523

One line change in cmd/libs/go2idl/lister-gen/generators/lister.go, and simple changes in pkg/apis/autoscaling/v2alpha1/register.go, other changes are generated.

The internal api package will be eliminated from client-go, so these imports should be removed. Also, it's more correct to report the versioned resource in the error.
2017-04-26 20:34:13 -07:00
Chao Xu 0bac9b6aaa update list-gen to not import internal package in external listers 2017-04-26 14:41:09 -07:00
Kubernetes Submit Queue 508041e9d8 Merge pull request #44731 from dmmcquay/kubeadm_manifest_cfg_usage
Automatic merge from submit-queue

kubeadm: remove func arg that isn't being used

**What this PR does / why we need it**: Functions had args passed to them that weren't being used. See https://github.com/kubernetes/kubernetes/pull/44601 for more details. 

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

**Release note**:
```release-note
NONE
```
2017-04-26 04:05:44 -07:00
Kubernetes Submit Queue eb0bc857bd Merge pull request #43850 from xilabao/add-output-to-kubeadm-version
Automatic merge from submit-queue

add --output flag to `kubeadm version`

ref to kubectl https://github.com/kubernetes/kubernetes/pull/39858
2017-04-26 03:16:51 -07:00
xilabao 3719840e0d add output flag to kubeadm version 2017-04-26 16:45:55 +08:00
Kubernetes Submit Queue 708d30a8d1 Merge pull request #44444 from fabriziopandini/kubeadm-certs-1
Automatic merge from submit-queue

Add --apiserver-advertise-address option to kubeadm alpha phase certs…

**What this PR does / why we need it**:
`kubeadm alpha phase certs` command currently does not support `--apiserver-advertise-address` options, and certificates by default are linked to the bind address of the machine where the kubeadm command is run. This behaviour is not adequate f.i. for use cases where you are using `kubeadm alpha phase certs` for an HA deployments or for use cases where you generate certificates on a machine different that the master.

The PR adds support for `--apiserver-advertise-address` to `kubeadm alpha phase certs`, with the following behaviour:
- if `--apiserver-advertise-address` is specified and valid, certificates are linked to the given IP
- if `--apiserver-advertise-address` is specified but not valid, the given ip is not valid an error is given

**Special notes for your reviewer**:
Implementation follow the track already in place for other flags (with validation, but no tests).
2017-04-25 16:11:50 -07:00
Kubernetes Submit Queue fb72285a78 Merge pull request #44753 from xilabao/fix-config-path-broken
Automatic merge from submit-queue (batch tested with PRs 44583, 44139, 44753)

fix config path broken in kubeadm

fixes https://github.com/kubernetes/kubeadm/issues/234
2017-04-25 13:52:39 -07:00
Kubernetes Submit Queue 896d2afb42 Merge pull request #44588 from dmmcquay/kubeadm_skip_token_print
Automatic merge from submit-queue (batch tested with PRs 44601, 44842, 44893, 44491, 44588)

kubeadm: add flag to skip token print out

**What this PR does / why we need it**: When kubeadm init is used in an automated context, it still prints the token to standard out. When standard output ends up in a log file, it can be considered that the token is leaked there and can be compromised. This PR adds a flag you can select to not have it print out and explicitly disable this behavior.

This is a continuation from https://github.com/kubernetes/kubernetes/pull/42823 since it had to be closed.

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

**Special notes for your reviewer**: /cc @luxas @errordeveloper 

**Release note**:
```release-note
NONE
```
2017-04-25 12:51:41 -07:00
Kubernetes Submit Queue 40db1d1986 Merge pull request #44601 from xilabao/fix-certdir-in-kubeadm
Automatic merge from submit-queue

fix kubeadm init when certdir changed

If --cert-dir specified, `kubeadm init`  failed.
2017-04-25 11:58:12 -07:00
Jan Safranek 9d0c47f1db Use storage.v1 instead of v1beta1
storage.v1beta1 was used to work around GKE which does not expose v1. Now that
GKE is updated, we can switch everything to v1.
2017-04-25 10:13:38 +02:00
Kubernetes Submit Queue 099e7a5f0a Merge pull request #44162 from liggitt/tls-flag-help
Automatic merge from submit-queue (batch tested with PRs 40060, 44860, 44865, 44825, 44162)

Clarify kubelet cert flag usage
2017-04-24 23:07:45 -07:00
Kubernetes Submit Queue 6c8cb33fb3 Merge pull request #42101 from Dmitry1987/feature/hpa-upscale-downscale-delay-configurable
Automatic merge from submit-queue (batch tested with PRs 44862, 42241, 42101, 43181, 44147)

Feature/hpa upscale downscale delay configurable

**What this PR does / why we need it**:
Makes "upscale forbidden window" and "downscale forbidden window"  duration configurable in arguments of kube-controller-manager. Those are options of horizontal pod autoscaler.

**Special notes for your reviewer**:
Please have a look @DirectXMan12 , the PR as discussed in Slack.

**Release note**:
```
Make "upscale forbidden window" and "downscale forbidden window"  duration configurable in arguments of kube-controller-manager. Those are options of horizontal pod autoscaler. Right now are hardcoded 3 minutes for upscale, and 5 minutes to downscale.  But sometimes cluster administrator might want to change this for his own needs.
```
2017-04-24 19:39:42 -07:00
Kubernetes Submit Queue 20dd848e7c Merge pull request #44204 from FengyunPan/optimize-code
Automatic merge from submit-queue

Optimize getProxyMode() to get proxy mode

1. getProxyMode() does not need nodeGetter args after remove
   proxy-mode annotation.
2. we should get error when the version of iptables less than
   MinVersion.
2017-04-21 18:11:07 -07:00
Kubernetes Submit Queue 072c127b47 Merge pull request #44627 from dmmcquay/kubeadm_add_validation_error_code
Automatic merge from submit-queue

kubeadm: add api validation exit code

**What this PR does / why we need it**: This will help with automation and provide more meaningful exit code for api validation. 

WIP to add more meaningful exit codes https://github.com/kubernetes/kubeadm/issues/61

This is a continuation from https://github.com/kubernetes/kubernetes/pull/42825 since it had to be closed.

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

**Release note**:
```release-note
NONE
```
2017-04-21 15:39:56 -07:00
Kubernetes Submit Queue ee86c18d92 Merge pull request #44623 from p0lyn0mial/split_out_admission_options
Automatic merge from submit-queue (batch tested with PRs 42202, 40784, 44642, 44623, 44761)

Split out AdmissionOptions

**What this PR does / why we need it**: The changes in this PR split out AdmissionOptions from ServerRunOptions. In the long term AdmissionOptions will accepts various dependencies
and spit out AdmissionControl

**Release note**:

NONE
2017-04-21 11:52:09 -07:00
xilabao 4ec40e3789 fix config path broken in kubeadm 2017-04-21 14:18:43 +08:00
derek mcquay d047dfbc6f kubeadm: add flag to skip token print out 2017-04-20 13:12:37 -07:00
derek mcquay 60efc38ef3 kubeadm: remove func arg that isn't being used 2017-04-20 09:47:17 -07:00
xilabao c1197924cd fix kubeadm init when certdir changed 2017-04-20 15:23:45 +08:00
Daniel Nardo 2320fde49c Update kubelet to use the network-plugin-dir if the cni-bin-dir flag
is not set.
2017-04-19 16:33:06 -07:00
Kubernetes Submit Queue 505ec43dab Merge pull request #44499 from wojtek-t/edge_based_services_in_proxy
Automatic merge from submit-queue

Edge based services in proxy

This is sibling effort to what I did for endpoints in KubeProxy.
This PR is first one (changing config & iptables) - userspace will follow.
2017-04-19 09:43:04 -07:00
Paulo Pires 6c5e1eae2d
kubeadm: remove maintainer @pires.
Signed-off-by: Paulo Pires <pjpires@gmail.com>
2017-04-18 12:11:08 -07:00
Derek McQuay 6aa2c396e2 kubeadm: add api validation exit code 2017-04-18 11:41:53 -07:00
p0lyn0mial de9706bc15 Split out AdmissionOptions
In the long term AdmissionOptions will accepts various dependencies
and spit out AdmissionControl
2017-04-18 19:48:14 +02:00
Andy Goldstein 54b6edc400 go-to-protobuf: actually skip - packages
If a package is prefixed with -, we are not supposed to be generating
protobuf for it. Make that actually happen :-)
2017-04-18 12:35:16 -04:00
Kubernetes Submit Queue 4e17230345 Merge pull request #42246 from jamiehannaford/add-etcd-flags-kubeadm
Automatic merge from submit-queue

Allow configurable etcd options

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

Allows users to set the `--listen-client-urls` and `--advertise-client-urls` flags on etcd binaries for clusters set up with kubeadm.

**Which issue this PR fixes**:

As far as I can tell right now, other nodes in a cluster set up with kubeadm cannot communicate with the etcd static pod running on the master. This is needed in order to set up calico/canal SDN which needs access to a publicly addressable IPv4 _before_ the overlay network and inter-cluster subnet is created.

Addresses https://github.com/kubernetes/features/issues/138 and https://github.com/kubernetes/features/issues/11.

**Release note**:
```release-note
Users can now specify listen and advertise URLs for etcd in a kubeadm cluster 
```
2017-04-18 08:25:49 -07:00
Wojciech Tyczynski 7a647f9d1a Event-based iptables proxy for services 2017-04-18 13:30:59 +02:00
Kubernetes Submit Queue 877dc56864 Merge pull request #43282 from xilabao/use-healthz-api
Automatic merge from submit-queue

use healthz api in WaitForAPI

finish TODO
2017-04-18 00:17:03 -07:00
xilabao 7f613f09b8 use healthz api instead of componentstatus in WaitForAPI 2017-04-18 08:58:15 +08:00
Kubernetes Submit Queue a1684fea80 Merge pull request #42085 from cblecker/gofmt-fix
Automatic merge from submit-queue (batch tested with PRs 40055, 42085, 44509, 44568, 43956)

Fix gofmt errors

**What this PR does / why we need it**:
There were some gofmt errors on master. Ran the following to fix:
```
hack/verify-gofmt.sh | grep ^diff | awk '{ print $2 }' | xargs gofmt -w -s
```

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-04-17 15:39:07 -07:00
Chao Xu 4f9591b1de move pkg/api/v1/ref.go and pkg/api/v1/resource.go to subpackages. move some functions in resource.go to pkg/api/v1/node and pkg/api/v1/pod 2017-04-17 11:38:11 -07:00
Mike Danese 3757e8bb5c bazel: statically link dockerized components
and remove libc from docker images when it's not needed.
2017-04-14 15:51:54 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Kubernetes Submit Queue ce860e187c Merge pull request #44408 from ncdc/controller-run-consistency
Automatic merge from submit-queue

Make controller Run methods consistent

- startup/shutdown logging
- wait for cache sync logging
- defer utilruntime.HandleCrash()
- wait for stop channel before exiting

Please review for accuracy and consistency.

cc @deads2k @wojtek-t @smarterclayton @sttts @mikedanese @liggitt @rrati @derekwaynecarr
2017-04-14 08:10:04 -07:00
Kubernetes Submit Queue b0a05b4597 Merge pull request #42474 from k82cn/rm_empty_line_kl
Automatic merge from submit-queue

Removed un-necessary empty line.
2017-04-14 07:23:11 -07:00
Andy Goldstein e63fcf708d Make controller Run methods consistent
- startup/shutdown logging
- wait for cache sync logging
- defer utilruntime.HandleCrash()
- wait for stop channel before exiting
2017-04-14 07:27:45 -04:00
Kubernetes Submit Queue d65b0b1228 Merge pull request #44318 from wojtek-t/edge_based_proxy_2
Automatic merge from submit-queue (batch tested with PRs 44414, 44318)

Finish migration to edge-based for endpoints in KubeProxy

Ref #43702
2017-04-14 02:53:58 -07:00
Kubernetes Submit Queue 3b9eb1a875 Merge pull request #43876 from caesarxuchao/blockOwnerDeletion-admission
Automatic merge from submit-queue (batch tested with PRs 44440, 44038, 44302, 44316, 43876)

Extend the gc admission plugin to check ownerReference.blockOwnerDeletion

#Extend the gc admission plugin to prevent user who doesn't have delete permission of the *owner* from changing blockOwnerDeletion field of existing ownerReferences, or adding ownerReference with blockOwnerDeletion=true.

The plugin need a RESTMapper to translate ownerRef.Kind to Resource. It should be using a dynamic one. However, as discussed in https://github.com/kubernetes/kubernetes/pull/42615, such a RESTMapper will be built after watchable discovery API is implemented, so in this PR the plugin is using the `api.Registry.RESTMapper()`, which is also [used](https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-controller-manager/app/core.go#L165-L166) by the garbage collector currently.

```release-note
Extending the gc admission plugin so that a user who doesn't have delete permission of the *owner* cannot modify blockOwnerDeletion field of existing ownerReferences, or add new ownerReference with blockOwnerDeletion=true
```

cc @lavalamp
2017-04-13 23:18:06 -07:00
Kubernetes Submit Queue 5ad494077e Merge pull request #42914 from liggitt/fix-defaulting
Automatic merge from submit-queue (batch tested with PRs 44424, 44026, 43939, 44386, 42914)

remove defaulting from conversion path

follow up for #42764

* remove call to defaulting from conversion path (defaulting is a separate step from conversion)
* remove non-top-level-object defaulting registration (unused after conversion call is removed)
* generate missing top-level defaults for some api groups:
  * autoscaling/v2alpha1
  * policy/v1alpha1
  * policy/v1beta1
* register top-level defaults for some api groups that were missing them:
  * autoscaling/v2alpha1
  * settings/v1alpha1
2017-04-13 22:07:10 -07:00
Kubernetes Submit Queue d32668b0be Merge pull request #43277 from StudyNick/zte-20170315
Automatic merge from submit-queue (batch tested with PRs 44447, 44456, 43277, 41779, 43942)

variable 'controller' collides with imported package name

variable 'controller' collides with imported package name,
 'controller'  modify 'ctrl'
2017-04-13 15:01:58 -07:00
Chao Xu 9d7a8df5ee add gc admission plugin that prevents user who doesn't have delete permission of the owner from setting blockOwnerDeletion 2017-04-13 11:55:22 -07:00
fabriziopandini 068ce4e3dd Add --apiserver-advertise-address option to kubeadm alpha phase certs selfsign 2017-04-13 15:24:46 +02:00
Kubernetes Submit Queue cacfd7569a Merge pull request #44002 from mikedanese/vers-apiserver
Automatic merge from submit-queue

kubeadm: don't add proxy flag to apiservers below v1.7
2017-04-13 05:56:07 -07:00
Kubernetes Submit Queue 7f0004de5a Merge pull request #44379 from guangyouyu/garyyu_master
Automatic merge from submit-queue

Bugfix: cloud-controller-manager routeController.run() block in WaitForCacheSync

**What this PR does / why we need it**:
cloud-controller-manager routeController.run not run in goroutine will block to  wait nodeListerSynced because sharedInformers not started


**Special notes for your reviewer**:

cloud-controller-manager routeController.run  should run in goroutine like the same code in kube-controller-manager,or it will block to  wait nodeListerSynced,but sharedInformers not startd.

```go
//controller-manager.go:197
func StartControllers(s *options.CloudControllerManagerServer, kubeconfig *restclient.Config, rootClientBuilder, clientBuilder controller.ControllerClientBuilder, stop <-chan struct{}, recorder record.EventRecorder, cloud cloudprovider.Interface) error {
	// Function to build the kube client object
	client := func(serviceAccountName string) clientset.Interface {
		return rootClientBuilder.ClientOrDie(serviceAccountName)
	}
	versionedClient := client("shared-informers")
	sharedInformers := informers.NewSharedInformerFactory(versionedClient, resyncPeriod(s)())
ocateNodeCIDRs && s.ConfigureCloudRoutes {
		if routes, ok := cloud.Routes(); !ok {
			glog.Warning("configure-cloud-routes is set, but cloud provider does not support routes. Will not configure cloud provider routes.")
		} else {
			routeController := routecontroller.New(routes, client("route-controller"), sharedInformers.Core().V1().Nodes(), s.ClusterName, clusterCIDR)
                       //should run in goroutine
----->		routeController.Run(stop, s.RouteReconciliationPeriod.Duration)
			time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
		}
	} else {
		glog.Infof("Will not configure cloud provider routes for allocate-node-cidrs: %v, configure-cloud-routes: %v.", s.AllocateNodeCIDRs, s.ConfigureCloudRoutes)
	}

---> 	sharedInformers.Start(stop)

	select {}
}



//routecontroller.go:77
func (rc *RouteController) Run(stopCh <-chan struct{}, syncPeriod time.Duration) {
	defer utilruntime.HandleCrash()

	glog.Info("Starting the route controller")
       //will block
--->   	if !cache.WaitForCacheSync(stopCh, rc.nodeListerSynced) {
		utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync"))
		return
	}

	go wait.NonSlidingUntil(func() {
		if err := rc.reconcileNodeRoutes(); err != nil {
			glog.Errorf("Couldn't reconcile node routes: %v", err)
		}
	}, syncPeriod, wait.NeverStop)
}
```
2017-04-12 23:58:57 -07:00
FengyunPan b95b95dc00 Optimize getProxyMode() to get proxy mode
The getProxyMode() does not need nodeGetter args after remove
proxy-mode annotation.
2017-04-13 09:44:30 +08:00
Jordan Liggitt ad116026d9
Remove vestiges of defaulting from conversion path, switch to top-level default registration only 2017-04-12 13:36:15 -04:00
Kubernetes Submit Queue 06cdb02fca Merge pull request #44359 from ncdc/var-lib-dockershim
Automatic merge from submit-queue

Make the dockershim root directory configurable

Make the dockershim root directory configurable so things like
integration tests (e.g. in OpenShift) can run as non-root.

cc @sttts @derekwaynecarr @yujuhong @Random-Liu @kubernetes/sig-node-pr-reviews @kubernetes/rh-cluster-infra
2017-04-12 09:58:18 -07:00
Kubernetes Submit Queue c7b0ec0178 Merge pull request #42981 from NickrenREN/pv-controller-init
Automatic merge from submit-queue

Exit from NewController() for PersistentVolumeController when InitPlugins() failed

Exit from NewController() for PersistentVolumeController when InitPlugins() failed just like NewAttachDetachController() does

**Release note**:
```release-note
NONE
```
@jsafrane  @saad-ali  PTAL. Thanks in advance
2017-04-12 08:18:50 -07:00
Andy Goldstein 00e11566f2 Make the dockershim root directory configurable
Make the dockershim root directory configurable so things like
integration tests (e.g. in OpenShift) can run as non-root.
2017-04-12 09:06:21 -04:00