Commit Graph

584 Commits

Author SHA1 Message Date
Joe Betz
4c99949ae6 Add GetOptions and ListOptions to storage interface 2020-06-03 10:21:38 -07:00
Michael Gugino
dd49915c55 Eviction: ignore PDBs if pods with DeletionTimestamp
When using the eviction API, if a pod already has
a non-zero DeletionTimestamp, we don't need to check
PDBs as it has already been marked for deletion.
2020-06-02 01:06:45 -04:00
Dan Winship
f6dcc1c07e Minor tweak to IPv6 service IP allocation
The service allocator skips the "broadcast address" in the service
CIDR, but that concept only applies to IPv4 addressing.
2020-06-01 08:16:18 -04:00
Dan Winship
4a7c86c105 make test a bit more generic 2020-06-01 08:13:27 -04:00
Dan Winship
ddebbfd806 update for APIs being moved to utilnet
Several of the functions in pkg/registry/core/service/ipallocator were
moved to k8s.io/utils/net, but then the original code was never
updated to used to the vendored versions.

(utilnet's version of RangeSize does not have the IPv6 special case
that the original code did, so we need to move that to
NewAllocatorCIDRRange now.)
2020-05-30 17:40:02 -04:00
Kubernetes Prow Robot
825eb77c88
Merge pull request #83906 from mgugino-upstream-stage/pdb-exclude-pending
Allow deletion of pending pods when using PDBS
2020-05-29 11:55:34 -07:00
Michael Gugino
047b0cee71 Quit retrying early with user supplied resourceVersion
This commit also updates tests and comments.
2020-05-28 16:14:45 -04:00
Clayton Coleman
c6b833ac3c service: fix IPFamily validation and defaulting problems
If the dual-stack flag is enabled and the cluster is single stack IPv6,
the allocator logic for service clusterIP does not properly handle rejecting
a request for an IPv4 family. Return a 422 Invalid on the ipFamily field
when the dual stack flag is on (as it would when it hits beta) and the
cluster is configured for single-stack IPv6.

The family is now defaulted or cleared in BeforeCreate/BeforeUpdate,
and is either inherited from the previous object (if nil or unchanged),
or set to the default strategy's family as necessary. The existing
family defaulting when cluster ip is provided remains in the api
section. We add additonal family defaulting at the time we allocate
the IP to ensure that IPFamily is a consequence of the ClusterIP
and prevent accidental reversion. This defaulting also ensures that
old clients that submit a nil IPFamily for non ClusterIP services
receive a default.

To properly handle validation, make the strategy and the validation code
path condition on which configuration options are passed to service
storage. Move validation and preparation logic inside the strategy where
it belongs. Service validation is now dependent on the configuration of
the server, and as such ValidateConditionService needs to know what the
allowed families are.
2020-05-23 11:08:19 -04:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
David Eads
4522141f0a reduce complexity in pdb refactor 2020-05-14 15:25:59 -04:00
Michael Gugino
9f80e7a6f8 Allow deletion of pending pods when using PDBS
Currently, if you have a PDB set, it is possible for
a pod stuck in pending state to be prevented from
deletion even though there are in fact enough healthy
replicas.

This commit allows pods in Pending state to be removed.

This commit also adds associated unit tests.

