Commit Graph

18338 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
de9ce03f19 Merge pull request #116542 from enj/enj/f/go1.20
Explicit bump to go 1.20
2023-03-13 13:24:55 -07:00
Justin SB
f17a319dc6 prunev2: Implement basic pruning
Implement the basic prune strategy where we find-by-label and then
delete unknown objects.
2023-03-13 20:06:59 +00:00
Kubernetes Prow Robot
077ca3b736 Merge pull request #116477 from twz123/synctrack-64bit-alignment
Properly align synctrack.SingleFileTracker struct
2023-03-13 12:15:02 -07:00
Tim Allclair
ea974280dc Fix broken API docs URLs 2023-03-13 11:37:59 -07:00
Clayton Coleman
8d4004bbc7 wait: Update tests to reference the constant error
The structure of the error is changing, and we don't guarantee
reflect.DeepEqual(...) will remain true for ErrWaitTimeout currently.
2023-03-13 12:06:06 -06:00
Kubernetes Prow Robot
087868a436 Merge pull request #116476 from smarterclayton/context_wait_2
wait: Split the wait package up into individual files to make refactors easier
2023-03-13 10:39:00 -07:00
Monis Khan
ba471884fb Explicit bump to go 1.20
Signed-off-by: Monis Khan <mok@microsoft.com>
2023-03-13 12:47:36 -04:00
Kubernetes Prow Robot
a0b1bee7c5 Merge pull request #115840 from atosatto/remove-taint-manager-cli
Remove enable-taint-manager and pod-eviction-timeout CLI flags
2023-03-13 08:13:10 -07:00
Kubernetes Prow Robot
4a7ba05691 Merge pull request #116510 from flant/whoami-beta
Promote whoami kubectl command
2023-03-13 05:56:47 -07:00
Alexander Constantinescu
95df201d36 [KCCM]: service controller - Add node.deletionTimestamp predicate 2023-03-13 13:36:55 +01:00
Tim Hockin
0ccab9804a Remove obviously redundant tests 2023-03-13 13:34:48 +01:00
Tim Hockin
f56e62ca14 Add helper funcs to clean up svc controller tests 2023-03-13 13:34:48 +01:00
Damien Grisonnet
d00364902b events: fix EventSeries starting count discrepancy
The kube-apiserver validation expects the Count of an EventSeries to be
at least 2, otherwise it rejects the Event. There was is discrepancy
between the client and the server since the client was iniatizing an
EventSeries to a count of 1.

According to the original KEP, the first event emitted should have an
EventSeries set to nil and the second isomorphic event should have an
EventSeries with a count of 2. Thus, we should matcht the behavior
define by the KEP and update the client.

Also, as an effort to make the old clients compatible with the servers,
we should allow Events with an EventSeries count of 1 to prevent any
unexpected rejections.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-03-13 13:31:07 +01:00
Tom Wieczorek
ffcf653e06 Properly align synctrack.SingleFileTracker struct
count is used with atomic operations so it must be 64-bit aligned,
otherwise atomic operations will panic. Having it at the top of the
struct will guarantee that, even on 32-bit arches.

