Commit Graph

42438 Commits (8cc00744b79265f9e5ccef2dc236f313f3969f96)

Author SHA1 Message Date
Wojciech Tyczynski 8cc00744b7 Merge pull request #40352 from kubernetes/revert-39033-provider-independent-kubemark
Revert "Refactored kubemark into cloud-provider independent code and GCE specific code"
2017-01-24 11:39:23 +01:00
Kubernetes Submit Queue 0fac54e65e Merge pull request #40316 from luxas/kubeadm_fix_apiserver_certs
Automatic merge from submit-queue (batch tested with PRs 40303, 40316)

kubeadm: Fix up the apiserver kubelet client cert

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

I didn't notice that the apiserver serving cert was _only_ a server cert, not both a server and client cert in https://github.com/kubernetes/kubernetes/pull/40292.

This PR fixes that misconception and generates a dedicated client cert for apiserver -> kubelet communication and harmonizes the `ca.crt` path to `/etc/kubernetes/pki/ca.crt` on both master and node.

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

**Special notes for your reviewer**:

```console
$ systemctl cat kubelet
# /lib/systemd/system/kubelet.service
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=http://kubernetes.io/docs/

[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--kubeconfig=/etc/kubernetes/kubelet.conf **--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt** --require-kubeconfig=true"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true"
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10 --cluster-domain=cluster.local"
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_EXTRA_ARGS


$ curl -k https://localhost:10250/containerLogs/kube-system/weave-net-arm64-4t2xv/weave
Forbidden (user=system:anonymous, verb=get, resource=nodes, subresource=proxy)
$ curl --cert /etc/kubernetes/pki/apiserver-kubelet-client.crt --key /etc/kubernetes/pki/apiserver-kubelet-client.key -k https://localhost:10250/containerLogs/kube-system/weave-net-arm64-4t2xv/weave
[Works!!]
```

**Release note**:

```release-note
NONE
```

@liggitt @deads2k
2017-01-24 01:57:11 -08:00
Kubernetes Submit Queue 65ca1f98cb Merge pull request #40303 from sttts/sttts-golint-staging
Automatic merge from submit-queue (batch tested with PRs 40303, 40316)

Reactivate golint in staging

Run golint against staging with `staging/src/k8s.io/client-go/pkg` as the only exception. While doing this reset `hack/.linted_packages` which collected a lot of cruft. We now enforce that gone packages are removed.
2017-01-24 01:57:10 -08:00
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
Dr. Stefan Schimanski 81461f7214 hack/verify-golint: enforce cleanup of old packages 2017-01-24 08:34:06 +01:00
Dr. Stefan Schimanski d0eb7f88a6 Reset hack/.linted_packages 2017-01-24 08:34:06 +01:00
Dr. Stefan Schimanski 8f85e11e6a hack/verify-golint.sh: add authorative staging packages 2017-01-24 08:32:19 +01: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
Lucas Käldström 695fb7440e
Fix up the misunderstanding about the apiserver kubelet client cert 2017-01-23 21:45:48 +02: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