Commit Graph

340 Commits (0c669fe6cc48208ebcdd43fa2ff425fce3c359a0)

Author SHA1 Message Date
gmarek 4f0129b023 Create a flag for route reconciliatio and deprecate unused node-sync-period one 2016-09-14 11:49:50 +02:00
Kubernetes Submit Queue e357b9a6f4 Merge pull request #32582 from jlowdermilk/api-all
Automatic merge from submit-queue

make --runtime-config=api/all=true|false work

`Passing --runtime-config=api/all=true|false to apiserver will enable/disable all registered api groups`

Previously, only api/all=false was recognized, and it only disabled groups with resources.
2016-09-13 20:27:34 -07:00
Jeff Lowdermilk e85f8d700c make --runtime-config=api/all=true|false work
Currently, only api/all=false does something (disables
all groups that have resources). Make api/all=false disable all groups
(not just those with resources), and make api/all=true enable
all groups
2016-09-13 12:03:25 -07:00
mbohlool 469c7d37f3 Generated open-api definition file 2016-09-12 23:23:59 -07:00
mbohlool 54fee8c253 Improvements on OpenAPI spec generation:
- Generating models using go2idl library (no reflection anymore)
- Remove dependencies on go-restful/swagger
- Generate one swagger.json file for each web-service
- Bugfix: fixed a bug in trie implementation
2016-09-12 18:47:03 -07:00
Kubernetes Submit Queue d06321f7fe Merge pull request #32166 from nikhiljindal/removeVar
Automatic merge from submit-queue

Remove DeprecatedStorageVersion

Its not used anymore.
Ref https://github.com/kubernetes/kubernetes/pull/24787#discussion_r61513902

cc @lavalamp @smarterclayton @deads2k
2016-09-11 04:27:11 -07:00
Maciej Szulik b19fcdce29 Fix namespace in audit logs 2016-09-09 11:43:28 +02:00
Kubernetes Submit Queue 943d7aa5aa Merge pull request #31247 from deads2k/api-03
Automatic merge from submit-queue

refactor genericapiserver new to combine initialization

Combines `New` and `init` since the two were inseparable before anyway.  `New` now has all the code to create the `GenericAPIServer`.

The rest of the change is a move.  I want to refactor the flow more, but I figured that doing it separately would simplify the review.

@sttts how do you feel about looking at this one?
2016-09-08 09:10:24 -07:00
Kubernetes Submit Queue 54243d4f1b Merge pull request #32258 from liggitt/ingress-prefix
Automatic merge from submit-queue

Pin ingresses etcd prefix for 1.3 compatibility

fixes https://github.com/kubernetes/kubernetes/issues/32255
2016-09-08 06:21:18 -07:00
deads2k b0d770ad7b refactor genericapiserver new to combine initialization 2016-09-08 08:57:10 -04:00
Kubernetes Submit Queue bf4e9e9db8 Merge pull request #31245 from deads2k/api-02
Automatic merge from submit-queue

privatize, document, and scrub GenericAPIServer

I've gone through more of the `GenericAPIServer` struct, started documenting what the fields do and privatizing ones that aren't used elsewhere or are only used by components that need some refactoring too.
2016-09-08 03:47:50 -07:00
Jordan Liggitt bd1c4e751e
Pin ingresses etcd prefix for 1.3 compatibility 2016-09-08 01:54:07 -04:00
nikhiljindal b5796dd172 Remove DeprecatedStorageVersion 2016-09-06 16:52:12 -07:00
deads2k 554ff48da2 privatize, document, and scrub GenericAPIServer 2016-08-30 09:53:33 -04:00
deads2k b1ebeffeb3 remove unnecessary fields from generic apiserver 2016-08-30 09:53:33 -04:00
PingWang d89868ba8f combine the ValidateRunOptions errors
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

replace Aggregate with []error

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

replace Aggregate with []error

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-27 15:08:57 +08:00
Daniel Smith 9dcef2e3cd Revert "Enable v3 Client as the default on UTs" 2016-08-24 13:16:40 -07:00
Timothy St. Clair 49b7ebd791 Switch UT default settings to leverage etcd3.v3client 2016-08-22 22:17:55 -05:00
Kubernetes Submit Queue 7979801e54 Merge pull request #28860 from ericchiang/separate-apiserver-authz-options
Automatic merge from submit-queue

pkg/genericapiserver/options: don't import pkg/apiserver

Refactor the authorization options for the API server so
pkg/apiserver isn't directly imported by the options package.

Closes #28544

cc @smarterclayton

@madhusudancs, @nikhiljindal I've updated `federation/cmd/federation-apiserver/app/server.go` to include the RBAC options with this change. I don't know if this was intentionally left out in the first place but would like your feedback.
2016-08-21 09:49:14 -07:00
Kubernetes Submit Queue a41e6e3817 Merge pull request #30922 from yifan-gu/tls_bootstrap_refactor
Automatic merge from submit-queue

