Commit Graph

271 Commits

Author SHA1 Message Date
Patrick Ohly
bde9b64cdf DRA: remove "source" indirection from v1 Pod API
This makes the API nicer:

    resourceClaims:
    - name: with-template
      resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      resourceClaimName: test-shared-claim

Previously, this was:

    resourceClaims:
    - name: with-template
      source:
        resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      source:
        resourceClaimName: test-shared-claim

A more long-term benefit is that other, future alternatives
might not make sense under the "source" umbrella.

This is a breaking change. It's justified because DRA is still
alpha and will have several other API breaks in 1.31.
2024-06-27 17:53:24 +02:00
Shingo Omura
552fd7e850
KEP-3619: Fine-grained SupplementalGroups control (#117842)
* Add `Linux{Sandbox,Container}SecurityContext.SupplementalGroupsPolicy` and `ContainerStatus.user` in cri-api

* Add `PodSecurityContext.SupplementalGroupsPolicy`, `ContainerStatus.User` and its featuregate

* Implement DropDisabledPodFields for PodSecurityContext.SupplementalGroupsPolicy and ContainerStatus.User fields

* Implement kubelet so to wire between SecurityContext.SupplementalGroupsPolicy/ContainerStatus.User and cri-api in kubelet

* Clarify `SupplementalGroupsPolicy` is an OS depdendent field.

* Make `ContainerStatus.User` is initially attached user identity to the first process in the ContainerStatus

It is because, the process identity can be dynamic if the initially attached identity
has enough privilege calling setuid/setgid/setgroups syscalls in Linux.

* Rewording suggestion applied

* Add TODO comment for updating SupplementalGroupsPolicy default value in v1.34

* Added validations for SupplementalGroupsPolicy and ContainerUser

* No need featuregate check in validation when adding new field with no default value

* fix typo: identitiy -> identity
2024-05-29 15:40:29 -07:00
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
Akihiro Suda
ce1918875f
pod: dropDisabledFields: recognize RecursiveReadOnlyMounts
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-03-09 09:48:12 +09:00
Kubernetes Prow Robot
cc6d9b3037
Merge pull request #123789 from tallclair/apparmor-warnings
Warn on deprecated AppArmor annotation use
2024-03-07 11:53:54 -08:00
Tim Allclair
7bd78b06e9 Warn on deprecated AppArmor annotation use 2024-03-07 09:51:48 -08:00
HirazawaUi
2867be47b3 followup to allow special characters 2024-03-08 00:08:43 +08:00
Kubernetes Prow Robot
bd25605619
Merge pull request #123435 from tallclair/apparmor-ga
AppArmor fields API
2024-03-06 15:35:14 -08:00
Tim Allclair
2d86cbf261 Separate feature-gate for AppArmor fields 2024-03-06 10:46:32 -08:00
Tim Allclair
0eb5f52d06 Rename AppArmor annotation constants with Deprecated 2024-03-06 10:46:31 -08:00
Kubernetes Prow Robot
87f9b3891e
Merge pull request #123385 from HirazawaUi/allow-special-characters
Allow almost all printable ASCII characters in environment variables
2024-03-05 17:31:06 -08:00
Tim Allclair
94927afb50 AppArmor API changes 2024-03-05 12:02:43 -08:00
HirazawaUi
e56240b2e1 add validation method at the top level 2024-03-05 17:09:10 +08:00
Kubernetes Prow Robot
6929a11f69
Merge pull request #123481 from sanposhiho/mindomain-stable
graduate MinDomainsInPodTopologySpread to stable
2024-03-04 17:18:53 -08:00
Kubernetes Prow Robot
e4a14fe0f5
Merge pull request #123575 from Huang-Wei/pod-scheduling-readiness-stable
Graduate PodSchedulingReadiness to stable
2024-03-03 22:29:38 -08:00
Wei Huang
01db4ae9e7
Graduate PodSchedulingReadiness to stable 2024-02-28 23:18:44 -08:00
Shiming Zhang
d303cec118 Update test 2024-02-29 11:48:18 +08:00
Kensei Nakada
58a826a59a graduate MinDomainsInPodTopologySpread to stable 2024-02-28 10:42:29 +00:00
AxeZhan
c74ec3df09 graduate PodLifecycleSleepAction to beta 2024-02-19 19:40:52 +08:00
Kubernetes Prow Robot
fc4d6ac8ea
Merge pull request #121731 from Taction/service-account-token-projected-volume-validation
Fix service account token projected volume validation
2024-01-24 19:51:43 +01:00
zhangchao
7972f0309c Fix service account token projected volume validation
Signed-off-by: zhangchao <zchao9100@gmail.com>
2024-01-23 23:03:37 +08:00
Kubernetes Prow Robot
745a364422
Merge pull request #120866 from bzsuni/cleanup/sets/api
use generic Set in api
2024-01-22 18:20:48 +01:00
Jordan Liggitt
b6e34187ca
Update duplicate env var warning 2023-12-18 10:06:30 -05:00
Taahir Ahmed
1ebe5774d0 kubelet: Support ClusterTrustBundlePEM projections 2023-11-03 11:40:48 -07:00
Taahir Ahmed
ecfdc8fda5 Define ClusterTrustBundlePEM projected volume
This commit defines the ClusterTrustBundlePEM projected volume types.
These types have been renamed from the KEP (PEMTrustAnchors) in order to
leave open the possibility of a similar projection drawing from a
yet-to-exist namespaced-scoped TrustBundle object, which came up during
KEP discussion.

* Add the projection field to internal and v1 APIs.
* Add validation to ensure that usages of the project must specify a
  name and path.
* Add TODO covering admission control to forbid mirror pods from using
  the projection.

Part of KEP-3257.
2023-11-03 11:40:48 -07:00
Paco Xu
36d6917ae1 valid error for creation and update from valid to invalid only
- using an option AllowNamespacedSysctlsForHostNetAndHostIPC

Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2023-10-28 06:58:54 +08:00
Kensei Nakada
d5d3c26337 feature(scheduler): implement matchLabelKeys in PodAffinity and PodAntiAffinity 2023-10-18 11:28:02 +00:00
AxeZhan
3a96afdfef implementation 2023-10-15 13:57:48 +08:00
bzsuni
aa9b2b1696 use generic Set in api
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2023-09-25 19:04:08 +08:00
Christoph Mewes
6e3ebdc68e fix typo Conext => Context 2023-09-17 11:18:43 +02:00
Patrick Ohly
2472291790 api: introduce separate VolumeResourceRequirements struct
PVC and containers shared the same ResourceRequirements struct to define their
API. When resource claims were added, that struct got extended, which
accidentally also changed the PVC API. To avoid such a mistake from happening
again, PVC now uses its own VolumeResourceRequirements struct.

The `Claims` field gets removed because risk of breaking someone is low:
theoretically, YAML files which have a claims field for volumes now
get rejected when validating against the OpenAPI. Such files
have never made sense and should be fixed.

Code that uses the struct definitions needs to be updated.
2023-08-21 15:31:28 +02:00
Gunju Kim
6aeff13def
Never drop the terminationGracePeriodSeconds of a probe 2023-07-18 01:34:02 +09:00
Kubernetes Prow Robot
b908e2710a
Merge pull request #113245 from pacoxu/dup-ports-warning
add warning for dup ports in containers[*].ports and service.ports
2023-07-15 00:31:15 -07:00
Paco Xu
df0d51d3b3 add some detailed message for dup container ports(steal from thockin) 2023-07-15 08:02:33 +08:00
Shiming Zhang
14b09c414a Add DownwardAPI validation for status.hostIPs 2023-07-14 09:35:31 +08:00
Shiming Zhang
dacb689002 Add dropDisabledStatusFields 2023-07-14 09:35:30 +08:00
Kubernetes Prow Robot
a9e40bd7c6
Merge pull request #114307 from rphillips/promote_probe_termination_grace_period
ProbeTerminationGracePeriod promote to GA
2023-07-13 13:41:38 -07:00
Patrick Ohly
444d23bd2f dra: generated name for ResourceClaim from template
Generating the name avoids all potential name collisions. It's not clear how
much of a problem that was because users can avoid them and the deterministic
names for generic ephemeral volumes have not led to reports from users. But
using generated names is not too hard either.

What makes it relatively easy is that the new pod.status.resourceClaimStatus
map stores the generated name for kubelet and node authorizer, i.e. the
information in the pod is sufficient to determine the name of the
ResourceClaim.

The resource claim controller becomes a bit more complex and now needs
permission to modify the pod status. The new failure scenario of "ResourceClaim
created, updating pod status fails" is handled with the help of a new special
"resource.kubernetes.io/pod-claim-name" annotation that together with the owner
reference identifies exactly for what a ResourceClaim was generated, so
updating the pod status can be retried for existing ResourceClaims.

The transition from deterministic names is handled with a special case for that
recovery code path: a ResourceClaim with no annotation and a name that follows
the Kubernetes <= 1.27 naming pattern is assumed to be generated for that pod
claim and gets added to the pod status.

There's no immediate need for it, but just in case that it may become relevant,
the name of the generated ResourceClaim may also be left unset to record that
no claim was needed. Components processing such a pod can skip whatever they
normally would do for the claim. To ensure that they do and also cover other
cases properly ("no known field is set", "must check ownership"),
resourceclaim.Name gets extended.
2023-07-11 14:23:48 +02:00
Gunju Kim
5d26bcd468 Sidecar: API changes
- Add SidecarContaienrs feature gate
- Add ContainerRestartPolicy type
- Add RestartPolicy field to the Container
- Drop RestartPolicy field if the feature is disabled
- Add validation for the SidecarContainers
- Allow restartable init containaers to have a startup probe
2023-07-07 21:39:34 +00:00
Giuseppe Scrivano
531d38e323
features: rename UserNamespacesStatelessPodsSupport
now it is called UserNamespacesSupport since all kind of volumes are
supported.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-22 15:19:50 +02:00
Humble Chirammal
471fd1ae8a deprecate RBD plugin from available in-tree drivers
Based on https://groups.google.com/g/kubernetes-sig-storage/c/h5751_B5LQM, the
consensus was to start the deprecation in v1.28.

This commit start the deprecation process of RBD plugin from in-tree
drivers.

ACTION REQUIRED:
   RBD volume plugin ( `kubernetes.io/rbd`) has been deprecated in this release
   and will be removed in a subsequent release. Alternative is to use RBD CSI driver
   (https://github.com/ceph/ceph-csi/) in your Kubernetes Cluster.

Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>
2023-06-16 19:45:36 +05:30
Kubernetes Prow Robot
d93e1e95ff
Merge pull request #118548 from thockin/remove-warn-dup-volume-names
Remove unreachable warning on volume name dup
2023-06-08 19:44:12 -07:00
Kubernetes Prow Robot
af99df6a6b
Merge pull request #118547 from thockin/fix-dup-env-var-warn
Fix warnings on "duplicate" env vars
2023-06-07 22:58:12 -07:00
Tim Hockin
151509fb74
Remove unreachable warning on volume name dup
Volume names are validated to be unique and always have been.  The cited
issues are all about apply getting messed up, not the aspiserver
allowing dups.

```
$ k create -f /tmp/bad.yaml
The Deployment "bad-volumes-test" is invalid: spec.template.spec.volumes[1].name: Duplicate value: "config"

$ k apply --server-side -f /tmp/bad.yaml
Error from server: failed to create typed patch object (default/bad-volumes-test; apps/v1, Kind=Deployment): .spec.template.spec.volumes: duplicate entries for key [name="config"]

$ k apply -f /tmp/bad.yaml -o json | jq '.spec.template.spec.volumes'
The Deployment "bad-volumes-test" is invalid: spec.template.spec.volumes[1].name: Duplicate value: "config"
```
2023-06-07 17:14:49 -07:00
Tim Hockin
0ddaa7f7c9
Fix warnings on "duplicate" env vars
Some use-cases are not actually wrong
2023-06-07 15:59:36 -07:00
Paco Xu
7a80d7c839 add warning for duplicate containers[*].ports with the same port, protocol, hostPort, and hostIP 2023-06-06 14:52:48 +08:00
Humble Chirammal
c009667c6c deprecate CephFS plugin from available in-tree drivers.
https://groups.google.com/a/kubernetes.io/g/dev/c/g8rwL-qnQhk
based on above, the consensus was to start the deprecation in v1.28.

This commit start the deprecation process of CephFS plugin from
in-tree drivers.

Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>
2023-06-05 23:26:43 +05:30
Paco Xu
64c9070f8d add pod containers[*].port duplicate warning 2023-05-30 10:57:04 +08:00
Ryan Phillips
ae08fe1e19 ProbeTerminationGracePeriod promote to GA 2023-05-05 14:27:54 -05:00
Gunju Kim
b249b4ca9b
Promote ExpandedDNSConfig feature to the GA stage 2023-05-04 20:37:10 +09:00