Skip to content

Commit

Permalink
Merge pull request #103 from gary-lgy/kcct-canary
Browse files Browse the repository at this point in the history
feat(kcc): canary update
  • Loading branch information
gary-lgy authored Dec 3, 2024
2 parents ae613a8 + 4225fe0 commit 0e60603
Show file tree
Hide file tree
Showing 8 changed files with 320 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
- jsonPath: .spec.paused
name: PAUSED
type: boolean
- jsonPath: .spec.nodeLabelSelector
name: SELECTOR
type: string
Expand All @@ -33,6 +36,18 @@ spec:
- jsonPath: .spec.ephemeralSelector.lastDuration
name: DURATION
type: string
- jsonPath: .status.targetNodes
name: TARGET
type: integer
- jsonPath: .status.canaryNodes
name: CANARY
type: integer
- jsonPath: .status.updatedTargetNodes
name: UPDATED-TARGET
type: integer
- jsonPath: .status.currentHash
name: HASH
type: string
- jsonPath: .status.conditions[?(@.type=="Valid")].status
name: VALID
type: string
Expand Down Expand Up @@ -680,6 +695,9 @@ spec:
KatalystCustomConfig.spec.nodeLabelSelectorAllowedKeyList, otherwise
it will not be synced.
type: string
paused:
description: Indicates that the config is paused.
type: boolean
priority:
description: Priority is used by one node matched by NodeLabelSelector
of more than one configuration, and the higher priority will be
Expand All @@ -695,11 +713,42 @@ spec:
currently applied Spec version. The default value is 3.
format: int64
type: integer
updateStrategy:
description: An update strategy to replace existing CustomNodeConfig
configurations with new ones.
properties:
rollingUpdate:
description: 'Rolling update config params. Present only if type
= "RollingUpdate". --- TODO: Update this to follow our convention
for oneOf, whatever we decide it to be. Same as Deployment `strategy.rollingUpdate`.
See https://github.com/kubernetes/kubernetes/issues/35345'
properties:
canary:
anyOf:
- type: integer
- type: string
description: 'The number or percentage of target CustomNodeConfigs
to update to the current configuration. For example: `100``
and `20%` are valid values.'
pattern: ^(100|[1-9][0-9]?|0)%$
x-kubernetes-int-or-string: true
type: object
type:
description: Type of config update. Only `RollingUpdate` is supported.
enum:
- RollingUpdate
type: string
type: object
required:
- config
type: object
status:
properties:
canaryNodes:
description: The number of nodes that this config is targeting and
should be updated given the current strategy.
format: int32
type: integer
collisionCount:
description: Count of hash collisions for this cr. The kcc controller
uses this field as a collision avoidance mechanism when it needs
Expand Down Expand Up @@ -734,10 +783,27 @@ spec:
- type
type: object
type: array
currentHash:
description: The hash of the current config observed by the kcc controller.
type: string
observedGeneration:
description: The most recent generation observed by the kcc controller.
format: int64
type: integer
targetNodes:
description: The number of nodes that this config is targeting.
format: int32
type: integer
updatedNodes:
description: The number of nodes (including non-target nodes) that
have been updated by this config.
format: int32
type: integer
updatedTargetNodes:
description: The number of target nodes that have been updated by
this config.
format: int32
type: integer
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
- jsonPath: .spec.paused
name: PAUSED
type: boolean
- jsonPath: .spec.nodeLabelSelector
name: SELECTOR
type: string
Expand All @@ -33,6 +36,18 @@ spec:
- jsonPath: .spec.ephemeralSelector.lastDuration
name: DURATION
type: string
- jsonPath: .status.targetNodes
name: TARGET
type: integer
- jsonPath: .status.canaryNodes
name: CANARY
type: integer
- jsonPath: .status.updatedTargetNodes
name: UPDATED-TARGET
type: integer
- jsonPath: .status.currentHash
name: HASH
type: string
- jsonPath: .status.conditions[?(@.type=="Valid")].status
name: VALID
type: string
Expand Down Expand Up @@ -121,6 +136,9 @@ spec:
KatalystCustomConfig.spec.nodeLabelSelectorAllowedKeyList, otherwise
it will not be synced.
type: string
paused:
description: Indicates that the config is paused.
type: boolean
priority:
description: Priority is used by one node matched by NodeLabelSelector
of more than one configuration, and the higher priority will be
Expand All @@ -136,9 +154,40 @@ spec:
currently applied Spec version. The default value is 3.
format: int64
type: integer
updateStrategy:
description: An update strategy to replace existing CustomNodeConfig
configurations with new ones.
properties:
rollingUpdate:
description: 'Rolling update config params. Present only if type
= "RollingUpdate". --- TODO: Update this to follow our convention
for oneOf, whatever we decide it to be. Same as Deployment `strategy.rollingUpdate`.
See https://github.com/kubernetes/kubernetes/issues/35345'
properties:
canary:
anyOf:
- type: integer
- type: string
description: 'The number or percentage of target CustomNodeConfigs
to update to the current configuration. For example: `100``
and `20%` are valid values.'
pattern: ^(100|[1-9][0-9]?|0)%$
x-kubernetes-int-or-string: true
type: object
type:
description: Type of config update. Only `RollingUpdate` is supported.
enum:
- RollingUpdate
type: string
type: object
type: object
status:
properties:
canaryNodes:
description: The number of nodes that this config is targeting and
should be updated given the current strategy.
format: int32
type: integer
collisionCount:
description: Count of hash collisions for this cr. The kcc controller
uses this field as a collision avoidance mechanism when it needs
Expand Down Expand Up @@ -173,10 +222,27 @@ spec:
- type
type: object
type: array
currentHash:
description: The hash of the current config observed by the kcc controller.
type: string
observedGeneration:
description: The most recent generation observed by the kcc controller.
format: int64
type: integer
targetNodes:
description: The number of nodes that this config is targeting.
format: int32
type: integer
updatedNodes:
description: The number of nodes (including non-target nodes) that
have been updated by this config.
format: int32
type: integer
updatedTargetNodes:
description: The number of target nodes that have been updated by
this config.
format: int32
type: integer
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
- jsonPath: .spec.paused
name: PAUSED
type: boolean
- jsonPath: .spec.nodeLabelSelector
name: SELECTOR
type: string
Expand All @@ -33,6 +36,18 @@ spec:
- jsonPath: .spec.ephemeralSelector.lastDuration
name: DURATION
type: string
- jsonPath: .status.targetNodes
name: TARGET
type: integer
- jsonPath: .status.canaryNodes
name: CANARY
type: integer
- jsonPath: .status.updatedTargetNodes
name: UPDATED-TARGET
type: integer
- jsonPath: .status.currentHash
name: HASH
type: string
- jsonPath: .status.conditions[?(@.type=="Valid")].status
name: VALID
type: string
Expand Down Expand Up @@ -295,6 +310,9 @@ spec:
KatalystCustomConfig.spec.nodeLabelSelectorAllowedKeyList, otherwise
it will not be synced.
type: string
paused:
description: Indicates that the config is paused.
type: boolean
priority:
description: Priority is used by one node matched by NodeLabelSelector
of more than one configuration, and the higher priority will be
Expand All @@ -310,11 +328,42 @@ spec:
currently applied Spec version. The default value is 3.
format: int64
type: integer
updateStrategy:
description: An update strategy to replace existing CustomNodeConfig
configurations with new ones.
properties:
rollingUpdate:
description: 'Rolling update config params. Present only if type
= "RollingUpdate". --- TODO: Update this to follow our convention
for oneOf, whatever we decide it to be. Same as Deployment `strategy.rollingUpdate`.
See https://github.com/kubernetes/kubernetes/issues/35345'
properties:
canary:
anyOf:
- type: integer
- type: string
description: 'The number or percentage of target CustomNodeConfigs
to update to the current configuration. For example: `100``
and `20%` are valid values.'
pattern: ^(100|[1-9][0-9]?|0)%$
x-kubernetes-int-or-string: true
type: object
type:
description: Type of config update. Only `RollingUpdate` is supported.
enum:
- RollingUpdate
type: string
type: object
required:
- config
type: object
status:
properties:
canaryNodes:
description: The number of nodes that this config is targeting and
should be updated given the current strategy.
format: int32
type: integer
collisionCount:
description: Count of hash collisions for this cr. The kcc controller
uses this field as a collision avoidance mechanism when it needs
Expand Down Expand Up @@ -349,10 +398,27 @@ spec:
- type
type: object
type: array
currentHash:
description: The hash of the current config observed by the kcc controller.
type: string
observedGeneration:
description: The most recent generation observed by the kcc controller.
format: int64
type: integer
targetNodes:
description: The number of nodes that this config is targeting.
format: int32
type: integer
updatedNodes:
description: The number of nodes (including non-target nodes) that
have been updated by this config.
format: int32
type: integer
updatedTargetNodes:
description: The number of target nodes that have been updated by
this config.
format: int32
type: integer
type: object
type: object
served: true
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/config/v1alpha1/adminqos.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ import (
// +kubebuilder:resource:path=adminqosconfigurations,shortName=aqc
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=.metadata.creationTimestamp
// +kubebuilder:printcolumn:name="PAUSED",type=boolean,JSONPath=".spec.paused"
// +kubebuilder:printcolumn:name="SELECTOR",type=string,JSONPath=".spec.nodeLabelSelector"
// +kubebuilder:printcolumn:name="PRIORITY",type=string,JSONPath=".spec.priority"
// +kubebuilder:printcolumn:name="NODES",type=string,JSONPath=".spec.ephemeralSelector.nodeNames"
// +kubebuilder:printcolumn:name="DURATION",type=string,JSONPath=".spec.ephemeralSelector.lastDuration"
// +kubebuilder:printcolumn:name="TARGET",type=integer,JSONPath=".status.targetNodes"
// +kubebuilder:printcolumn:name="CANARY",type=integer,JSONPath=".status.canaryNodes"
// +kubebuilder:printcolumn:name="UPDATED-TARGET",type=integer,JSONPath=".status.updatedTargetNodes"
// +kubebuilder:printcolumn:name="HASH",type=string,JSONPath=".status.currentHash"
// +kubebuilder:printcolumn:name="VALID",type=string,JSONPath=".status.conditions[?(@.type==\"Valid\")].status"
// +kubebuilder:printcolumn:name="REASON",type=string,JSONPath=".status.conditions[?(@.type==\"Valid\")].reason"
// +kubebuilder:printcolumn:name="MESSAGE",type=string,JSONPath=".status.conditions[?(@.type==\"Valid\")].message"
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/config/v1alpha1/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +kubebuilder:resource:path=authconfigurations,shortName=ac
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=.metadata.creationTimestamp
// +kubebuilder:printcolumn:name="PAUSED",type=boolean,JSONPath=".spec.paused"
// +kubebuilder:printcolumn:name="SELECTOR",type=string,JSONPath=".spec.nodeLabelSelector"
// +kubebuilder:printcolumn:name="PRIORITY",type=string,JSONPath=".spec.priority"
// +kubebuilder:printcolumn:name="NODES",type=string,JSONPath=".spec.ephemeralSelector.nodeNames"
// +kubebuilder:printcolumn:name="DURATION",type=string,JSONPath=".spec.ephemeralSelector.lastDuration"
// +kubebuilder:printcolumn:name="TARGET",type=integer,JSONPath=".status.targetNodes"
// +kubebuilder:printcolumn:name="CANARY",type=integer,JSONPath=".status.canaryNodes"
// +kubebuilder:printcolumn:name="UPDATED-TARGET",type=integer,JSONPath=".status.updatedTargetNodes"
// +kubebuilder:printcolumn:name="HASH",type=string,JSONPath=".status.currentHash"
// +kubebuilder:printcolumn:name="VALID",type=string,JSONPath=".status.conditions[?(@.type==\"Valid\")].status"
// +kubebuilder:printcolumn:name="REASON",type=string,JSONPath=".status.conditions[?(@.type==\"Valid\")].reason"
// +kubebuilder:printcolumn:name="MESSAGE",type=string,JSONPath=".status.conditions[?(@.type==\"Valid\")].message"
Expand Down
Loading

0 comments on commit 0e60603

Please sign in to comment.