Commit Graph

590 Commits (63602348a46dae777038be34470c0d7d025420fe)

Author SHA1 Message Date
k8s-merge-robot 7abc3de621 Merge pull request #29694 from jsafrane/dynprov2-apionly
Automatic merge from submit-queue

Add API for StorageClasses

This is the API objects only required for dynamic provisioning picked apart from the controller logic.

Entire feature is here: https://github.com/kubernetes/kubernetes/pull/29006
2016-07-28 22:00:05 -07:00
childsb f5bd7d471e API Changes for StorageClass 2016-07-28 19:01:01 -04:00
Chao Xu 5d6b671d49 make CertificateSigningRequestList.Items a required field 2016-07-22 13:19:48 -07:00
derekwaynecarr d6e23b984c Add codegen artifacts for kubelet flag 2016-07-21 10:06:17 -04:00
derekwaynecarr 99bddd23c4 Add eviction minimum reclaim option to kubelet 2016-07-21 10:06:17 -04:00
Wojciech Tyczynski 4d0d115690 Revert "add tokenreviews endpoint to implement webhook" 2016-07-21 09:40:35 +02:00
k8s-merge-robot 8ead63f127 Merge pull request #28788 from deads2k/wire-authentication
Automatic merge from submit-queue

add tokenreviews endpoint to implement webhook

Wires up an API resource under `apis/authentication.k8s.io/v1beta1` to expose the webhook token authentication API as an API resource.  This allows one API server to use another for authentication and uses existing policy engines for the "authoritative" API server to controller access to the endpoint.

@cjcullen you wrote the initial type
2016-07-20 22:23:45 -07:00
deads2k 2256c6e619 fix String protobuf generator 2016-07-20 15:11:57 -04:00
deads2k 2c4a9f2e8d interesting changes to add tokenreviews endpoint to implement webhook 2016-07-20 15:11:56 -04:00
deads2k bfa2ff00b9 generated code changes 2016-07-20 15:11:56 -04:00
k8s-merge-robot 8043baf12d Merge pull request #29071 from albatross0/fix_rbac_for_serviceaccounts
Automatic merge from submit-queue

Fix RBAC authorizer of ServiceAccount

RBAC authorizer assigns a role to a wrong service account.

How to reproduce

1.Create role and rolebinding to allow default user in kube-system namespace to read secrets in kube-system namespace.

```
# kubectl create -f role.yaml
# kubectl create -f binding.yaml
```

```yaml
# role.yaml
kind: Role
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: secret-reader
  namespace: kube-system
rules:
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "watch", "list"]
    nonResourceURLs: []
```

```yaml
# binding.yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: read-secrets
  namespace: kube-system
subjects:
  - kind: ServiceAccount
    name: default
    namespace: kube-system
roleRef:
  kind: Role
  namespace: kube-system
  name: secret-reader
  apiVersion: rbac.authorization.k8s.io/v1alpha1
```

2.Set a credential of default user

```
$ kubectl config set-credentials default_user --token=<token_of_system:serviceaccount:kube-system:default>
$ kubectl config set-context default_user-context --cluster=test-cluster --user=default_user
$ kubectl config use-context default_user-context
```

3.Try to get secrets as default user in kube-system namespace

```
$ kubectl --namespace=kube-system get secrets
the server does not allow access to the requested resource (get secrets)
```

As shown above, default user could not access to secrets.
But if I have kube-system user in default namespace, it is allowed access to secrets.


4.Create a service account and try to get secrets as kube-system user in default namespace

```
# kubectl --namespace=default create serviceaccount kube-system
serviceaccount "kube-system" created
$ kubectl config set-credentials kube-system_user --token=<token_of_system:serviceaccount:default:kube-system>
$ kubectl config set-context kube-system_user-context --cluster=test-cluster --user=kube-system_user
$ kubectl config use-context kube-system_user-context
$ kubectl --namespace=kube-system get secrets
NAME                  TYPE                                  DATA      AGE
default-token-8pyb3   kubernetes.io/service-account-token   3         4d

```
2016-07-20 11:51:42 -07:00
albatross0 d1b14e2fae Fix RBAC authorizer of ServiceAccount
RBAC authorizer assigns a role to a wrong service account.
2016-07-21 01:50:08 +09:00
George Tankersley 9e45f62fc3 codegen: update componentconfig 2016-07-19 11:25:38 -07:00
George Tankersley 803c7ac299 certificates: implement certificates controller 2016-07-19 11:25:38 -07:00
k8s-merge-robot fa174bcdaf Merge pull request #29042 from dims/fixup-imports
Automatic merge from submit-queue

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-18 07:23:38 -07: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
Tim Hockin 1f37281dae Scale kube-proxy conntrack limits by cores
For large machines we want more conntrack entries than smaller machines.
2016-07-15 16:36:40 -07:00
k8s-merge-robot e576a2f760 Merge pull request #29017 from thockin/undelete-generated-files
Automatic merge from submit-queue

