-
Notifications
You must be signed in to change notification settings - Fork 39.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promote init containers to GA #38382
Promote init containers to GA #38382
Conversation
70a219d
to
f0ae0cf
Compare
pkg/api/v1/conversion.go
Outdated
return err | ||
} | ||
|
||
if old := out.Annotations; old != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code that uses init containers (which is mostly using versioned clients now) still needs to respect the beta annotation. So this code needs to move into a function that you can use to, if the annotation is set, override the value that is provided with the object. For backwards compatibility with APIs "beta" annotations take precedence over fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it true that this file contains only functions in format
func Convert_v1_Field_To_api_Field(in *Field, out *api.Field, s conversion.Scope) error
where type of Field is defined in types.go?
Mentioned function would need access to Annotations and InitContainers field, that means pointer to Pod. Is there a file where we put this kind of functions? Is it more acceptable not to modify conversions for init containers promotion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwforres pointing out to this question
@hodovska -- can you split the generated code into a separate commit to allow for easier review? |
f0ae0cf
to
bffdb0e
Compare
bffdb0e
to
44e964a
Compare
Does also proposal file have to be updated? (https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/container-init.md) Speaking of statements such as "While pod containers are in alpha state..." |
@@ -1274,22 +1274,24 @@ var map_PodSpec = map[string]string{ | |||
"imagePullSecrets": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod", | |||
"hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", | |||
"subdomain": "If specified, the fully qualified Pod hostname will be \"<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>\". If not specified, the pod will not have a domainname at all.", | |||
"initContainers": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, or Liveness probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/containers", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noticed a typo, two of's "the max of of that"
44e964a
to
1633f9e
Compare
1633f9e
to
e16a220
Compare
The proposals have moved to kubernetes/community repo, so an update will be needed there. A few additional asks for this PR:
|
e16a220
to
38d73b4
Compare
Conversion:
We might use different, where conversion stays as is and possible conflict (annotations vs. spec.initContainers) is resolved in validation. For this I will need more information of how to run v1 validation (before conversion to internal api). |
We generally do not do conflict resolution, we simply treat the annotation
as a complete override.
…On Mon, Jan 2, 2017 at 10:28 AM, k8s-ci-robot ***@***.***> wrote:
Jenkins GCE etcd3 e2e *failed*
<https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/38382/pull-kubernetes-e2e-gce-etcd3/10913/>
for commit 38d73b4
<38d73b4>.
Full PR test history <http://pr-test.k8s.io/38382>.
The magic incantation to run this job again is @k8s-bot gce etcd3 e2e
test this. Please help us cut down flakes by linking to an open flake
issue
<https://github.com/kubernetes/kubernetes/issues?q=is:issue+label:kind/flake+is:open>
when you hit one in your PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#38382 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_pyY0h3K5iDXzUB4nfUuegwQBZ_noks5rOReBgaJpZM4LHxx_>
.
|
38d73b4
to
bc30f47
Compare
pkg/api/types.go
Outdated
@@ -1911,6 +1909,8 @@ type PodSpec struct { | |||
// If not specified, the pod will be dispatched by default scheduler. | |||
// +optional | |||
SchedulerName string | |||
// List of initialization containers belonging to the pod. | |||
InitContainers []Container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this moved to the bottom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smarterclayton new ID of json field has to be assigned. I found this approach least impacting, since ID's have to be sorted - I didn't intend to influence other fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't sort based on id, and ids aren't added by sort. Order of fields is supposed to be human / use first, machine last. Move these back.
pkg/api/v1/types.go
Outdated
// Init containers are in alpha state and may change without notice. | ||
// Cannot be updated. | ||
// More info: http://kubernetes.io/docs/user-guide/containers | ||
InitContainers []Container `json:"-" patchStrategy:"merge" patchMergeKey:"name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave this where it is.
pkg/api/v1/types.go
Outdated
// startTime set. | ||
// Init containers are in alpha state and may change without notice. | ||
// More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses | ||
InitContainerStatuses []ContainerStatus `json:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave this where it is.
A couple of comments and rebase and regenerate, and yes, LGTM /approve |
Please add the release note to the PR description:
|
189e700
to
adf7cf1
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED The following people have approved this PR: hodovska, smarterclayton Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/lgtm |
Automatic merge from submit-queue (batch tested with PRs 40864, 40666, 38382, 40874) |
Automatic merge from submit-queue Put initContainers to PodSpec for some statefulset examples. **What this PR does / why we need it**: Fixed #45405 The `init container` is [graduated to GA](#38382) , so some test YAML templates needs to be updated to not use `annotations`. The following are the two places that needs update: 1. [cockroachdb](https://github.com/kubernetes/kubernetes/blob/master/examples/cockroachdb/cockroachdb-statefulset.yaml) 2. [e2e statefulset test](https://github.com/kubernetes/kubernetes/tree/master/test/e2e/testing-manifests/statefulset) **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**: **Release note**: ```release-note ```
This is proposed for 1.6
PR moves beta proved concept for init containers to stable. Specification of init containers can be now stated under initContainers field in PodSpec/PodTemplateSpec. Specifying init-containers in annotation is still possible, but will be removed in future version.