This fixes panics like that one observed in kube-apiserver:

    E0310 13:48:47.476124     676 runtime.go:77] Observed a panic: unaligned 64-bit atomic operation
    goroutine 141 [running]:
    k8s.io/apimachinery/pkg/util/runtime.logPanic({0x2482378, 0x2db2ff8})
    	vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:75 +0x94
    k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x0})
    	vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:49 +0x78
    panic({0x2482378, 0x2db2ff8})
    	/usr/local/go/src/runtime/panic.go:884 +0x218
    runtime/internal/atomic.panicUnaligned()
    	/usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
    runtime/internal/atomic.Load64(0x685f794)
    	/usr/local/go/src/runtime/internal/atomic/atomic_arm.s:280 +0x14
    k8s.io/client-go/tools/cache/synctrack.(*SingleFileTracker).HasSynced(0x685f790)
    	vendor/k8s.io/client-go/tools/cache/synctrack/synctrack.go:115 +0x3c
    k8s.io/client-go/tools/cache.(*processorListener).HasSynced(0x6013e60)
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:907 +0x20
    k8s.io/client-go/tools/cache.WaitForCacheSync.func1()
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:332 +0x50
    k8s.io/apimachinery/pkg/util/wait.ConditionFunc.WithContext.func1({0x2dcf274, 0x607c600})
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:222 +0x1c
    k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext({0x2dcf274, 0x607c600}, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:262 +0x64
    k8s.io/apimachinery/pkg/util/wait.waitForWithContext({0x2dcf274, 0x607c600}, 0x64a6060, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:649 +0x11c
    k8s.io/apimachinery/pkg/util/wait.poll({0x2dcf274, 0x607c600}, 0x1, 0x64a6060, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:600 +0xc4
    k8s.io/apimachinery/pkg/util/wait.PollImmediateUntilWithContext({0x2dcf274, 0x607c600}, 0x5f5e100, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:551 +0x60
    k8s.io/apimachinery/pkg/util/wait.PollImmediateUntil(0x5f5e100, 0x6298020, 0x607c600)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:542 +0x48
    k8s.io/client-go/tools/cache.WaitForCacheSync(0x607c600, {0x6298000, 0x3, 0x3})
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:329 +0x80
    k8s.io/client-go/tools/cache.WaitForNamedCacheSync({0x283c5e1, 0xf}, 0x607c600, {0x6298000, 0x3, 0x3})
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:316 +0xe8
    created by k8s.io/kubernetes/plugin/pkg/auth/authorizer/node.AddGraphEventHandlers
    	plugin/pkg/auth/authorizer/node/graph_populator.go:65 +0x5b0
    panic: unaligned 64-bit atomic operation [recovered]
    	panic: unaligned 64-bit atomic operation

    goroutine 141 [running]:
    k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x0})
    	vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:56 +0xf4
    panic({0x2482378, 0x2db2ff8})
    	/usr/local/go/src/runtime/panic.go:884 +0x218
    runtime/internal/atomic.panicUnaligned()
    	/usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
    runtime/internal/atomic.Load64(0x685f794)
    	/usr/local/go/src/runtime/internal/atomic/atomic_arm.s:280 +0x14
    k8s.io/client-go/tools/cache/synctrack.(*SingleFileTracker).HasSynced(0x685f790)
    	vendor/k8s.io/client-go/tools/cache/synctrack/synctrack.go:115 +0x3c
    k8s.io/client-go/tools/cache.(*processorListener).HasSynced(0x6013e60)
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:907 +0x20
    k8s.io/client-go/tools/cache.WaitForCacheSync.func1()
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:332 +0x50
    k8s.io/apimachinery/pkg/util/wait.ConditionFunc.WithContext.func1({0x2dcf274, 0x607c600})
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:222 +0x1c
    k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext({0x2dcf274, 0x607c600}, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:262 +0x64
    k8s.io/apimachinery/pkg/util/wait.waitForWithContext({0x2dcf274, 0x607c600}, 0x64a6060, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:649 +0x11c
    k8s.io/apimachinery/pkg/util/wait.poll({0x2dcf274, 0x607c600}, 0x1, 0x64a6060, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:600 +0xc4
    k8s.io/apimachinery/pkg/util/wait.PollImmediateUntilWithContext({0x2dcf274, 0x607c600}, 0x5f5e100, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:551 +0x60
    k8s.io/apimachinery/pkg/util/wait.PollImmediateUntil(0x5f5e100, 0x6298020, 0x607c600)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:542 +0x48
    k8s.io/client-go/tools/cache.WaitForCacheSync(0x607c600, {0x6298000, 0x3, 0x3})
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:329 +0x80
    k8s.io/client-go/tools/cache.WaitForNamedCacheSync({0x283c5e1, 0xf}, 0x607c600, {0x6298000, 0x3, 0x3})
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:316 +0xe8
    created by k8s.io/kubernetes/plugin/pkg/auth/authorizer/node.AddGraphEventHandlers
    	plugin/pkg/auth/authorizer/node/graph_populator.go:65 +0x5b0
2023-03-13 08:37:13 +01:00
vinay kulkarni
06e1692371 Update generated files 2023-03-12 23:46:40 +00:00
vinay kulkarni
9a805db010 Set default resize policy only for specified resource types, rename RestartNotRequired -> NotRequired 2023-03-12 23:46:40 +00:00
vinay kulkarni
c5130fb0d6 Restructure naming of resource resize restart policy - generated files 2023-03-12 23:46:39 +00:00
vinay kulkarni
8b23497ae7 Restructure naming of resource resize restart policy 2023-03-12 23:11:32 +00:00
Kubernetes Prow Robot
3c6e419cc3 Merge pull request #116450 from vinaykul/restart-free-pod-vertical-scaling-api
Rename ContainerStatus.ResourcesAllocated to ContainerStatus.AllocatedResources
2023-03-12 16:06:40 -07:00
m.nabokikh
c2cadd2b60 Promote whoami kubectl command
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2023-03-12 15:24:31 +01:00
kannon92
aef8cbab89 Add batch.kubernetes.io to labels created in the Job controller. 2023-03-11 12:27:38 +00:00
Jiahui Feng
e1678f2b64 generated: UPDATE_COMPATIBILITY_FIXTURE_DATA
(cd staging/src/k8s.io/api/ && env UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test)
2023-03-10 16:22:01 -08:00
austin ce
a60624ffbc Allow custom metric provider for retry metrics 2023-03-10 17:48:10 -05:00
austin ce
fea83b7824 Unify queue constructors, deprecate current constructors 2023-03-10 17:46:26 -05:00
Kubernetes Prow Robot
36b29b38bb Merge pull request #116436 from wojtek-t/fix_watch_cache_2
Fix incorrect watch events when watch is initialized simultanously with reinitializing watchcache
2023-03-10 12:41:19 -08:00
Kubernetes Prow Robot
94e30facdb Merge pull request #114497 from dgrisonnet/pod-logs-metrics
Remove redundant subsystem in kube-apiserver pod logs metrics name
2023-03-10 12:40:41 -08:00
Kubernetes Prow Robot
211291222b Merge pull request #116216 from skitt/add-generic-set-clear
Add a Clear() function to generic sets
2023-03-10 11:44:54 -08:00
Kubernetes Prow Robot
7529178924 Merge pull request #111372 from HeavenTonight/master
code cleanup
2023-03-10 11:44:40 -08:00
Kubernetes Prow Robot
3ed9c61864 Merge pull request #116366 from ardaguclu/fix-shareprocess-explicit
kubectl debug: Not share process namespace if user explicitly disables it
2023-03-10 10:48:50 -08:00
Kubernetes Prow Robot
d8fe845415 Merge pull request #116108 from Jefftree/agg-discovery-enb
Enable Aggregated Discovery for Beta
2023-03-10 10:48:39 -08:00
Jiahui Feng
1fff4949bd generated: ./hack/update-codegen.sh && ./hack/update-openapi-spec.sh 2023-03-10 09:03:49 -08:00
Damien Grisonnet
1efa1a65ee pkg/registry: rename pod logs metrics
The pod_logs subsystem was inadvertently made redundant in the following
kube-apiserver metrics:
- kube_apiserver_pod_logs_pods_logs_backend_tls_failure_total
- kube_apiserver_pod_logs_pods_logs_insecure_backend_total

To safely rename them, it is required to deprecate them in 1.27 whilst
introducing the new metrics replacing them.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-03-10 17:43:09 +01:00
Clayton Coleman
a1aed50a79 wait: Split methods into files by role
No code changes, will make future refactorings easier.
2023-03-10 10:16:19 -06:00
Clayton Coleman
df3e8ee175 wait: Group ExponentialBackoff* functions together in file
No code change other than movement.
2023-03-10 10:02:27 -06:00
Kubernetes Prow Robot
fcfe5dfc21 Merge pull request #116435 from pohly/client-go-cache-reflector-leak
client-go: shut down watch reflector as soon as stop channel closes
2023-03-10 07:45:01 -08:00
Kubernetes Prow Robot
2e3c5003b9 Merge pull request #115630 from Jefftree/agg-discovery-metrics
Add metrics for aggregated discovery
2023-03-10 07:44:41 -08:00
Antonio Ojea
4dbb993d92 don't process unsupported loadbalancers with mixed protocols
Mixed protocols were not supported in GCE loadbalancers for old
versions, so we should fail to avoid confusions on users.

Ref: k8s.io/cloud-provider-gcp#475
Change-Id: I5fbd5230afbc51d595cacc96b3fa86473a3eb131
2023-03-10 15:38:04 +00:00
vinay kulkarni
565fd4116d Rename ContainerStatus.ResourcesAllocated to ContainerStatus.AllocatedResources - generated files 2023-03-10 14:49:26 +00:00
vinay kulkarni
01b96e7704 Rename ContainerStatus.ResourcesAllocated to ContainerStatus.AllocatedResources 2023-03-10 14:49:26 +00:00
Kubernetes Prow Robot
90c3232de7 Merge pull request #110772 from p0lyn0mial/upstream-reflector-gets-stream
client-go: Add support for API streaming to the reflector
2023-03-10 05:34:39 -08:00
Kubernetes Prow Robot
4b7bd457c4 Merge pull request #115204 from alexanderConstantinescu/kccm-del-taint-pred
[KCCM - service controller]: KEP-3458 implementation
2023-03-10 04:35:06 -08:00
Lukasz Szaszkiewicz
966b26d55c cache/controller: Add ENABLE_CLIENT_GO_WATCH_LIST_ALPHA 2023-03-10 12:16:13 +01:00
Lukasz Szaszkiewicz
194ffd779e reflector watchlist tests 2023-03-10 12:16:08 +01:00
Lukasz Szaszkiewicz
51ec7305aa reflector: use watchlist 2023-03-10 11:56:47 +01:00
Antonio Ojea
519695c401 make MixedProtocolNotSupported public
Change-Id: Ib9f5ea8e36c831cd0e9649aa998c96f61d56122d
2023-03-10 10:53:33 +00:00
Lukasz Szaszkiewicz
2fed6b8a19 reflector: introduce watchList 2023-03-10 10:33:44 +01:00
Stephen Kitt
57b0f7aa38 Add a Clear() function to generic sets
This is useful when a given set is shared through pointers, and
therefore can't be replaced with a new empty set. This replaces
set.Delete(set.UnsortedList()...), and allows the compiler to optimize
the function to a call to runtime.mapclear() when the set content type
is reflexive for ==. That optimization *is* currently accessible using

    s := Set[...]{}
    ...
    for i := range s {
        delete(s, i)
    }

but this circumvents the published API for sets; calling s.Delete(i)
instead can't be optimized in this fashion.

Alternatives considered but discarded include:

* turning sets into a pointer type (this isn't possible because
  pointer types can't be receivers)

* using a pointer receiver for the Clear() function, i.e.

    func (s *Set[T]) Clear() {
        *s = New[T]()
    }

  but this doesn't update shared references.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-03-10 10:03:44 +01:00
cpanato
3b12382529 update go to 1.19.7 in publishing bot rules for active release branches
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-03-10 09:57:14 +01:00
cpanato
43c841fa56 drop 1.23 config due to EOL
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-03-10 09:56:49 +01:00
Wojciech Tyczyński
6fb59e94a3 Fix setting resource version after init events for RV=0 case 2023-03-10 07:48:58 +01:00