related-bug: #80389
2020-05-12 12:44:05 -04:00
Jordan Liggitt
23e9fb1bb5 Fix podIP validation 2020-04-30 19:49:45 -04:00
Kubernetes Prow Robot
43cd2ff239
Merge pull request #89549 from happinesstaker/sa-rotate
Monitoring safe rollout of time-bound service account token.
2020-04-22 17:01:58 -07:00
Jiajie Yang
ae0e52d28c Monitoring safe rollout of time-bound service account token. 2020-04-22 11:59:16 -07:00
Jie Shen
363bb39142
Use utils.net to parse ports instead of atoi (#89120) 2020-04-21 20:55:52 -07:00
Jordan Liggitt
dab2a830da Fix conflicts patching scale subresources 2020-04-21 16:36:24 -04:00
Antonio Ojea
e3df13439a fix service allocation concurrency issues
The service allocator is used to allocate ip addresses for the
Service IP allocator and NodePorts for the Service NodePort
allocator. It uses a bitmap backed by etcd to store the allocation
and tries to allocate the resources directly from the local memory
instead from etcd, that can cause issues in environment with
high concurrency.

It may happen, in deployments with multiple apiservers, that the
resource allocation information is out of sync, this is more
sensible with NodePorts, per example:

1. apiserver A create a service with NodePort X
2. apiserver B deletes the service
3. apiserver A creates the service again

If the allocation data of apiserver A wasn't refreshed with the
deletion of apiserver B, apiserver A fails the allocation because
the data is out of sync. The Repair loops solve the problem later,
but there are some use cases that require to improve the concurrency
in the allocation logic.

We can try to not do the Allocation and Release operations locally,
and try instead to check if the local data is up to date with etcd,
and operate over the most recent version of the data.
2020-04-20 09:50:00 +02:00
Antonio Ojea
cb87793d57 Add unit test to portallocator storage
Add unit test for the portallocator storage based on
the ipallocator ones.

pkg/registry/core/service/ipallocator/storage/storage_test.go
2020-04-20 09:49:59 +02:00
Kubernetes Prow Robot
ee6b88ddf9
Merge pull request #90000 from SataQiu/staging-scheduler-20200409
scheduler: remove direct import to pkg/master/ports
2020-04-11 10:46:01 -07:00
SataQiu
41d3e44a2f scheduler: remove direct import to pkg/master/ports
Signed-off-by: SataQiu <1527062125@qq.com>
2020-04-11 13:56:53 +08:00
SataQiu
e71f84b1c4 dual-stack: fix the bug that isValidAddress only checks the first IP even a Pod has more than one address
Signed-off-by: SataQiu <1527062125@qq.com>
2020-04-09 16:17:34 +08:00
Kubernetes Prow Robot
b215be875c
Merge pull request #89530 from tklauser/use-bits-onescount
Use OnesCount8 from math/bits to implement countBits
2020-04-02 21:40:13 -07:00
SataQiu
b66fd46cd5 fix the bug that Service clusterIP does not respect specified ipFamily
Signed-off-by: SataQiu <1527062125@qq.com>
2020-03-29 17:19:52 +08:00
Tobias Klauser
811f9d8abf Use OnesCount8 from math/bits to implement countBits
This allows to drop the bitCounts table. Also, bits.OnesCount8 can be
intrinsified to a single instruction on several GOARCHes.
2020-03-26 16:58:48 +01:00
Shihang Zhang
b56da85a77 sync api/v1/pod/util with api/pod/util and remove DefaultContainers 2020-03-24 16:42:32 -07:00
Odin Ugedal
19f0519b2d
Relax huge page node validation
A relaxed version was added in 1.18, and this will disable the
validation all together.
2020-03-19 14:09:13 +01:00
Kubernetes Prow Robot
34f03ae9d4
Merge pull request #89001 from SataQiu/cleanup-20200310
Use utilnet.GetIndexedIP instead of replicating the function locally
2020-03-18 22:23:25 -07:00
Jordan Liggitt
96fadf9ed2 Define default table converters for missing resources 2020-03-10 15:22:37 -04:00
SataQiu
776fa5e76f use utilnet.GetIndexedIP instead of replicating the function locally 2020-03-10 18:03:53 +08: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
Kubernetes Prow Robot
86141c0cce
Merge pull request #88503 from robscott/app-protocol
Adding AppProtocol to Service and Endpoints Ports
2020-02-26 00:20:40 -08:00
Rob Scott
6a33727632
Adding AppProtocol to Service and Endpoints Ports 2020-02-25 17:42:34 -08:00
Kubernetes Prow Robot
851efa8a34
Merge pull request #84051 from bart0sh/PR0079-multiple-sizes-hugepages
Implement support for multiple sizes huge pages
2020-02-25 14:40:27 -08:00
taesun_lee
d578c02975 Fix pkg/registry typos in some error message, variable names etc
error message : differerence -> difference
comment : Ingresss -> Ingress
comment : ObjeceMeta -> ObjectMeta
test case name meta : selectpor -> selector
variable name : secondaryRegistery -> secondaryRegistry
variable name : autosclaerOut -> autoscalerOut
2020-02-25 15:45:20 +09: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
Kubernetes Prow Robot
bd1042080f
Merge pull request #81678 from verb/debug-list
Add ephemeral containers to streamLocation name suggestions
2020-02-12 21:36:35 -08:00
Kubernetes Prow Robot
f7eafa1a83
Merge pull request #86896 from yutedz/copy-into-err
Return the error from copyInto
2020-02-12 13:54:51 -08: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
Kubernetes Prow Robot
17a6248f76
Merge pull request #87939 from shaloulcy/pod_storage_indexer
add indexer for pod storage
2020-02-11 23:15:22 -08:00
shaloulcy
fe312ed74a add index for pod cacher
Signed-off-by: shaloulcy <lcy041536@gmail.com>
2020-02-11 09:25:27 +08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Alexander Zimmermann
22bd92a390
Changed comments to match with interfaces method description 2020-02-06 11:48:57 +01:00
Alexander Zimmermann
026ba54961
Fixed Golint errors in pkg/registry/core/pod 2020-02-06 11:40:37 +01:00
Odin Ugedal
6e411b6c0a
Add support for pre-allocated hugepages with 2 sizes
Remove the validation for pre-allocated hugepages on node level.
Validation is currently the only thing making it impossible to use
pre-allocated huge pages in more than one size.

We have now quite a few reports from real users that this feature is
welcome.
2020-01-23 17:38:22 +01:00
Ted Yu
5b49d03b84 Return the error from copyInto 2020-01-23 07:48:39 -08:00
wojtekt
9174905ae7 Autogenerated 2020-01-12 21:09:05 +01:00
wojtekt
e612ebfdff Immutable field and validation 2020-01-12 20:51:31 +01:00
yuzhiquan
8d7f383785 cleanup(api-machinery): remove unused struct and variable 2020-01-08 16:57:02 +08:00
Kubernetes Prow Robot
a443014dfc
Merge pull request #86621 from yuzhiquan/patch-pod
refactor (pod log) container valiate
2019-12-30 02:41:39 -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
danielqsj
5bc0e26c19 unify alias of api errors under pkg and staging 2019-12-26 16:42:28 +08:00
Jordan Liggitt
6a1354252d Add unit test for extended ipv4 service IP range 2019-12-22 22:32:42 -05:00
Jordan Liggitt
df4f5c1a30 Revert "remove ipallocator in favor of k/utils net package"
This reverts commit f984b4c7a2.
2019-12-22 22:31:25 -05:00
Jordan Liggitt
bb90f0ff94 Install APIs directly for tests 2019-12-13 11:56:29 -05:00
Kubernetes Prow Robot
b8ce44f006
Merge pull request #85863 from nan-yu/pdb_status_renaming
Rename PodDisruptionsAllowed to DisruptionsAllowed in type PodDisruptionBudgetStatus
2019-12-05 15:54:49 -08:00
Kubernetes Prow Robot
ac5dc1fc68
Merge pull request #85844 from shaloulcy/add_configmap_predicate_func
add PredicateFunc for configmap
2019-12-03 19:45:12 -08:00
Kubernetes Prow Robot
bb9981e19f
Merge pull request #85046 from hvaara/fix-golint-pkg-registry--storage
Fix golint issues in pkg/registry/.../storage
2019-12-03 15:47:11 -08:00
Nan Yu
1fb0dd4ec5 Rename PodDisruptionsAllowed to DisruptionsAllowed in type PodDisruptionBudgetStatus 2019-12-03 14:26:35 -08:00
shaloulcy
efa34ba484 add PredicateFunc for configmap
Signed-off-by: shaloulcy <lcy041536@gmail.com>
2019-12-03 20:18:27 +08:00
Kubernetes Prow Robot
050c9471c8
Merge pull request #85644 from liggitt/meta-v1-table
Switch TableGenerator/TableConvertor interfaces to metav1
2019-11-28 10:05:18 -08:00
Kubernetes Prow Robot
d356fcfce5
Merge pull request #84921 from clarklee92/FixCollidesWithImportedPackageName
Variables collide with imported package name
2019-11-28 01:49:03 -08:00
Jordan Liggitt
03910e99da Attach resourcequota printer 2019-11-26 13:20:52 -05:00
Jordan Liggitt
36eb250cbb Switch TableGenerator/TableConvertor interfaces to metav1 2019-11-26 13:18:18 -05:00
Roc Chan
c9cf3f5b72 Service Topology implementation
* Implement Service Topology for ipvs and iptables proxier
* Add test files
* API validation
2019-11-15 13:36:43 +08:00
Jordan Liggitt
114e71b9de Avoid constructing table printer on every componentstatus request 2019-11-14 16:30:12 -05:00
Kubernetes Prow Robot
547fdcc164
Merge pull request #85174 from zhouya0/add_table_convertor_componentstatus
add table convertor to componentstatus
2019-11-14 11:20:01 -08:00
zhouya0
7302a98560 add table convertor to componentstatus 2019-11-14 17:31:37 +08:00
draveness
5cb92260a6 feat: graduate ResourceQuotaScopeSelectors to GA 2019-11-13 14:07:22 +08:00
Kubernetes Prow Robot
bcb171b375
Merge pull request #85059 from chiehting/registry/golint
Fix golint issues in pkg/registry/core/service/storage
2019-11-12 06:04:05 -08:00
Kubernetes Prow Robot
ebbe4baf13
Merge pull request #83914 from guineveresaenger/ato-demo
Removes pkg/registry/core/secret/storage from golint failures
2019-11-10 16:29:41 -08:00
chiehting
193f38beae Fix golint issues in pkg/registry/core/service/storage 2019-11-10 15:34:51 +08:00
Roy Hvaara
cfc34712c2
Fix golint issues in pkg/registry/.../storage 2019-11-10 00:22:51 +01:00
clarklee92
0649f4064e Variables collides with imported package name
Such declarations will make using the package exported identifiers impossible after the declaration or create confusion when reading the code.
Signed-off-by: clarklee92 <clarklee1992@hotmail.com>
2019-11-07 21:44:22 +08:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
Kubernetes Prow Robot
748a866d56
Merge pull request #84122 from smarterclayton/delete_success
storage: Deleting a namespace while spec.finalizers pending should not error
2019-10-23 12:51:10 -07:00
Kubernetes Prow Robot
9fa1bc8003
Merge pull request #83422 from yastij/remove-ipallocator
remove ipallocator in favor of k/utils net package
2019-10-22 12:52:13 -07:00
Yassine TIJANI
f984b4c7a2 remove ipallocator in favor of k/utils net package
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-10-22 18:37:13 +02:00
Clayton Coleman
2ddeb94b56
storage: Deleting a namespace while spec.finalizers pending should not error
All objects with graceful deletion allow multiple DELETE calls in the pending
state. Namespace is the one outlier, and the error here predates graceful
deletion and finalizers. We should make this behavior consistent with other
calls and merely indicate success and return the state of the object, the
same as if there were pending metadata finalizers.

Clients that previously checked for a conflict error during delete to know
that the server is already deleting will now no longer receive an error
(as if the object were rapidly deleted). There is a small chance that some
clients have error checking for this state, but a much larger chance that
clients that want to trigger a delete of the namespace do not handle this
error case.

Discovered in an e2e test that used the framework namespace and triggered
deletion of that ns itself, and then the AfterEach step in e2e failed
because the namespace was already pending deletion.
2019-10-19 23:08:17 -04:00
Kubernetes Prow Robot
cb19b56831
Merge pull request #83419 from deads2k/insecure-backend-proxy
Insecure backend proxy
2019-10-16 13:58:38 -07:00
David Eads
867ee1d5ff add insecurebackendproxy 2019-10-16 11:43:17 -04:00
guineveresaenger
82123dc261 Removes pkg/registry/core/secret/storage from golint failures 2019-10-14 14:28:32 -04:00
Ted Yu
0779296bf3 Check error return from snapshot Restore 2019-10-13 10:08:20 -07:00
tanjunchen
de3cf23414 remove the repeat word in documents 2019-10-06 23:32:01 +08:00
Jan Janik
80cb726110 Match label and fields selectors in ComponentStatus List API 2019-09-07 21:56:58 +12:00
Khaled Henidak(Kal)
c27e0b029d phase 2: generated items 2019-08-28 16:11:46 +00:00
Khaled Henidak(Kal)
93c06821e6 Phase 2: service and endpoint processing 2019-08-28 15:59:43 +00:00
Khaled Henidak(Kal)
5e8ccda71c phase 2: api types + defaulting + validation + disabled fields handling 2019-08-28 15:59:43 +00:00
Tim Hockin
ec60426793 Add dropDisbledFields() to service 2019-08-22 21:36:39 -07:00
Di Xu
d4d696d0f2 add legacyBinding for non-Named Binding Creater 2019-08-22 11:46:12 +08:00
Di Xu
b28f62c8ad check pod name with that in pod eviction object 2019-08-22 11:46:12 +08:00
Di Xu
5ed1b8fa29 check pod name with that in binding object 2019-08-22 11:46:12 +08:00
Jordan Liggitt
61774cd717 Plumb context to admission Admit/Validate 2019-08-20 11:11:00 -04:00
Kubernetes Prow Robot
b581f97009
Merge pull request #81325 from tedyu/etcd-ret-err
Propagate error from NewEtcd
2019-08-16 10:26:09 -07:00
Ted Yu
2374f9ad7c Propagate error from NewEtcd 2019-08-14 16:46:23 -07:00
Kubernetes Prow Robot
890b50f98b
Merge pull request #80952 from tedyu/storage-ret-err
Propagate error from NewREST
2019-08-12 18:21:52 -07:00
Ted Yu
87b2a3129b Propagate error from NewREST 2019-08-12 13:55:35 -07:00
Mark Janssen
231d2a9617 Fix golint failures of pkg/registry/core/event 2019-08-06 21:13:55 +02:00
wojtekt
467f5e96ee Fix some golint failures 2019-07-25 20:38:28 +02:00