Undelete generated files

There's been enough people broken by not committing generated code, that we
should undo that until we have a proper client that is `go get` compatible.

This is temporary.

Fixes #28920
2016-07-15 16:27:14 -07:00
Tim Hockin 3384e03920 Commit generated files
There's been enough people broken by not committing generated code, that we
should undo that until we have a proper client that is `go get` compatible.

This is temporary.
2016-07-15 10:27:51 -07:00
Buddha Prakash 5000e74664 Inject top level QoS cgroup creation in the Kubelet 2016-07-15 10:02:22 -07:00
k8s-merge-robot 5844145795 Merge pull request #28815 from smarterclayton/fix_stringer
Automatic merge from submit-queue

Generate a better Stringer method for proto types

This replaces the bad string output generated by golang/proto with gogo/protobuf stringer generation. Makes the output similar to %#v and more debuggable. We have to have a String() method to implement proto.Message, so this is strictly better.

@wojtek-t, @thockin for after your PR merges

Fixes #28756
2016-07-15 05:49:40 -07:00
Michael Taufen e52718bbc6 Clean up API
Move SystemReserved and KubeReserved into KubeletConfiguration struct
Convert int64 to int32 for some external type fields so they match internal ones
tLS* to tls* for JSON field names
Fix dependency on removed options.AutoDetectCloudProvider
Change floats in KubeletConfiguration API to ints
2016-07-14 18:40:11 -07:00
Michael Taufen 2e49f6b64a Make it build!
Update external KubeletConfiguration type
Add defaults for new KubeletConfiguration fields
Modify some defaults to match upstream settings
Add/rename some conversion functions
Updated codegen
Fixed typos
Mike Danese caught that s.NodeLabels wasn't allocated, fix on line 118
of cmd/kubelet/app/options/options.go.
Provide list of valid sources in comment for HostNetworkSources field
2016-07-14 18:38:58 -07:00
Mike Danese e235073c26 f 2016-07-14 18:38:58 -07:00
Mike Danese e070cb617a componentconfig: add external kubelet configuration type 2016-07-14 18:38:58 -07:00
Clayton Coleman 866e788aba
generate: New Stringers 2016-07-14 12:43:36 -04:00
gmarek f6b1c316e9 Allow switching rate limiter inside RateLimitedQueue 2016-07-14 15:38:14 +02:00
k8s-merge-robot ae990defcf Merge pull request #26956 from joe2far/fix-typos
Automatic merge from submit-queue

Fixed several typos
2016-07-14 04:13:15 -07:00
k8s-merge-robot b50e66c66e Merge pull request #28340 from ZTE-PaaS/zhangke-patch-007
Automatic merge from submit-queue

controller-manager support number of garbage collector workers to be configurable

The number of garbage collector workers of controller-manager is a fixed value 5 now, make it configurable should more properly
2016-07-13 12:54:15 -07:00
joe2far 5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
Ke Zhang d74010211a controller-manager support number of garbage collector workers to be configurable 2016-07-13 13:13:20 +08:00
Tim Hockin 9eb42ff108 Don't check in generated conversion code
Conversion is now generated by Makefile, on demand, rather than all at once.
Manually verified no net change in generated code.
2016-07-12 21:52:54 -07:00
Tim Hockin 58441e8775 Don't check in generated deep-copy code
This mostly takes the previously checked in files and removes them, and moves
the generation to be on-demand instead of manual.  Manually verified no change
in generated output.
2016-07-12 21:52:54 -07:00
k8s-merge-robot 708e753c72 Merge pull request #28679 from sttts/sttts-deepcopy-pointer-in
Automatic merge from submit-queue

Deepcopy: avoid struct copies and reflection Call

- make signature of generated deepcopy methods symmetric with `in *type, out *type`, avoiding copies of big structs on the stack
- switch to `in interface{}, out interface{}` which allows us to call them with without `reflect.Call`