Implement TLS bootstrap for kubelet using `--experimental-bootstrap-kubeconfig`  (2nd take)

Ref kubernetes/features#43 (comment)

cc @gtank @philips @mikedanese @aaronlevy @liggitt @deads2k @errordeveloper @justinsb 


Continue on the older PR https://github.com/kubernetes/kubernetes/pull/30094 as there are too many comments on that one and it's not loadable now.
2016-08-21 03:47:07 -07:00
Yifan Gu 2e631d811c crypto.go: Rename ShouldGenSelfSignedCerts() to FoundCertOrKey().
Since the function only tests whether the files are on the disk,
the original name is a little bit misleading.
2016-08-19 13:51:34 -07:00
Jeff Lowdermilk 51198f59da Add --feature-gates to kube-system components
apiserver,scheduler,controller-manager,proxy,kubelet all get
flag. Using one variable to plumb through config via salt/init
scripts for GCE and GKE
2016-08-19 09:07:43 -07:00
Kubernetes Submit Queue 5898f87722 Merge pull request #30233 from mbohlool/swagger2
Automatic merge from submit-queue

OpenAPI / Swagger2 spec generation

This is alpha version of OpenAPI spec generation. Generated "/swagger.json" file (accessible on api server) is a valid OpenAPI spec with some warnings that will be fixed in next versions of spec generation. Currently it is possible to generate a client using this spec though I did not test the clients.

reference: #13414

**Release note**:

```release-note
Alpha support for OpenAPI (aka. Swagger 2.0) specification serves on /swagger.json 
```
2016-08-19 04:21:48 -07:00
mbohlool c5f1d63d6f Generates OpenAPI (aka Swagger 2.0) Spec on /swagger.json path 2016-08-18 15:32:04 -07:00
Eric Chiang b4eaf625a0 pkg/genericapiserver/options: don't import pkg/apiserver
Refactor the authorization options for the API server so
pkg/apiserver isn't directly imported by the options package.
2016-08-18 13:01:50 -07:00
Clayton Coleman 12a5eeea17
Introduce GroupVersioner for capturing desired target version
Convert single GV and lists of GVs into an interface that can handle
more complex scenarios (everything internal, nothing supported). Pass
the interface down into conversion.
2016-08-18 14:45:00 -04:00
Kubernetes Submit Queue e800c391f5 Merge pull request #30050 from ping035627/ping035627-patch-0804
Automatic merge from submit-queue

Correct the url in comment and optimise the code style

The PR modified two aspects:
1) Correct the url in comment, the original url can't be accessed;
2) Optimise the code style according to the go style guide.
2016-08-17 00:53:53 -07:00
PingWang d902fd6cad correct the url in comment
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

optimise the style

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update err define

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-16 10:41:12 +08:00
PingWang 8760ae697e implement restful for InstallLogsSupport
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

add ws.doc

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

run hack/update-swagger-spec.sh

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update update-swagger-spec.sh

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update apiserver_test.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update comment

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-16 09:09:02 +08:00
Hongchao Deng d0938094d9 move new etcd storage into cacher 2016-08-12 18:40:20 -07:00
Maciej Szulik 24f1e1eaf6 Basic audit log 2016-08-12 12:27:19 +02:00
Xiang Li c995050ee3 apiserver: fix timeout handler
Protect access of the original writer. Panics if anything has wrote
into the original writer or the writer is hijacked when times out.
2016-08-09 12:39:40 -07:00
mksalawa a806351cc3 Extract etcd options from genericapiserver. 2016-08-09 13:35:53 +02:00
Wojciech Tyczynski 8a8cd06ea4 Configurable cache sizes of cachers 2016-08-09 09:41:48 +02:00
Kubernetes Submit Queue 7921a9ce67 Merge pull request #25816 from soltysh/scheduledjob_kubectl
Automatic merge from submit-queue

ScheduledJob kubectl

@erictune the last part (kubectl) of the ScheduledJob, as usual builds on top of previous PRs, so only last 2 commits matter (the kubectl one and storage leftovers).

```release-note
* Introducing ScheduledJobs as described in [the proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/scheduledjob.md) as part of `batch/v2alpha1` version (experimental feature).
```
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-08-04 17:36:07 -07:00
Kubernetes Submit Queue 0d53ef7b3b Merge pull request #29861 from xiangpengzhao/verify-secure-insecure-port-equal
Automatic merge from submit-queue

Verify if Secure and InsecurePort are equal for apiserver

If we specify the kube-apiserver flags `--secure-port` and `--insecure-port` with the same port, the server will print the below error info repeatedly. In fact, it's meaningless to do this. It should verify if the two flags are equal. If so, the server should give error info and exit directly.

