Commit Graph

86 Commits

Author SHA1 Message Date
Vinay Kulkarni
76962b0fa7 In-place Pod Vertical Scaling - API changes
1. Define ContainerResizePolicy and add it to Container struct.
 2. Add ResourcesAllocated and Resources fields to ContainerStatus struct.
 3. Define ResourcesResizeStatus and add it to PodStatus struct.
 4. Add InPlacePodVerticalScaling feature gate and drop disabled fields.
 5. ResizePolicy validation & defaulting and Resources mutability for CPU/Memory.
 6. Various fixes from code review feedback (originally committed on Apr 12, 2022)
KEP: /enhancements/keps/sig-node/1287-in-place-update-pod-resources
2023-02-24 17:18:04 +00:00
Kubernetes Prow Robot
6ce055d62d
Merge pull request #114947 from saschagrunert/seccomp-ga-cleanup
Make seccomp annotations non-functional
2023-01-12 13:48:54 -08:00
Sascha Grunert
af1f6a230b
Make seccomp annotations non-functional
This cleanup has been planned to finish the corresponding KEP:
https://github.com/kubernetes/kubernetes/issues/91286

As follow-up on the partly removal of the seccomp annotations in
https://github.com/kubernetes/kubernetes/pull/109819, we now drop
the version skew handling completely, but still warn as well as keep
the validation in place if both (annotation and field) are set.

The Pod Security Admission code has been already changed in
https://github.com/kubernetes/kubernetes/pull/114846.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-01-12 17:11:52 +01:00
Tim Hockin
7c7d79b058
Make the warning about pod name clearer
Previously this was cut-paste from deployment.  It didn't make much
sense for pod.
2022-12-25 14:20:55 -08:00
Tim Hockin
c555d290c1
pod: API warn when name is not DNS label 2022-12-16 13:05:17 -08:00
Wei Huang
7b6293b6b6
APIs, Validation and condition enforcements
- New API field .spec.schedulingGates
- Validation and drop disabled fields
- Disallow binding a Pod carrying non-nil schedulingGates
- Disallow creating a Pod with non-nil nodeName and non-nil schedulingGates
- Adds a {type:PodScheduled, reason:WaitingForGates} condition if necessary
- New literal SchedulingGated in the STATUS column of `k get pod`
2022-11-03 14:32:34 -07:00
Sascha Grunert
584783ee9f
Partly remove support for seccomp annotations
We now partly drop the support for seccomp annotations which is planned
for v1.25 as part of the KEP:

https://github.com/kubernetes/enhancements/issues/135

Pod security policies are not touched by this change and therefore we
have to keep the annotation key constants.

This means we only allow the usage of the annotations for backwards
compatibility reasons while the synchronization of the field to
annotation is no longer supported. Using the annotations for static pods
is also not supported any more.

Making the annotations fully non-functional will be deferred to a
future release.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-08-01 09:19:29 +02:00
Antonio Ojea
410aaaa202 cleanup: remove check for GA feature gate 2022-05-26 13:26:49 +02:00
Shiming Zhang
45ce2dfacc Treat negative as 1s in delete path 2021-06-28 11:49:39 +08:00
Jordan Liggitt
f669796dfd Send pod spec warnings when creating or changing workload objects 2021-05-18 10:42:36 -04:00
Jordan Liggitt
8c8a4cf3e4 Add WarningsOnCreate,WarningsOnUpdate 2021-05-18 10:42:36 -04:00
Lee Verberne
97726a50c1 Address feedback for new /ephemeralcontainers API
* Use deep copies in `PrepareForUpdate()`
* Preserve select metadata from new pod
* Use patch to add ephemeral container `kubectl debug`
* Distinguish between pod vs /ephemeralcontainers NotFound
2021-04-16 14:08:12 +02:00
Lee Verberne
d22dc5cb72 Switch ephemeralcontainers SR to Pod Kind
This changes the `/ephemeralcontainers` subresource of `/pods` to use
the `Pod` kind rather than `EphemeralContainers`.

When designing this API initially it seemed preferable to create a new
kind containing only the pod's ephemeral containers, similar to how
binding and scaling work.

It later became clear that this made admission control more difficult
because the controller wouldn't be presented with the entire Pod, so we
updated this to operate on the entire Pod, similar to how `/status`
works.
2021-04-13 13:36:48 +02:00
Kevin Delgado
a1fac8cbd9 Server-Side Apply: Status Wiping/Reset Fields
Adds and implements ResetFieldsProvder interface in order to ensure that
the fieldmanager no longer owns fields that get reset before the object
is persisted.

Co-authored-by: Kevin Wiesmueller <kwiesmul@redhat.com>
Co-authored-by: Kevin Delgado <kevindelgado@google.com>
2021-03-10 01:02:18 +00:00
David Eads
cd08de9eb0 stop using AllowInsecureBackendProxy featuregate since it is always true 2021-03-03 10:52:14 -05:00
Abdullah Gharaibeh
d7e80ab038 Implement pod deletion cost 2021-03-01 13:45:58 -05:00
pacoxu
a10bdfed09 fix all keps links 404 for kep folder migration
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-02-01 19:41:59 +08:00
Derek Carr
45bd6cb186 Downward API hugepages 2020-11-10 16:09:13 -05:00
Dan Winship
3a110546ed Move SCTP to GA 2020-10-15 08:56:33 -04:00
Jordan Liggitt
71fcc2298d Fix resource location for ipv6 pods 2020-09-16 11:24:07 -04:00
Sascha Grunert
96fb83c4c1
Implement PodSecurityPolicy enforcement for seccomp GA
This implements the necessary pieced for the PodSecurityPolicy
enforcement like described in the appropriate KEP section:

