Commit Graph

42431 Commits

Author SHA1 Message Date
Wojciech Tyczynski
fbd5c7c380 Revert "Refactored kubemark into cloud-provider independent code and GCE specific code" 2017-01-24 10:42:17 +01:00
Kubernetes Submit Queue
bcc1dc5c15 Merge pull request #28112 from liggitt/field-selector-value-escaping
Automatic merge from submit-queue

Allow fieldSelectors to match arbitrary values

Field selectors are intended to be able to match arbitrary data for specific field names. Because of how field selectors are parsed, data containing `,` characters is not possible to match today, and data containing leading `=` characters requires using the `==` operator to ensure the leading `=` is preserved.

This PR adds the ability to escape/unescape those special characters in field selector values so they can be parsed unambiguously

Process for escaping arbitrary data in field selector values (`fields.EscapeValue` helper provided):
1. Prefix literal `\` characters with a `\`
2. Prefix `,` characters with a `\`
3. Prefix `=` characters with a `\`

When unescaping a field selector value (`fields.UnescapeValue` helper provided), the following escape sequences are honored:
- `\\` -> `\`
- `\,` -> `,`
- `\=` -> `=`

Any other instances of `\` result in a parse error

Any unescaped instances of `,` and `=` in field selector values result in a parse error

Compatibility:
- `,` and `=` characters are currently unusable in fieldSelector values, so the `\,` and `\=` escape sequences have no compatibility impact
- `\\` changes from being interpreted as `\\` to `\`, and any other uses of `\` result in errors (this is mostly theoretical; I couldn't find any field-selector-enabled fields which is currently using field selectors to match `\` values)

```
Field selectors may now match values containing the characters `,` `=` or `\` by escaping them with a `\` character.
```
2017-01-23 23:54:35 -08:00
Kubernetes Submit Queue
43286a82c6 Merge pull request #39981 from fraenkel/optional_configmaps_secrets
Automatic merge from submit-queue

Optional configmaps and secrets

Allow configmaps and secrets for environment variables and volume sources to be optional

Implements approved proposal c9f881b7bb

Release note:
```release-note
Volumes and environment variables populated from ConfigMap and Secret objects can now tolerate the named source object or specific keys being missing, by adding `optional: true` to the volume or environment variable source specifications.
```
2017-01-23 23:06:35 -08:00
Kubernetes Submit Queue
f545d6ad47 Merge pull request #40057 from MrHohn/kubectl-create-seletor
Automatic merge from submit-queue (batch tested with PRs 40328, 40057)

Allows kubectl create -f to filter by selector.

From #32544.

The underlying `seletor` infrastructrue was implemented by #32599. The test is basically copy-paste of the corresponding test for `kubectl apply -f -l`.

```release-note
kubectl create now accepts the label selector flag for filtering objects to create
```
2017-01-23 22:19:11 -08:00
Kubernetes Submit Queue
29b89d3cbb Merge pull request #40328 from madhusudancs/federation-new-team
Automatic merge from submit-queue (batch tested with PRs 40328, 40057)

New Federation team.

cc @mml @irfanurrehman @shashidharatd @mwielgus
2017-01-23 22:19:10 -08:00
Jordan Liggitt
6f5598b1cb
Allow fieldSelectors to match arbitrary values 2017-01-23 23:48:45 -05:00
Kubernetes Submit Queue
61b7b3fb66 Merge pull request #40178 from smarterclayton/move_list_options
Automatic merge from submit-queue

Move ListOptions into meta

metav1.ListOptions is moving to k8s.io/apimachinery/pkg/apis/meta/v1.  The internal version will be reserved for server use (clients will use metav1), and all references changed.

