Commit Graph

109 Commits (f34a24e98e7c837b567b78be3af958ac1156cd80)

Author SHA1 Message Date
Anthony Yeh 89cfaf9184
Fix loss of Conditions during RC/RS conversion. 2017-10-18 11:46:31 -07:00
Anthony Yeh b4815bd4cb
Fix loss of MinReadySeconds on RC/RS conversion. 2017-10-18 11:46:31 -07:00
Anthony Yeh f290819f75
Fix loss of selector during RC/RS conversion.
The `out` parameter in Convert_map_to_unversioned_LabelSelector was
being ignored.
2017-10-18 11:46:31 -07:00
Kubernetes Submit Queue 6ec80eac1b Merge pull request #51816 from liggitt/xiangpengzhao-remove-initc-anno
Automatic merge from submit-queue

Remove deprecated init-container in annotations

fixes #50655
fixes #51816 
closes #41004
fixes #51816 

Builds on #50654 and drops the initContainer annotations on conversion to prevent bypassing API server validation/security and targeting version-skewed kubelets that still honor the annotations

```release-note
The deprecated alpha and beta initContainer annotations are no longer supported. Init containers must be specified using the initContainers field in the pod spec.
```
2017-09-03 17:35:11 -07:00
Jordan Liggitt 525254a3d1
Drop alpha/beta init containers annotations on conversion 2017-09-01 14:45:08 -04:00
Kubernetes Submit Queue 6650bbe0dd Merge pull request #50582 from dixudx/support_fieldSelector_spec.schedulerName
Automatic merge from submit-queue (batch tested with PRs 50889, 51347, 50582, 51297, 51264)

support fieldSelector spec.schedulerName

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

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

**Special notes for your reviewer**:
/assign @davidopp  @bsalamat
/cc @lavalamp

**Release note**:

```release-note
add fieldSelector spec.schedulerName
```
2017-08-25 22:43:32 -07:00
xiangpengzhao 8719b4a8ea Remove deprecated init-container in annotations 2017-08-25 13:39:29 +08:00
David Eads 9daf55e173 remove unnecessary field conversions 2017-08-23 10:52:22 -04:00
Di Xu 58669f6f1d support fieldSelector spec.schedulerName 2017-08-18 13:32:09 +08:00
Jess Frazelle 0f349cc61f
allowPrivilegeEscalation: modify api types & add functionality
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-07-24 12:52:41 -04:00
xiangpengzhao 0f65b218a0
Add Pod UID (metadata.uid) to downward API env var 2017-06-27 16:54:35 +08:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Chao Xu 9f5f4ba729 run pkg/api/v1/rewrite....sh, pkg/api/v1 (not including subdir) compile 2017-06-22 10:25:12 -07:00
Zihong Zheng a82676a126 Keep annotation_key_constants consistent 2017-05-16 14:25:30 -07:00
Kubernetes Submit Queue 1f6bc94bf8 Merge pull request #39713 from k82cn/init_container_defaults
Automatic merge from submit-queue

Set defaults of init containers.

fixes #38542
2017-05-06 23:03:48 -07:00
Tim Hockin 9153bfa911 Remove deprecatedPublicIPs field 2017-04-15 13:16:05 -07:00
Klaus Ma 7b7a759915 Set defaults for initContainer beta. 2017-04-12 10:06:38 +08:00
andrewsykim 91c027d6cc support hostIP in downward API 2017-03-28 20:20:19 -04:00
deads2k db0b0bd0f5 move metav1 conversions to metav1 2017-02-14 11:47:23 -05:00
Yu-Ju Hong 999f8dff8e Remove the temporary fix for pre-1.0 mirror pods 2017-02-02 10:37:19 -08:00
Michail Kargakis 1d3748d7e5 registry: invalidate updates to non-convertible selectors 2017-01-21 23:42:55 +01:00
Clayton Coleman 36acd90aba
Move APIs and core code to use metav1.ObjectMeta 2017-01-17 16:17:18 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Clayton Coleman f07c6486ba
Rename metav1.Event to metav1.WatchEvent to avoid swagger collision
The kind on this object was always WatchEvent
2017-01-06 23:45:04 -05:00
Clayton Coleman e5019de260
refactor: Move versioned/watch to meta/v1 2017-01-06 23:45:03 -05:00
Klaus Ma cd6792ae08 Add default imagePullPolicy for initContainers. 2016-12-22 09:29:43 +08:00
Clayton Coleman 3ff5cb6ec7
Move resource.Quantity rounding to defaulter
This reverts commit feb56cc486.
2016-10-26 12:21:27 -04:00
Wojciech Tyczynski feb56cc486 Revert "Move resource.Quantity rounding to defaulter"
This reverts commit 5b18b4e515.
2016-10-26 10:21:54 +02:00
Clayton Coleman 5b18b4e515
Move resource.Quantity rounding to defaulter 2016-10-25 19:28:41 -04:00
Clayton Coleman 65042efb0f
Add conversion instructions 2016-10-25 19:28:40 -04:00
Clayton Coleman 3ee591d7ab
Invoke init container defaulting in conversion
Because annotations...