The first change reduces runtime of BenchmarkPodCopy-4 from `> 3500ns` to around `2300ns`.

The second change reduces runtime to around `1900ns`.
2016-07-12 21:45:43 -07:00
Dr. Stefan Schimanski 629b25daf9 Run hack/update-all.sh 2016-07-12 20:36:48 +02:00
Eric Chiang addc4b166c rbac authorizer: support non-resource urls with stars ("/apis/*") 2016-07-12 10:01:53 -07:00
Eric Chiang 411922f66c rbac authorizer: include verb in non-resource url requests 2016-07-12 10:01:53 -07:00
Tim Hockin 291b51ec50 Use file tags to generate conversions
This drives conversion generation from file tags like:
  // +conversion-gen=k8s.io/my/internal/version
.. rather than hardcoded lists of packages.

The only net change in generated code can be explained as correct.  Previously
it didn't know that conversion was available.
2016-07-07 22:09:08 -07:00
Tim Hockin dc10f10e48 Recreate the opt-in/opt-out logic for deepcopy
This is the last piece of Clayton's #26179 to be implemented with file tags.
All diffs are accounted for.  Followup will use this to streamline some
packages.

Also add some V(5) debugging - it was helpful in diagnosing various issues, it
may be helpful again.
2016-07-07 16:49:46 -07:00
Tim Hockin 28af54138d Use file tags to generate deep-copies
This drives most of the logic of deep-copy generation from tags like:
  // +deepcopy-gen=package
..rather than hardcoded lists of packages.  This will make it possible to
subsequently generate code ONLY for packages that need it *right now*, rather
than all of them always.

Also remove pkgs that really do not need deep-copies (no symbols used
anywhere).
2016-07-07 16:49:46 -07:00
Tim Hockin d88fc84bae Make multi-key tags more explicit
This is in prep to simplify tag logic.  Don't rely on processing commas as new
tag delimiters.  Put new tags on new lines.  This had zero effect on generated
code (as intended).
2016-07-07 16:49:46 -07:00
Tim Hockin 57c3196914 Add support for manually defined DeepCopy methods
In bringing back Clayton's PR piece-by-piece this was almost as easy to
implement as his version, and is much more like what I think we should be
doing.

Specifically, any time which defines a .DeepCopy() method will have that method
called preferentially.  Otherwise we generate our own functions for
deep-copying.  This affected exactly one type - resource.Quantity.  In applying
this heuristic, several places in the generated code were simplified.

To achieve this I had to convert types.Type.Methods from a slice to a map,
which seems correct anyway (to do by-name lookups).
2016-07-07 16:49:46 -07:00
Tim Hockin e18b2f3a2e Revert Clayton's #26179 so I can recreate it
His PR cam during the middle of this development cycle, and it was easier to
burn it down and recreate it than try to patch it into an existing series and
re-test every assumption.  This behavior will be re-introduced in subsequent
commits.
2016-07-07 16:49:46 -07:00
bin liu 426fdc431a Merge branch 'master' into fix-typos 2016-07-04 11:20:47 +08:00
Tim Hockin bb208a02b3 Make IsValidPercent return error strings 2016-07-02 17:34:32 -07:00
Tim Hockin 14bece550f Make IsValidPortNum/Name return error strings 2016-07-02 17:32:05 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot 32eccd413f Merge pull request #25562 from gtank/certificates-api-v9
Automatic merge from submit-queue

TLS bootstrap API group (alpha)

This PR only covers the new types and related client/storage code- the vast majority of the line count is codegen. The implementation differs slightly from the current proposal document based on discussions in design thread (#20439). The controller logic and kubelet support mentioned in the proposal are forthcoming in separate requests.

I submit that #18762 ("Creating a new API group is really hard") is, if anything, understating it. I've tried to structure the commits to illustrate the process.

@mikedanese @erictune @smarterclayton @deads2k

```release-note-experimental
An alpha implementation of the the TLS bootstrap API described in docs/proposals/kubelet-tls-bootstrap.md.
```

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-28 13:25:22 -07:00
George Tankersley c9c6fff269 codegen: GENERATE ALL THE THINGS 2016-06-28 12:05:41 -07:00
George Tankersley f8f7e7e3c7 codegen: add certificates group to generators 2016-06-28 12:05:41 -07:00