```
root@vm:~# [restful] 2016/08/01 13:11:52 log.go:30: [restful/swagger] listing is available at https://172.16.1.11:8888/swaggerapi/
[restful] 2016/08/01 13:11:52 log.go:30: [restful/swagger] https://172.16.1.11:8888/swaggerui/ is mapped to folder /swagger-ui/
E0801 13:11:53.102232    2481 genericapiserver.go:733] Unable to listen for secure (listen tcp 0.0.0.0:8888: bind: address already in use); will try again.
E0801 13:12:08.116463    2481 genericapiserver.go:733] Unable to listen for secure (listen tcp 0.0.0.0:8888: bind: address already in use); will try again.
```

After fixing, the print is like this:
```
root@vm:~# F0801 11:51:44.308180    1921 genericapiserver.go:599] --secure-port and --insecure-port cannot use the same port.
goroutine 1 [running]:
k8s.io/kubernetes/vendor/github.com/golang/glog.stacks(0x4871d00, 0x0, 0x0, 0x0)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:766 +0xb8
k8s.io/kubernetes/vendor/github.com/golang/glog.(*loggingT).output(0x48517c0, 0xc800000003, 0xc820368000, 0x470aeab, 0x13, 0x257, 0x0)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:717 +0x259
k8s.io/kubernetes/vendor/github.com/golang/glog.(*loggingT).printf(0x48517c0, 0xc800000003, 0x3518280, 0x3b, 0x0, 0x0, 0x0)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:655 +0x1d4
k8s.io/kubernetes/vendor/github.com/golang/glog.Fatalf(0x3518280, 0x3b, 0x0, 0x0, 0x0)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:1145 +0x5d
k8s.io/kubernetes/pkg/genericapiserver.verifySecureAndInsecurePort(0xc820132800)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/genericapiserver/genericapiserver.go:599 +0xad
k8s.io/kubernetes/pkg/genericapiserver.ValidateRunOptions(0xc820132800)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/genericapiserver/genericapiserver.go:607 +0x4b
k8s.io/kubernetes/pkg/genericapiserver.DefaultAndValidateRunOptions(0xc820132800)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/genericapiserver/genericapiserver.go:611 +0x4e
k8s.io/kubernetes/cmd/kube-apiserver/app.Run(0xc8202c9560, 0x0, 0x0)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/server.go:84 +0x8e
main.main()
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/cmd/kube-apiserver/apiserver.go:48 +0x111

[2]+  Exit 255
```

This will fix the same issue of federation-apiserver.

cc @lavalamp @quinton-hoole
2016-08-03 23:28:50 -07:00
Kubernetes Submit Queue 15946ddd76 Merge pull request #29611 from ping035627/ping035627-patch-0726
Automatic merge from submit-queue

add DefaultServiceNodePortRange const

The PR add DefaultServiceNodePortRange const in server_run_options.go, and use it in genericapiserver.go and server_run_options.go.
2016-08-03 16:47:38 -07:00
Maciej Szulik e6c327048e Forced using batch/v2alpha1 for storing ScheduledJob 2016-08-03 17:25:37 +02:00
Kubernetes Submit Queue 24216fe02f Merge pull request #26958 from resouer/util-line
Automatic merge from submit-queue

Refactoring runner resource container linedelimiter to it's own pkg

Continuing my work ref #15634

Anyone is ok to review this fix.
2016-08-03 02:26:12 -07:00
PingWang eba0d125b9 add DefaultServiceNodePortRange const
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update DefaultServiceNodePortRange define

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-03 12:39:46 +08:00
deads2k c30690a3bb separate out api group storage registration 2016-08-01 08:26:19 -04:00
xiangpengzhao 606feff2cb Verify if Secure and InsecurePort are equal for apiserver 2016-08-01 08:12:42 -04:00
Harry Zhang e0ab76019e Rename runnter pkg name 2016-07-29 02:37:00 -04:00
k8s-merge-robot eae90a3631 Merge pull request #26332 from resouer/util-debt
Automatic merge from submit-queue

Refactor util clock into it's own pkg

Continue my work ref #15634
2016-07-28 11:37:06 -07:00
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
deads2k aa3db4d995 make the resource prefix in etcd configurable for cohabitation 2016-07-27 07:51:40 -04:00
Prashanth Balasubramanian 3d1805a54b Change log level to reduce spam 2016-07-25 09:25:04 -07:00
deads2k 6f7007afc5 make addition group registration easier 2016-07-25 08:23:24 -04:00
k8s-merge-robot 1784e99a1d Merge pull request #29102 from ping035627/ping035627-patch-0719
Automatic merge from submit-queue

Optimise getAPIGroupVersion function in genericapiserver.go