Remove old references to DefaultingInterface in manual conversions.
2016-10-18 21:07:35 -04:00
Clayton Coleman 5062406b77
Hand generated conversion should check nil 2016-10-18 21:07:32 -04:00
Michail Kargakis 1df4ee3a9d Custom conversion reactions to minReadySeconds/availableReplicas 2016-09-28 11:06:40 +02:00
Dawn Chen 4c4623e5be Fix backward compatibility issue caused by promoting initcontainers from alpha to beta. 2016-09-19 16:33:25 -07:00
Kubernetes Submit Queue b569a8daa9 Merge pull request #31053 from justinsb/dont_close_over_range_loops
Automatic merge from submit-queue

Avoid closing over range variables
2016-08-22 17:40:25 -07:00
Kubernetes Submit Queue e9bd805888 Merge pull request #31026 from erictune/betainit
Automatic merge from submit-queue

Move init-container feature from alpha to beta.

```release-note
Moved init-container feature from alpha to beta.

In 1.3, an init container is specified with this annotation key
on the pod or pod template: `pods.alpha.kubernetes.io/init-containers`.

In 1.4, either that key or this key: pods.beta.kubernetes.io/init-containers`,
can be used.

When you GET an object, you will see both annotation keys with the same values.

You can safely roll back from 1.4 to 1.3, and things with init-containers
will still work (pods, deployments, etc).

If you are running 1.3, only use the alpha annotation, or it may be lost when
rolling forward.

The status has moved from annotation key
`pods.beta.kubernetes.io/init-container-statuses` to
`pods.beta.kubernetes.io/init-container-statuses`.
Any code that inspects this annotation should be changed to use the new key.

State of Initialization will continue to be reported in both pods.alpha.kubernetes.io/initialized
and in `podStatus.conditions.{status: "True", type: Initialized}`
```

Mini-design for this change:

Goals:
1. A user can create an object with the beta annotation
  on 1.4, and it works.  The fact that the annotation has beta
  in it communicates to the user that the feature is beta,
  and so the user should have confidence in using it.  Preferably,
  when the user gets the annotation back, he see the beta
  annotation.
1) If someone had an existing alpha object in their apiserver,
  such as a RS with a pod template with an init-containers
  annotation on it, it should continue to work (init containers
  run) when stack upgraded to 1.4.
2) If someone is using a chart or blog post that has alpha
  annotation on it and they create it on a 1.4 cluster, it should
  work.
3) If someone had something with an init container in 1.4
  and they roll back stack to 1.3, it should not silently stop
  working (init containers don't run anymore).

To meet all these, we mirror an absent beta label from the alpha
key and vice versa.  If they are out of sync, we use the alpha
one. We do this in conversion since there was already logic there.

In 1.3 code, all annotations are preserved across a round trip
(v1 -> api -> v1), and the alpha annotation turns into the internal
field that kubelet uses.

In 1.4 code, the alpha annotation is always preserved across
a round trip, and a beta annotation is always set equal to
the alpha one, after a round trip.

Currently, the kubelet always sees the object after a round trip
when it GETs it.  But, we don't want to rely on that behavior,
since it will break when fastpath is implemented.

So, we rely on this:
all objects either are created with an alpha annotation (1.3 or 1.4
code) or are created with a beta annotation under 1.4.  In the later
case, they are round tripped at creation time, and so get both
annotations.  So all subsequent GETs see both labels.
2016-08-21 05:04:11 -07:00
Clayton Coleman e1ebde9f92
Add spec.nodeName and spec.serviceAccountName to downward env var
The serviceAccountName is occasionally useful for clients running on
Kube that need to know who they are when talking to other components.

The nodeName is useful for PetSet or DaemonSet pods that need to make
calls back to the API to fetch info about their node.

Both fields are immutable, and cannot easily be retrieved in another
way.
2016-08-20 15:50:36 -04:00
Justin Santa Barbara 3aa4f50aba Avoid closing over range variables
The consequence is only a misleading error message, but it is easy to
avoid.
2016-08-20 01:19:53 -04:00
Eric Tune 6e5a7f9441 Move init-container feature from alpha to beta.
```relnote
Moved init-container feature from alpha to beta.