Also, all references to the Namespace* constants are being moved to point to metav1.
2017-01-23 20:13:26 -08:00
Michael Fraenkel
ca207be4a3 Generated code 2017-01-23 20:12:24 -07:00
Michael Fraenkel
4e466040d9 Allow Optional ConfigMap and Secrets
- ConfigMaps and Secrets for Env or Volumes are allowed to be optional
2017-01-23 18:59:49 -07:00
Madhusudan.C.S
ff47e98e98 New Federation team. 2017-01-23 15:11:57 -08:00
Clayton Coleman
c60809aead
Test changes due to client-go staging changes 2017-01-23 17:52:47 -05:00
Clayton Coleman
da7b2b9c53
generated: staging client-go 2017-01-23 17:52:47 -05:00
Clayton Coleman
9009c1ac14
generated: informer,client 2017-01-23 17:52:47 -05:00
Clayton Coleman
469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
Clayton Coleman
245b592fac
Convert core code to metav1.ListOptions 2017-01-23 17:52:45 -05:00
Clayton Coleman
a35be4e02e
Update registries to use metainternalversion list options 2017-01-23 17:52:45 -05:00
Clayton Coleman
3ba366fcf1
Switch genericapiserver to use metainternalversion.ListOptions
Decouple ListOption parsing from the scheme - instead, it is a property
of the server (and clients should use metav1.ListOptions for now).
2017-01-23 17:52:42 -05:00
Clayton Coleman
c12344b3b8
Tests that check metav1 2017-01-23 16:53:19 -05:00
Clayton Coleman
f623a8c908
Make all groups use metav1.AddToGroupVersion for ListOptions 2017-01-23 16:53:18 -05:00
Clayton Coleman
93e7c60ae0
Generators should reference metav1.ListOptions (informer,client,fake) 2017-01-23 16:53:18 -05:00
Clayton Coleman
34e9e54ce1
Remove federation api defaulters 2017-01-23 16:53:18 -05:00
Clayton Coleman
4f865efdb9
Create meta/internalversion for ListOptions
Move over only the conversions that are needed, create a new scheme that
is private to meta and only accessible via ParameterCodec. Move half of
pkg/util/labels/.readonly to pkg/apis/meta/v1/labels.go
2017-01-23 16:53:18 -05:00
Clayton Coleman
bf20045736
Change the string serialization of the Nothing selector
The previous option was not serializable, and was used in questionable
scenarios to represent what we also use Everything() for. The individual
context needs to make the decision about everything vs nothing (and
nothing has no real concept in our API today) so this seems safe.
2017-01-23 16:53:17 -05:00
Clayton Coleman
c5059bd772
bump(k8s.io/gengo):c118aa8edfff53fe5b69127a970f54b6cf3a7563 2017-01-23 16:53:17 -05:00
Clayton Coleman
df831db360
Break dependency on testapi from core packages 2017-01-23 16:53:13 -05:00
Kubernetes Submit Queue
13424d874b Merge pull request #40208 from wojtek-t/smart_volume_manager
Automatic merge from submit-queue (batch tested with PRs 40205, 40208)

Make secret volume plugin use secret manager

Ref #19188

@gmarek
2017-01-23 13:40:03 -08:00
Kubernetes Submit Queue
0a45b7dffe Merge pull request #40205 from madhusudancs/fed-remove-federated-image-tag-dep
Automatic merge from submit-queue

Remove federated-image.tag from the .gitignore file.

This generated version metadata file was being written to a source
directory and caused a lot of pain. We are moving to a world where
this file is generated in the build/output artifacts directory and
also possibly looking at ways to entirely remove the federation
specific versions file. This is in-line with that goal of removing
the dependency on federated-image.tag file.

cc @kubernetes/sig-federation-misc
2017-01-23 13:12:52 -08:00
Kubernetes Submit Queue
aee38b13a6 Merge pull request #40010 from sttts/sttts-timeout-error-group-resource
Automatic merge from submit-queue (batch tested with PRs 39341, 40010)

genericapiserver/api/filters: cut off pkg/api dependency and fix timeout status

The timeout status did not have a proper group version and verb. With the `RequestInfo` available we can easily create a proper status object.

As a side-product we cut off the dependency to `pkg/api` from `genericapiserver/api/filters`.

Follow-up with version negotiation is here: https://github.com/kubernetes/kubernetes/pull/40211
2017-01-23 12:23:04 -08:00
Kubernetes Submit Queue
fce60637ae Merge pull request #39341 from smarterclayton/termination_log
Automatic merge from submit-queue

Improve TerminationMessagePath to be more flexible

* Support `terminationMessagePolicy: fallbackToLogsOnError` which allows pod authors to get useful information from containers as per kubernetes/community#154
* Set an upper bound on the size of the termination message path or log output to prevent callers from DoSing the master
* Add tests for running as root, non-root, and for the new terminationMessagePolicy cases.

I set the limit to 4096 bytes, but this may be too high for large pod containers.  Probably need to set an absolute bound, i.e. max message size allowed is 20k total, and we truncate if we're above that limit.

Fixes #31839, #23569

```release-note
A new field `terminationMessagePolicy` has been added to containers that allows a user to request `FallbackToLogsOnError`, which will read from the container's logs to populate the termination message if the user does not write to the termination message log file.  The termination message file is now properly readable for end users and has a maximum size (4k bytes) to prevent abuse.  Each pod may have up to 12k bytes of termination messages before the contents of each will be truncated.
```
2017-01-23 12:13:33 -08:00
Kubernetes Submit Queue
da14a4d836 Merge pull request #40309 from apelisse/complete-owners
Automatic merge from submit-queue

OWNERS: Update latest OWNERS files

These files have been created lately, so we don't have much information
about them anyway, so let's just:
- Remove assignees and make them approvers
- Copy approves as reviewers
2017-01-23 11:24:51 -08:00
Kubernetes Submit Queue
ee986696c8 Merge pull request #40171 from yujuhong/deprecate_nsenter_exec
Automatic merge from submit-queue (batch tested with PRs 40251, 40171)

Mark --docker-exec-handler deprecated

We plan to drop support for the nsenter exec handler in the future. Marking this flag as deprecated to warn the users.
2017-01-23 11:24:09 -08:00
Kubernetes Submit Queue
7065c477cb Merge pull request #40251 from mml/sudo
Automatic merge from submit-queue (batch tested with PRs 40251, 40171)