About the newAPIGroupVersion and the getAPIGroupVersion function  in genericapiserver.go, I think they can optimise.
2016-07-20 23:31:17 -07:00
k8s-merge-robot 411c32bc98 Merge pull request #27520 from olegshaldybin/format-apiserver-options
Automatic merge from submit-queue

Format apiserver options

Trivial change, code formatting only: it was hard to read long lines, and my editor was really slow when scrolling through them.
2016-07-19 19:58:01 -07:00
PingWang 4daea70ad7 Optimise getAPIGroupVersion function in genericapiserver.go
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

gofmt -s -w

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-20 08:17:36 +08:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
k8s-merge-robot bea5232790 Merge pull request #28946 from ping035627/ping035627-patch-0714-2
Automatic merge from submit-queue

Modify wrong description about "InsecurePort" in genericapiserver.go

Modify wrong description about "InsecurePort" in genericapiserver.go, avoid misleading.
2016-07-14 19:56:09 -07:00
k8s-merge-robot e182520db6 Merge pull request #28944 from ping035627/ping035627-patch-0715
Automatic merge from submit-queue

Improve fatal error description for init in genericapiserver.go

When api.NewRequestContextFilter return error in the "init" function of genericapiserver.go, there are no handler info, add more information to indicate s.Handler or s.InsecureHandler, I suggest.
2016-07-14 19:56:04 -07:00
PingWang a7cea72e66 modify two wrong description about InsecurePort
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Update genericapiserver.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-15 08:29:18 +08:00
PingWang 4e9b8b15c5 Improve fatal error description
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-14 15:03:31 +08:00
PingWang 97b4a6fa42 optimise the New function
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-14 11:43:53 +08:00
Aaron Levy 25ac0dd030 retry on apiserver insecure listen failures 2016-07-11 14:18:13 -07:00
mbohlool 0254679067 Represent unversioned.Time correctly in swagger spec 2016-07-01 23:23:19 -07:00
k8s-merge-robot ff281525a8 Merge pull request #28143 from xiangpengzhao/service-node-port-range
Automatic merge from submit-queue

Should set default value for --service-node-port-range flag before verifying