In 1.3, an init container is specified with this annotation key
on the pod or pod template: `pods.alpha.kubernetes.io/init-containers`.

In 1.4, either that key or this key: pods.beta.kubernetes.io/init-containers`,
can be used.

When you GET an object, you will see both annotation keys with the same values.

You can safely roll back from 1.4 to 1.3, and things with init-containers
will still work (pods, deployments, etc).

If you are running 1.3, only use the alpha annotation, or it may be lost when
rolling forward.

The status has moved from annotation key
`pods.beta.kubernetes.io/init-container-statuses` to
`pods.beta.kubernetes.io/init-container-statuses`.
Any code that inspects this annotation should be changed to use the new key.

State of Initialization will continue to be reported in both pods.alpha.kubernetes.io/initialized
and in `podStatus.conditions.{status: "True", type: Initialized}`
```

Mini-design for this change:

Goals:
1. A user can create an object with the beta annotation
  on 1.4, and it works.  The fact that the annotation has beta
  in it communicates to the user that the feature is beta,
  and so the user should have confidence in using it.  Preferably,
  when the user gets the annotation back, he see the beta
  annotation.
1) If someone had an existing alpha object in their apiserver,
  such as a RS with a pod template with an init-containers
  annotation on it, it should continue to work (init containers
  run) when stack upgraded to 1.4.
2) If someone is using a chart or blog post that has alpha
  annotation on it and they create it on a 1.4 cluster, it should
  work.
3) If someone had something with an init container in 1.4
  and they roll back stack to 1.3, it should not silently stop
  working (init containers don't run anymore).

To meet all these, we mirror an absent beta label from the alpha
key and vice versa.  If they are out of sync, we use the alpha
one. We do this in conversion since there was already logic there.

In 1.3 code, all annotations are preserved across a round trip
(v1 -> api -> v1), and the alpha annotation turns into the internal
field that kubelet uses.

In 1.4 code, the alpha annotation is always preserved across
a round trip, and a beta annotation is always set equal to
the alpha one, after a round trip.

Currently, the kubelet always sees the object after a round trip
when it GETs it.  But, we don't want to rely on that behavior,
since it will break when fastpath is implemented.

So, we rely on this:
all objects either are created with an alpha annotation (1.3 or 1.4
code) or are created with a beta annotation under 1.4.  In the later
case, they are round tripped at creation time, and so get both
annotations.  So all subsequent GETs see both labels.
2016-08-19 14:00:18 -07:00
nikhiljindal 1d76884336 Adding events to federation apiserver 2016-08-12 10:48:19 -07:00
Daniel Smith f1fd638962 fix register.go files up + add test import 2016-08-11 17:06:54 -07:00
Michail Kargakis f85067b27d api: custom conversions for rc/rs 2016-07-15 14:52:27 +02:00
Tim Hockin 355794c303 Log errors or fail if conversion fail to generate
This fixes PodSpec to generate cleanly.  No other types only half-generate (so
now we Fatalf), though several fail to generate at all (only Errorf for now).
2016-07-07 22:09:08 -07:00
Jordan Liggitt 993ab1d886 Allow specifying secret data using strings 2016-06-30 16:03:47 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Wojciech Tyczynski d002cb1d63 Fix apiservers crashes 2016-05-31 17:26:35 +02:00
Clayton Coleman 0854fd651c
Update direct conversions to inline fields 2016-05-28 08:52:08 -04:00
Filip Grzadkowski c4e239b314 Merge pull request #25918 from smarterclayton/init_annotation_mutation
Conversions were mutating the internal object
2016-05-20 10:25:36 +02:00
Clayton Coleman 997d55d796
Conversions were mutating the internal object
Internal objects can be shared, it is not allowed to mutate an internal
object in conversion.
2016-05-19 18:01:35 -04:00
Clayton Coleman 5e4308f91d
Update use of Quantity in other classes 2016-05-19 08:41:43 -04:00