https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/20190717-seccomp-ga.md#podsecuritypolicy-enforcement

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-07-10 15:55:21 +02:00
Sascha Grunert
c3ba2d8b8b
Add seccomp GA version skew for pods
This adds a new conversion function to the pod strategy to handle the
seccomp version skew strategy:

https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/20190717-seccomp-ga.mdversion-skew-strategy

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-07-06 16:06:24 +02:00
Paulo Gomes
8976e3620f
Add seccomp enforcement and validation based on new GA fields
Adds seccomp validation.

This ensures that field and annotation values must match when present.

Co-authored-by: Sascha Grunert <sgrunert@suse.com>
2020-07-06 09:13:25 +01:00
Jordan Liggitt
23e9fb1bb5 Fix podIP validation 2020-04-30 19:49:45 -04:00
Shihang Zhang
b56da85a77 sync api/v1/pod/util with api/pod/util and remove DefaultContainers 2020-03-24 16:42:32 -07:00
Ted Yu
af0e1319c3 Allow container visitor to operate on selected container types
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-03-05 11:48:00 -08:00
Ed Bartosh
0eb65bd7da Implement support for multiple sizes huge pages
This implementation allows Pod to request multiple hugepage resources
of different size and mount hugepage volumes using storage medium
HugePage-<size>, e.g.

spec:
  containers:
    resources:
      requests:
        hugepages-2Mi: 2Mi
        hugepages-1Gi: 2Gi
    volumeMounts:
      - mountPath: /hugepages-2Mi
        name: hugepage-2mi
      - mountPath: /hugepages-1Gi
        name: hugepage-1gi
    ...
  volumes:
    - name: hugepage-2mi
      emptyDir:
        medium: HugePages-2Mi
    - name: hugepage-1gi
      emptyDir:
        medium: HugePages-1Gi

NOTE: This is an alpha feature.
      Feature gate HugePageStorageMediumSize must be enabled for it to work.
2020-02-19 18:15:40 +02:00
Lee Verberne
cc32702e8f Add ephemeral containers to streamLocation name suggestions
This combines container names into a single list because separating them
into a long, variable length string isn't particularly useful in the
context of an streaming error message.
2020-02-12 14:49:42 +01:00
shaloulcy
fe312ed74a add index for pod cacher
Signed-off-by: shaloulcy <lcy041536@gmail.com>
2020-02-11 09:25:27 +08:00
Alexander Zimmermann
026ba54961
Fixed Golint errors in pkg/registry/core/pod 2020-02-06 11:40:37 +01:00
yuzhiquan
8d7f383785 cleanup(api-machinery): remove unused struct and variable 2020-01-08 16:57:02 +08:00
yuzhiquan
ca69051475 refactor(pod log):refactor for container valiate, little cleanup
bug(pod log):TestCheckLogLocation should point out pod name

modify container if statement

fix typo
2019-12-30 16:16:45 +08:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
David Eads
867ee1d5ff add insecurebackendproxy 2019-10-16 11:43:17 -04:00
wojtekt
467f5e96ee Fix some golint failures 2019-07-25 20:38:28 +02:00
Lee Verberne
013f049ce0 Add Ephemeral Containers to the Kubernetes core API 2019-07-22 11:19:22 +00:00
Kubernetes Prow Robot
cb9c6f43a5
Merge pull request #80260 from khenidak/fix-panic-in-pod-strategy
fix panic in ResourceLocation in case of empty pod ip list
2019-07-17 21:28:23 -07:00
Khaled Henidak(Kal)
41f313570e fix panic in ResourceLocation in case of empty pod ip list 2019-07-17 18:30:08 +00:00
wojtekt
68fd329e00 Simplify trigger functions in cacher 2019-07-16 08:55:34 +02:00
Ted Yu
4ca5b45f3d Remove the TODO for container name matching 2019-07-08 09:23:35 -07:00
Khaled Henidak(Kal)
54d42e6a65 types modifications + conversion + conversion testing 2019-07-02 15:39:05 +00:00
Lee Verberne
ee821e2a04 Create helpers for iterating containers in a pod 2019-06-21 08:32:04 +00:00
Jordan Liggitt
4271384966 Call conditional validation from create/update strategies 2019-02-05 23:09:31 -05:00
Jordan Liggitt
17aa60686e Deprecate and remove use of alpha metadata.initializers field, remove IncludeUninitialized options 2019-01-23 16:34:43 -05:00
Jordan Liggitt
12dd768bee Pass pod annotations into DropDisabledFields() 2019-01-07 14:44:20 -05:00
Jordan Liggitt
e486d486b1 Plumb old pod spec into DropDisabledFields methods 2018-12-17 12:49:29 -05:00
Jordan Liggitt
49028df5f9 Rename DropDisabledFields 2018-12-17 12:08:25 -05:00
Micah Hausler
9740b6a6e1 Disable proxy to loopback and linklocal 2018-12-11 20:51:40 -08:00
zuoxiu.jm
3370907fe5 pass handler ctx to node rest nodegetter 2018-10-01 09:27:18 -04:00
Jason Smith
4ba7fd5f3c added serviceAccountName to field selectors 2018-07-12 11:13:36 +02:00