For the flag `--service-node-port-range` of kube-apiserver, we know that it defaults to `30000-32767` if not specified. But if we only pass the flag `--kubernetes-service-node-port` with a valid value between `30000-32767` when starting kube-apiserver, a fatal error will occurs as the last below. It means that service port range is not 30000-32767 but empty. The log is from code [DefaultAndValidateRunOptions-->ValidateRunOptions-->verifyServiceNodePort](https://github.com/xiangpengzhao/kubernetes/blob/master/pkg/genericapiserver/genericapiserver.go#L580) where the flags are verified. 

After tracing the apiserver related code, we can find the call stack:
```
func main() {
	......
	s := options.NewAPIServer()
	......
	app.Run(s)
	......
}
```
In the `app.Run`, it calls [genericapiserver.DefaultAndValidateRunOptions(s.ServerRunOptions)](https://github.com/xiangpengzhao/kubernetes/blob/master/cmd/kube-apiserver/app/server.go#L80). But the `--kubernetes-service-node-port` hasn't been defaulted before there, so it's empty. It's then defaulted in `app.Run`-->[master.New](https://github.com/xiangpengzhao/kubernetes/blob/master/cmd/kube-apiserver/app/server.go#L276)-->[genericapiserver.New](https://github.com/xiangpengzhao/kubernetes/blob/master/pkg/master/master.go#L179)-->[setDefaults](https://github.com/xiangpengzhao/kubernetes/blob/master/pkg/genericapiserver/genericapiserver.go#L338)-->[defaultServiceNodePortRange](https://github.com/xiangpengzhao/kubernetes/blob/master/pkg/genericapiserver/genericapiserver.go#L281).

So, we have to set default value for `--kubernetes-service-node-port` in [NewServerRunOptions](https://github.com/xiangpengzhao/kubernetes/blob/master/pkg/genericapiserver/options/server_run_options.go#L105), as is done for `--secure-port` and/or `--insecure-port`. The `NewServerRunOptions` will be called in options.[NewAPIServer](https://github.com/xiangpengzhao/kubernetes/blob/master/cmd/kube-apiserver/app/options/options.go#L50)().

Hope that I have described the issue clearly. Thanks!

```
root@vm:~# kube-apiserver --etcd-servers=http://172.16.1.11:4001 --service-cluster-ip-range=192.168.122.0/24 --insecure-bind-address=0.0.0.0 --logtostderr=false --log-dir=/home/paas/zxp/log/kube --v=10 --kubernetes-service-node-port=30001 &
[2] 24629
root@vm:~# F0627 23:46:37.308726   24629 genericapiserver.go:580] Kubernetes service port range  doesn't contain 30001
goroutine 1 [running]:
k8s.io/kubernetes/vendor/github.com/golang/glog.stacks(0x44f2500, 0x0, 0x0, 0x0)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:766 +0xb8
k8s.io/kubernetes/vendor/github.com/golang/glog.(*loggingT).output(0x44d2020, 0xc800000003, 0xc820238000, 0x438c73b, 0x13, 0x244, 0x0)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:717 +0x259
k8s.io/kubernetes/vendor/github.com/golang/glog.(*loggingT).printf(0x44d2020, 0xc800000003, 0x3223dc0, 0x33, 0xc8204c4cc8, 0x2, 0x2)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:655 +0x1d4
k8s.io/kubernetes/vendor/github.com/golang/glog.Fatalf(0x3223dc0, 0x33, 0xc8204c4cc8, 0x2, 0x2)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:1145 +0x5d
k8s.io/kubernetes/pkg/genericapiserver.verifyServiceNodePort(0xc8202a8400)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/genericapiserver/genericapiserver.go:580 +0x1d5
k8s.io/kubernetes/pkg/genericapiserver.ValidateRunOptions(0xc8202a8400)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/genericapiserver/genericapiserver.go:605 +0x2f
k8s.io/kubernetes/pkg/genericapiserver.DefaultAndValidateRunOptions(0xc8202a8400)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/genericapiserver/genericapiserver.go:612 +0x4e
k8s.io/kubernetes/cmd/kube-apiserver/app.Run(0xc820224fc0, 0x0, 0x0)
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/cmd/kube-apiserver/app/server.go:80 +0x70
main.main()
	/home/paas/zxp/code/k8s/fork/kubernetes/_output/local/go/src/k8s.io/kubernetes/cmd/kube-apiserver/apiserver.go:50 +0x121

[2]+  Exit 255                kube-apiserver --etcd-servers=http://172.16.1.11:4001 --service-cluster-ip-range=192.168.122.0/24 --insecure-bind-address=0.0.0.0 --logtostderr=false --log-dir=/home/paas/zxp/log/kube --v=10 --kubernetes-service-node-port=30001
root@vm:~#

```
2016-06-30 19:30:31 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Oleg Shaldybin e722a41c40 Format apiserver options
Trivial change, code formatting only: it was really hard to read
apiserver options definition, formatted to follow the same pattern
throughout.
2016-06-28 12:34:22 -07:00
xiangpengzhao 716fb5ed7d Should set default value for --service-node-port-range flag before vefirying 2016-06-27 22:48:49 -04:00
xiangpengzhao d8a7b4948b Should verify port value when starting kube-apiserver 2016-06-27 06:34:14 -04:00
k8s-merge-robot 076bf81b8b Merge pull request #23473 from AdoHe/kubelet_tls_overwrite
Automatic merge from submit-queue

fix kubelet tls overwrite issue

@lavalamp apply the same thing to kubelet. @dchen1107 ptal.

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/23473)
<!-- Reviewable:end -->
2016-06-17 23:20:03 -07:00
nikhiljindal 6e71b4a2dc Fixing externalAddress in genericapiserver 2016-06-03 11:21:29 -07:00
k8s-merge-robot 0fc573296d Merge pull request #26169 from victorgp/master
Automatic merge from submit-queue

Setting TLS1.2 minimum because TLS1.0 and TLS1.1 are vulnerable

TLS1.0 is known as vulnerable since it can be downgraded to SSL
https://blog.varonis.com/ssl-and-tls-1-0-no-longer-acceptable-for-pci-compliance/

TLS1.1 can be vulnerable if cipher RC4-SHA is used, and in Kubernetes it is, you can check it with
`
openssl s_client -cipher RC4-SHA -connect apiserver.k8s.example.com:443
`

https://www.globalsign.com/en/blog/poodle-vulnerability-expands-beyond-sslv3-to-tls/

Test suites like Qualys are reporting this Kubernetes issue as a level 3 vulnerability, they recommend to upgrade to TLS1.2 that is not affected, quoting Qualys:

`
RC4 should not be used where possible. One reason that RC4 was still being used was BEAST and Lucky13 attacks against CBC mode ciphers in
SSL and
TLS. However, TLSv 1.2 or later address these issues.
`
2016-05-29 13:24:46 -07:00
Eric Chiang ef40aa9572 pkg/master: enable certificates API and add rbac authorizer 2016-05-25 14:24:47 -07:00
Victor Garcia d3f3e6c969 Setting TLS1.2 minimum because TLS1.0 and TLS1.1 are vulnerable
Adding comments to explain what is wrong with each version
2016-05-25 18:14:20 +02:00
AdoHe 973774b0ba fix kubelet tls overwrite issue 2016-05-23 23:25:12 -04:00
Jordan Liggitt 29252acd1a Change rest storage Update interface to retrieve updated object
Add OldObject to admission attributes

Update resthandler Patch/Update admission plumbing
2016-05-23 21:09:26 -04:00
CJ Cullen d03dbbcc14 Add LRU Expire cache to webhook authorizer. 2016-05-21 14:50:50 -07:00
Clayton Coleman 633683c08d
kube-apiserver options should be decoupled from impls
A few months ago we refactored options to keep it independent of the
implementations, so that it could be used in CLI tools to validate
config or to generate config, without pulling in the full dependency
tree of the master.  This change restores that by separating
server_run_options.go back to its own package.

Also, options structs should never contain non-serializable types, which
storagebackend.Config was doing with runtime.Codec. Split the codec out.

Fix a typo on the name of the etcd2.go storage backend.

Finally, move DefaultStorageMediaType to server_run_options.
2016-05-18 10:39:21 -04:00
nikhiljindal 5dffe4a969 Moving federation apiserver to use genericapiserver.ServerRunOptions 2016-05-11 23:42:55 -07:00
nikhiljindal 2ffa3b4586 Moving StorageFactory building logic to genericapiserver 2016-05-10 00:57:11 -07:00
k8s-merge-robot f9b8fd0c96 Merge pull request #25011 from zhouhaibing089/addclose
Automatic merge from submit-queue

followup to add http server close method

Fixes #25009, a follow up of https://github.com/kubernetes/kubernetes/pull/24595.
2016-05-09 22:32:02 -07:00
k8s-merge-robot 1a1229e206 Merge pull request #24795 from deads2k/use-all-attributes
Automatic merge from submit-queue

enable resource name and service account cases for impersonation

Adds the resource name check since that attribute was added for authorization.  Also adds a check against a separate resource for service accounts.  Allowing impersonation of service accounts to use a different resource check places control of impersonation with the same users to have the power to get the SA tokens directly.

@kubernetes/kube-iam 
@sgallagher FYI
2016-05-09 04:58:19 -07:00
k8s-merge-robot ab36e0e35e Merge pull request #24710 from smarterclayton/store_proto_in_etcd
Automatic merge from submit-queue

Allow etcd to store protobuf objects

Split storage serialization from client negotiation, and allow API server to take flag controlling serialization.

TODO:

* [x] API server still doesn't start - range allocation object doesn't seem to round trip correctly to etcd
* [ ] Verify that third party resources are ignoring protobuf (add a test)
* [ ] Add integration tests that verify storage is correctly protobuf
* [ ] Add a global default for which storage format to prefer?
2016-05-05 19:00:20 -07:00
Seth Jennings 62d6fea561 fix log message for self-signed cert generation 2016-05-05 16:56:47 -05:00
Clayton Coleman e0ebcf4216
Split the storage and negotiation parts of Codecs
The codec factory should support two distinct interfaces - negotiating
for a serializer with a client, vs reading or writing data to a storage
form (etcd, disk, etc). Make the EncodeForVersion and DecodeToVersion
methods only take Encoder and Decoder, and slight refactoring elsewhere.

In the storage factory, use a content type to control what serializer to
pick, and use the universal deserializer. This ensures that storage can
read JSON (which might be from older objects) while only writing
protobuf. Add exceptions for those resources that may not be able to
write to protobuf (specifically third party resources, but potentially
others in the future).
2016-05-05 12:08:23 -04:00
Clayton Coleman 7e1089bb75
Storage, not Storgage 2016-05-05 12:08:22 -04:00
zhouhaibing089 5923fd352e followup to add http server close method 2016-05-05 12:04:41 +08:00
nikhiljindal 16c0e0a21c Deleting duplicate code from federated-apiserver 2016-05-03 14:04:09 -07:00
Hongchao Deng c0071a1595 add flags to enable etcd3 2016-04-28 09:48:16 +08:00
jianhuiz fdfe42ea44 move install of version handler to genericapiserver 2016-04-27 10:21:08 -07:00
Timothy St. Clair 24b4286960 In preparation for new storage backends renaming generic registry store 2016-04-26 08:32:13 -05:00
deads2k 622932422d enable resource name and service account cases for impersonation 2016-04-26 09:31:43 -04:00
k8s-merge-robot b04f6ffc48 Merge pull request #24646 from nikhiljindal/removeMasterDep
Automatic merge from submit-queue

Move SSHTunneler to genericapiserver and remove federated-apiserver's dependency on pkg/master

cc @jianhuiz
2016-04-25 19:50:37 -07:00
nikhiljindal f9f1e21e08 Moving master.SSHTunneler to genericapiserver 2016-04-22 11:47:05 -07:00
Clayton Coleman 3111985564 Handle streaming serializers more consistently
Add tests to watch behavior in both protocols (http and websocket)
against all 3 media types. Adopt the
`application/vnd.kubernetes.protobuf;stream=watch` media type for the
content that comes back from a watch call so that it can be
distinguished from a Status result.
2016-04-22 11:07:24 -04:00
deads2k 6670b73b18 make storage enablement, serialization, and location orthogonal 2016-04-21 08:18:55 -04:00
nikhiljindal 50a9aceabb Moving more logic to genericapiserver 2016-04-19 00:03:28 -07:00
k8s-merge-robot 62fd60565a Merge pull request #24048 from liggitt/apiserver-defaults
Automatic merge from submit-queue

Use correct defaults when binding apiserver flags

defaults should be set in the struct-creating function, then the current struct field value used as the default when binding the flag
2016-04-17 20:59:38 -07:00
k8s-merge-robot a275a045d1 Merge pull request #23914 from sky-uk/make-etcd-cache-size-configurable
Automatic merge from submit-queue

Make etcd cache size configurable

Instead of the prior 50K limit, allow users to specify a more sensible size for their cluster.

I'm not sure what a sensible default is here. I'm still experimenting on my own clusters. 50 gives me a 270MB max footprint. 50K caused my apiserver to run out of memory as it exceeded >2GB. I believe that number is far too large for most people's use cases.

There are some other fundamental issues that I'm not addressing here:
- Old etcd items are cached and potentially never removed (it stores using modifiedIndex, and doesn't remove the old object when it gets updated)
- Cache isn't LRU, so there's no guarantee the cache remains hot. This makes its performance difficult to predict. More of an issue with a smaller cache size.
- 1.2 etcd entries seem to have a larger memory footprint (I never had an issue in 1.1, even though this cache existed there). I suspect that's due to image lists on the node status.

This is provided as a fix for #23323
2016-04-17 00:06:31 -07:00
deads2k ac4c545b91 add act-as powers 2016-04-14 12:49:10 -04:00
Jordan Liggitt 6c1bcfa28d Use correct defaults when binding apiserver flags 2016-04-14 10:12:51 -04:00
k8s-merge-robot 429228d403 Merge pull request #23953 from nikhiljindal/u8sServer
Automatic merge from submit-queue

moving genericapiserver command line flags to genericapiserver

cc @kubernetes/sig-api-machinery
2016-04-13 23:15:24 -07:00
nikhiljindal 8d7a8c6ae6 moving genericapiserver command line flags to genericapiserver 2016-04-13 13:28:18 -07:00
James Ravn 5bb0595260 Make deserialization cache size configurable
Instead of the default 50K entries, allow users to specify more sensible
sizes for their cluster.
2016-04-12 13:42:27 +01:00
Clayton Coleman 3474911736 Implement a streaming serializer for watch
Changeover watch to use streaming serialization. Properly version the
watch objects. Implement simple framing for JSON and Protobuf (but not
YAML).
2016-04-11 11:22:05 -04:00
k8s-merge-robot 3197f31cc6 Merge pull request #23554 from nikhiljindal/swaggerInRun
Automatic merge from submit-queue

genericapiserver: Moving InstallSwaggerAPI to Run

Ref https://github.com/kubernetes/kubernetes/pull/21190#discussion_r57494673

Moving InstallSwaggerAPI() from InstallAPIGroups() to Run(). This allows the use of InstallAPIGroups() multiple times or using InstallAPIGroup() directly.

cc @jianhuiz @kubernetes/sig-api-machinery
2016-04-02 08:19:25 -07:00
nikhiljindal eeeaa6867a Moving InstallSwaggerAPI to Run 2016-03-28 23:04:14 -07:00
deads2k e8fb35d4d8 refactor resource overrides as positive logic interface 2016-03-28 09:24:49 -04:00
goltermann 32d569d6c7 Fixing all the "composite literal uses unkeyed fields" Vet errors. 2016-03-25 15:25:09 -07:00
k8s-merge-robot 903972e628 Merge pull request #20313 from AdoHe/apiserver_tls_overwrite
Auto commit by PR queue bot
2016-03-25 00:02:24 -07:00
AdoHe 2302c6604f fix apiserver tls overwrite bug 2016-03-24 12:33:37 -04:00
nikhiljindal 1cccfc7074 Disabling swagger ui by default. Adding a flag to enable it 2016-03-23 13:19:22 -07:00
Harry Zhang a4d04095d0 Refactor crlf & crypto 2016-03-21 20:20:05 +08:00
AdoHe 28e1d1af65 reduce component status probe timeout to 20s for quickly timeout 2016-03-14 22:18:55 -04:00
Brian Grant 532ba5a3c6 Merge pull request #21535 from AdoHe/restore_secure_etcd
restore ability to run against secured etcd
2016-03-11 12:14:06 -08:00
AdoHe 7228b9b987 restore ability to run against secured etcd 2016-03-11 11:21:16 -05:00
k8s-merge-robot d81d823ca5 Merge pull request #22393 from eparis/blunderbuss
Auto commit by PR queue bot
2016-03-02 18:51:56 -08:00
Eric Paris 5e5a823294 Move blunderbuss assignees into tree 2016-03-02 20:46:32 -05:00
Madhusudan.C.S 8b7e56d242 Allow cross-group subresource registrations in the APIInstaller.
This allows subresources which belong to different API groups than
their parents to be registered in the APIInstaller and REST handlers
installed for them. The specific changes that makes this possible
are:

1. Allow subresource overrides to be specified while registering an
   API group.
2. Use those overrides in the APIInstaller while validating the
   resource/subresource group version to allow subresources which
   belong to a different group to be registered if they have an
   override specified.
3. Use the RESTMapper supplied in the override to map the REST paths
   to the correct subresource storage object, i.e. correct group
   version kinds.
2016-03-02 10:57:30 -08:00
deads2k 357aebc89c update long running to handle recommend watch mechanism 2016-02-24 10:20:25 -05:00
nikhiljindal 20ce4aed0e Adding hostname to groups discovery information 2016-02-18 11:58:11 -08:00
k8s-merge-robot 17325ef6ef Merge pull request #20501 from piosz/hpa-ga
Auto commit by PR queue bot
2016-02-18 06:52:39 -08:00
Daniel Smith 74400c33ae changes for cross-group moves 2016-02-15 21:39:00 +01:00
Rudi Chiarito b46321c19f Fix Sprintf formatting in log message 2016-02-15 15:30:49 -05:00
nikhiljindal e2bffac285 Moving installing swagger spec to generic api server 2016-02-10 18:33:47 -08:00
Nikhil Jindal 4606d1408b Merge pull request #20532 from nikhiljindal/genericServerAPIs
Moving /apis handler to generic api server
2016-02-05 13:13:57 -08:00
Daniel Smith c399b49c29 Merge pull request #20431 from deads2k/tighten-api-installer
tighten api server installation for bad groups
2016-02-04 23:19:08 -08:00
nikhiljindal d267ab5f92 Moving /apis handler to generic server 2016-02-04 17:58:13 -08:00
Nikhil Jindal 59820827d4 Merge pull request #20513 from nikhiljindal/apiserverExampleTest
Adding test for apiserver example
2016-02-04 11:28:58 -08:00
nikhiljindal c7beb9078c Updating methods to return error rather than using glog.Fatalf 2016-02-03 16:00:45 -08:00
nikhiljindal 2aa28c6553 Adding test for apiserver example 2016-02-02 15:42:29 -08:00
k8s-merge-robot c5260c8c71 Merge pull request #20145 from mqliang/quorum-read
Auto commit by PR queue bot
2016-02-02 05:50:41 -08:00
deads2k 02dec92b1d tighten api server installation for bad groups 2016-02-01 15:25:14 -05:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
mqliang b0e06c14e5 add a knob to enable quorum read 2016-01-30 20:32:12 +08:00
Clayton Coleman 4d127dc969 Initialize API servers with negotiated serializers
Pass down into the server initialization the necessary interface for
handling client/server content type negotiation. Add integration tests
for the negotiation.
2016-01-22 01:10:22 -05:00
Clayton Coleman c1d932e44a Switch API objects to not register per version codecs
Remove Codec from versionInterfaces in meta (RESTMapper is now agnostic
to codec and serialization). Register api/latest.Codecs as the codec
factory and use latest.Codecs.LegacyCodec(version) as an equvialent to
the previous codec.
2016-01-22 01:10:21 -05:00
Clayton Coleman 125ef6fbc8 Support content-type negotiation in the API server
A NegotiatedSerializer is passed into the API installer (and
ParameterCodec, which abstracts conversion of query params) that can be
used to negotiate client/server request/response serialization. All
error paths are now negotiation aware, and are at least minimally
version aware.

Watch is specially coded to only allow application/json - a follow up
change will convert it to use negotiation.

Ensure the swagger scheme will include supported serializations - this
now includes application/yaml as a negotiated option.
2016-01-22 00:12:50 -05:00
nikhiljindal 2ad642d370 Merge registered and latest and move to apimachinery 2016-01-21 14:42:21 -08:00
Harry Zhang 936a11e775 Use networking to hold network related pkgs
Change names of unclear methods

Use net as pkg name for short
2016-01-15 13:46:16 +08:00
k8s-merge-robot 0df7e695d4 Merge pull request #19458 from davidopp/notsclose
Auto commit by PR queue bot
2016-01-12 13:53:13 -08:00
David Oppenheimer 8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -08:00
nikhiljindal f8d6c56ba6 Extracting server run code to genericapiserver 2016-01-08 18:34:34 -08:00
nikhiljindal 87ce093c77 Moving API registration logic to generic api server 2015-12-30 14:22:14 -08:00
nikhiljindal 2d952aaa87 Extracting APIServer machinery code into a library 2015-12-16 13:54:23 -08:00