Only run gcloud as root if we plan to change something.

Only run gcloud as root if we plan to change something.

Fixes bug introduced in #36292 @jlowdermilk @ixdy
2017-01-23 11:24:06 -08:00
Dr. Stefan Schimanski
128594d17c genericapiserver/api/filters: cut off pkg/api dependency and fix timeout status 2017-01-23 19:06:51 +01:00
Antoine Pelisse
62af7dd33d OWNERS: Update latest OWNERS files
These files have been created lately, so we don't have much information
about them anyway, so let's just:
- Remove assignees and make them approvers
- Copy approves as reviewers
2017-01-23 10:05:48 -08:00
Clayton Coleman
6ea557d4b2
Fix tests after new defaulted value added 2017-01-23 12:37:21 -05:00
Clayton Coleman
2bb2604f0b
Limit the size of the termination log and allow log input
Enforce the following limits:

12kb for total message length in container status
4kb for the termination message path file
2kb or 80 lines (whichever is shorter) from the log on error

Fallback to log output if the user requests it.
2017-01-23 12:26:38 -05:00
Clayton Coleman
eff134cd5f
Use chmod to bypass umask on termination log file
os.Create() will obey the umask which results in the file being 0644
when injected in the container.
2017-01-23 12:26:37 -05:00
Clayton Coleman
244734171e
Add conformance tests for terminationMessage(Path|Policy)
Test root, non-root, success and message, failure and message.
2017-01-23 12:26:37 -05:00
Clayton Coleman
e6d35b0362
generated: api 2017-01-23 12:26:35 -05:00
Clayton Coleman
be3ce22dd3
Add TerminationMessagePolicy 2017-01-23 12:26:00 -05:00
Clayton Coleman
0ce0c759a2
bump:(github.com/armon/circbuf):bbbad097214e2918d8543d5201d12bfd7bca254d 2017-01-23 12:25:56 -05:00
Kubernetes Submit Queue
46bfa1ee11 Merge pull request #39933 from pmorie/generic-registry-feedback
Automatic merge from submit-queue

Make generic registry easier to understand

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

This PR makes the generic registry and some areas of the api REST abstractions easier to understand by adding and clarifying comments.  These comments are based on digging that was done to implement a new API server and REST storage for resources in a wholly-new API group.

**Release note**:
```release-note
NONE
```
2017-01-23 09:17:27 -08:00
Kubernetes Submit Queue
5ea80569ae Merge pull request #40227 from deads2k/client-11-easy
Automatic merge from submit-queue

make client-go tools/auth and tools/clientcmd authoritative

These moved easily.  Pure mechanical.  I'll have a couple snip pulls for some of the more complicated packages.  `pkg/util/homedir` was a transitive that moved with. It was only used in `kubectl` and you'd need it to be consistent with `clientcmd` loading order.

@sttts
2017-01-23 09:07:17 -08:00
Kubernetes Submit Queue
071844e35f Merge pull request #40292 from luxas/kubeadm_node_ca
Automatic merge from submit-queue (batch tested with PRs 38445, 40292)

kubeadm: Secure apiserver -> kubelet communication and set storage backend to etcd3

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

Switch storage backend to etcd3
Writes ca.crt down to disk so we can set `--client-ca-file=/etc/kubernetes/ca.crt` for the kubelet.
Adds --kubelet-client-{certificate,key} to the apiserver args and make it allowed to access the kubelets
In some cases the `path` dependency is switched to `filepath`

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

fixes https://github.com/kubernetes/kubeadm/issues/118
fixes https://github.com/kubernetes/kubeadm/issues/129

**Special notes for your reviewer**:

This PR is should make it possible to secure the apiserver -> kubelet communication.

**Release note**:

```release-note
NONE
```

@pires @mikedanese @andrewrynhard @liggitt @deads2k
2017-01-23 08:11:08 -08:00
Kubernetes Submit Queue
1f1f3692bd Merge pull request #38445 from brendandburns/configmap2
Automatic merge from submit-queue (batch tested with PRs 38445, 40292)

Add the ability to edit fields within a config map.

Addresses part of https://github.com/kubernetes/kubernetes/issues/36222

Example command:

```console
$ kubectl edit configmap foo --config-map-data=bar
```

Will open the data element named `bar` in the `ConfigMap` named `foo` in `$EDITOR`, the edited contents are then updated back to the config map.

@kubernetes/sig-cli 

```release-note
Add a special purpose tool for editing individual fields in a ConfigMap with kubectl
```
2017-01-23 08:11:06 -08:00
Wojciech Tyczynski
e0784f2e00 Propage secret volumes in secret manager 2017-01-23 16:10:01 +01:00
Wojciech Tyczynski
bf7138652f SecretVolume using secret manager 2017-01-23 16:10:01 +01:00
deads2k
335ef747d6 mechanical 2017-01-23 10:03:55 -05:00
deads2k
0fed47b27f script 2017-01-23 09:57:28 -05:00
deads2k
644021d0a1 update client-go 2017-01-23 09:57:00 -05:00