Skip to content

Commit 87efd16

Browse files
committed
add svc export health check
1 parent 8e42356 commit 87efd16

File tree

54 files changed

+485
-1323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+485
-1323
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CLUSTER_CONFIG := $(abspath test/e2e/v1alpha1/kind-config.yaml)
2727
# Binaries
2828
# Note: Need to use abspath so we can invoke these from subdirectories
2929

30-
CONTROLLER_GEN_VER := v0.15.0
30+
CONTROLLER_GEN_VER := v0.16.0
3131
CONTROLLER_GEN_BIN := controller-gen
3232
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
3333

apis/placement/v1/clusterresourceplacement_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,6 @@ type ResourcePlacementStatus struct {
664664
// FailedResourcePlacement contains the failure details of a failed resource placement.
665665
type FailedResourcePlacement struct {
666666
// The resource failed to be placed.
667-
// +required
668667
ResourceIdentifier `json:",inline"`
669668

670669
// The failed condition status.

apis/placement/v1alpha1/override_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ type OverrideRule struct {
9797

9898
// JSONPatchOverrides defines a list of JSON patch override rules.
9999
// This field is only allowed when OverrideType is JSONPatch.
100-
// +kubebuilder:validation:Required
101100
// +kubebuilder:validation:MinItems=1
102101
// +kubebuilder:validation:MaxItems=20
103102
// +optional

apis/placement/v1beta1/clusterresourceplacement_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ type ResourcePlacementStatus struct {
951951
// FailedResourcePlacement contains the failure details of a failed resource placement.
952952
type FailedResourcePlacement struct {
953953
// The resource failed to be placed.
954-
// +kubebuilder:validation:Required
955954
ResourceIdentifier `json:",inline"`
956955

957956
// The failed condition status.
@@ -986,7 +985,6 @@ type PatchDetail struct {
986985
// DriftedResourcePlacement contains the details of a resource with configuration drifts.
987986
type DriftedResourcePlacement struct {
988987
// The resource that has drifted.
989-
// +kubebuilder:validation:Required
990988
ResourceIdentifier `json:",inline"`
991989

992990
// ObservationTime is the time when we observe the configuration drifts for the resource.
@@ -1021,7 +1019,6 @@ type DriftedResourcePlacement struct {
10211019
// DiffedResourcePlacement contains the details of a resource with configuration differences.
10221020
type DiffedResourcePlacement struct {
10231021
// The resource that has drifted.
1024-
// +kubebuilder:validation:Required
10251022
ResourceIdentifier `json:",inline"`
10261023

10271024
// ObservationTime is the time when we observe the configuration differences for the resource.

apis/v1alpha1/clusterresourceplacement_types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ type ClusterResourcePlacementStatus struct {
160160
// ResourceIdentifier identifies one Kubernetes resource.
161161
type ResourceIdentifier struct {
162162
// Group is the group name of the selected resource.
163-
// +required
163+
// +optional
164164
Group string `json:"group,omitempty"`
165165

166166
// Version is the version of the selected resource.
@@ -183,7 +183,6 @@ type ResourceIdentifier struct {
183183
// FailedResourcePlacement contains the failure details of a failed resource placement.
184184
type FailedResourcePlacement struct {
185185
// The resource failed to be placed.
186-
// +required
187186
ResourceIdentifier `json:",inline"`
188187

189188
// Name of the member cluster that the resource is placed to.

cmd/hubagent/options/ratelimit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (o *RateLimitOptions) AddFlags(fs *flag.FlagSet) {
3737
}
3838

3939
// DefaultControllerRateLimiter provide a default rate limiter for controller, and users can tune it by corresponding flags.
40-
func DefaultControllerRateLimiter(opts RateLimitOptions) workqueue.RateLimiter {
40+
func DefaultControllerRateLimiter(opts RateLimitOptions) workqueue.TypedRateLimiter[any] {
4141
// set defaults
4242
if opts.RateLimiterBaseDelay <= 0 {
4343
opts.RateLimiterBaseDelay = 5 * time.Millisecond
@@ -51,8 +51,8 @@ func DefaultControllerRateLimiter(opts RateLimitOptions) workqueue.RateLimiter {
5151
if opts.RateLimiterBucketSize <= 0 {
5252
opts.RateLimiterBucketSize = 100
5353
}
54-
return workqueue.NewMaxOfRateLimiter(
55-
workqueue.NewItemExponentialFailureRateLimiter(opts.RateLimiterBaseDelay, opts.RateLimiterMaxDelay),
56-
&workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(opts.RateLimiterQPS), opts.RateLimiterBucketSize)},
54+
return workqueue.NewTypedMaxOfRateLimiter[any](
55+
workqueue.NewTypedItemExponentialFailureRateLimiter[any](opts.RateLimiterBaseDelay, opts.RateLimiterMaxDelay),
56+
&workqueue.TypedBucketRateLimiter[any]{Limiter: rate.NewLimiter(rate.Limit(opts.RateLimiterQPS), opts.RateLimiterBucketSize)},
5757
)
5858
}

config/crd/bases/cluster.kubernetes-fleet.io_internalmemberclusters.yaml

Lines changed: 13 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: internalmemberclusters.cluster.kubernetes-fleet.io
88
spec:
99
group: cluster.kubernetes-fleet.io
@@ -80,18 +80,8 @@ spec:
8080
description: Conditions is an array of current observed conditions
8181
for the member agent.
8282
items:
83-
description: "Condition contains details for one aspect of
84-
the current state of this API Resource.\n---\nThis struct
85-
is intended for direct use as an array at the field path
86-
.status.conditions. For example,\n\n\n\ttype FooStatus
87-
struct{\n\t // Represents the observations of a foo's
88-
current state.\n\t // Known .status.conditions.type are:
89-
\"Available\", \"Progressing\", and \"Degraded\"\n\t //
90-
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t //
91-
+listType=map\n\t // +listMapKey=type\n\t Conditions
92-
[]metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\"
93-
patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
94-
\ // other fields\n\t}"
83+
description: Condition contains details for one aspect of
84+
the current state of this API Resource.
9585
properties:
9686
lastTransitionTime:
9787
description: |-
@@ -133,12 +123,7 @@ spec:
133123
- Unknown
134124
type: string
135125
type:
136-
description: |-
137-
type of condition in CamelCase or in foo.example.com/CamelCase.
138-
---
139-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
140-
useful (see .node.status.conditions), the ability to deconflict is important.
141-
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
126+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
142127
maxLength: 316
143128
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
144129
type: string
@@ -169,16 +154,8 @@ spec:
169154
description: Conditions is an array of current observed conditions
170155
for the member cluster.
171156
items:
172-
description: "Condition contains details for one aspect of the current
173-
state of this API Resource.\n---\nThis struct is intended for
174-
direct use as an array at the field path .status.conditions. For
175-
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
176-
observations of a foo's current state.\n\t // Known .status.conditions.type
177-
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
178-
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
179-
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
180-
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
181-
\ // other fields\n\t}"
157+
description: Condition contains details for one aspect of the current
158+
state of this API Resource.
182159
properties:
183160
lastTransitionTime:
184161
description: |-
@@ -219,12 +196,7 @@ spec:
219196
- Unknown
220197
type: string
221198
type:
222-
description: |-
223-
type of condition in CamelCase or in foo.example.com/CamelCase.
224-
---
225-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
226-
useful (see .node.status.conditions), the ability to deconflict is important.
227-
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
199+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
228200
maxLength: 316
229201
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
230202
type: string
@@ -249,7 +221,6 @@ spec:
249221
description: |-
250222
Value is the value of the cluster property.
251223
252-
253224
Currently, it should be a valid Kubernetes quantity.
254225
For more information, see
255226
https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity.
@@ -261,7 +232,6 @@ spec:
261232
description: |-
262233
Properties is an array of properties observed for the member cluster.
263234
264-
265235
This field is beta-level; it is for the property-based scheduling feature and is only
266236
populated when a property provider is enabled in the deployment.
267237
type: object
@@ -279,12 +249,10 @@ spec:
279249
description: |-
280250
Allocatable represents the total allocatable resources of all the nodes on a member cluster.
281251
282-
283252
A node's allocatable capacity is the amount of resource that can actually be used
284253
for user workloads, i.e.,
285254
allocatable capacity = total capacity - capacities reserved for the OS, kubelet, etc.
286255
287-
288256
For more information, see
289257
https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/.
290258
type: object
@@ -298,11 +266,9 @@ spec:
298266
description: |-
299267
Available represents the total available resources of all the nodes on a member cluster.
300268
301-
302269
A node's available capacity is the amount of resource that has not been used yet, i.e.,
303270
available capacity = allocatable capacity - capacity that has been requested by workloads.
304271
305-
306272
This field is beta-level; it is for the property-based scheduling feature and is only
307273
populated when a property provider is enabled in the deployment.
308274
type: object
@@ -316,7 +282,6 @@ spec:
316282
description: |-
317283
Capacity represents the total resource capacity of all the nodes on a member cluster.
318284
319-
320285
A node's total capacity is the amount of resource installed on the node.
321286
type: object
322287
observationTime:
@@ -393,18 +358,8 @@ spec:
393358
description: Conditions is an array of current observed conditions
394359
for the member agent.
395360
items:
396-
description: "Condition contains details for one aspect of
397-
the current state of this API Resource.\n---\nThis struct
398-
is intended for direct use as an array at the field path
399-
.status.conditions. For example,\n\n\n\ttype FooStatus
400-
struct{\n\t // Represents the observations of a foo's
401-
current state.\n\t // Known .status.conditions.type are:
402-
\"Available\", \"Progressing\", and \"Degraded\"\n\t //
403-
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t //
404-
+listType=map\n\t // +listMapKey=type\n\t Conditions
405-
[]metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\"
406-
patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
407-
\ // other fields\n\t}"
361+
description: Condition contains details for one aspect of
362+
the current state of this API Resource.
408363
properties:
409364
lastTransitionTime:
410365
description: |-
@@ -446,12 +401,7 @@ spec:
446401
- Unknown
447402
type: string
448403
type:
449-
description: |-
450-
type of condition in CamelCase or in foo.example.com/CamelCase.
451-
---
452-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
453-
useful (see .node.status.conditions), the ability to deconflict is important.
454-
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
404+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
455405
maxLength: 316
456406
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
457407
type: string
@@ -482,16 +432,8 @@ spec:
482432
description: Conditions is an array of current observed conditions
483433
for the member cluster.
484434
items:
485-
description: "Condition contains details for one aspect of the current
486-
state of this API Resource.\n---\nThis struct is intended for
487-
direct use as an array at the field path .status.conditions. For
488-
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
489-
observations of a foo's current state.\n\t // Known .status.conditions.type
490-
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
491-
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
492-
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
493-
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
494-
\ // other fields\n\t}"
435+
description: Condition contains details for one aspect of the current
436+
state of this API Resource.
495437
properties:
496438
lastTransitionTime:
497439
description: |-
@@ -532,12 +474,7 @@ spec:
532474
- Unknown
533475
type: string
534476
type:
535-
description: |-
536-
type of condition in CamelCase or in foo.example.com/CamelCase.
537-
---
538-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
539-
useful (see .node.status.conditions), the ability to deconflict is important.
540-
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
477+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
541478
maxLength: 316
542479
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
543480
type: string
@@ -562,7 +499,6 @@ spec:
562499
description: |-
563500
Value is the value of the cluster property.
564501
565-
566502
Currently, it should be a valid Kubernetes quantity.
567503
For more information, see
568504
https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity.
@@ -574,7 +510,6 @@ spec:
574510
description: |-
575511
Properties is an array of properties observed for the member cluster.
576512
577-
578513
This field is beta-level; it is for the property-based scheduling feature and is only
579514
populated when a property provider is enabled in the deployment.
580515
type: object
@@ -592,12 +527,10 @@ spec:
592527
description: |-
593528
Allocatable represents the total allocatable resources of all the nodes on a member cluster.
594529
595-
596530
A node's allocatable capacity is the amount of resource that can actually be used
597531
for user workloads, i.e.,
598532
allocatable capacity = total capacity - capacities reserved for the OS, kubelet, etc.
599533
600-
601534
For more information, see
602535
https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/.
603536
type: object
@@ -611,11 +544,9 @@ spec:
611544
description: |-
612545
Available represents the total available resources of all the nodes on a member cluster.
613546
614-
615547
A node's available capacity is the amount of resource that has not been used yet, i.e.,
616548
available capacity = allocatable capacity - capacity that has been requested by workloads.
617549
618-
619550
This field is beta-level; it is for the property-based scheduling feature and is only
620551
populated when a property provider is enabled in the deployment.
621552
type: object
@@ -629,7 +560,6 @@ spec:
629560
description: |-
630561
Capacity represents the total resource capacity of all the nodes on a member cluster.
631562
632-
633563
A node's total capacity is the amount of resource installed on the node.
634564
type: object
635565
observationTime:

0 commit comments

Comments
 (0)