Skip to content

Commit

Permalink
improve clusterStageUpdateRun UI and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jwtty committed Jan 6, 2025
1 parent 08b66ee commit 80b0d09
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 15 deletions.
5 changes: 5 additions & 0 deletions apis/placement/v1alpha1/stagedupdate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster,categories={fleet,fleet-placement},shortName=crsur
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Initialized")].status`,name="Initialized",type=string
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Succeeded")].status`,name="Succeeded",type=string
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date

// ClusterStagedUpdateRun represents a stage by stage update process that applies ClusterResourcePlacement
// selected resources to specified clusters.
Expand Down Expand Up @@ -397,6 +400,8 @@ type ClusterStagedUpdateRunList struct {
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster,categories={fleet,fleet-placement},shortName=careq
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Approved")].status`,name="Approved",type=string
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date

// ClusterApprovalRequest defines a request for user approval for cluster staged update run.
// The request object MUST have the following labels:
Expand Down
5 changes: 5 additions & 0 deletions apis/placement/v1beta1/stageupdate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import (
// +kubebuilder:resource:scope=Cluster,categories={fleet,fleet-placement},shortName=crsur
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Initialized")].status`,name="Initialized",type=string
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Succeeded")].status`,name="Succeeded",type=string
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date

// ClusterStagedUpdateRun represents a stage by stage update process that applies ClusterResourcePlacement
// selected resources to specified clusters.
Expand Down Expand Up @@ -398,6 +401,8 @@ type ClusterStagedUpdateRunList struct {
// +kubebuilder:resource:scope=Cluster,categories={fleet,fleet-placement},shortName=careq
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Approved")].status`,name="Approved",type=string
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date

// ClusterApprovalRequest defines a request for user approval for cluster staged update run.
// The request object MUST have the following labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ spec:
singular: clusterapprovalrequest
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Approved")].status
name: Approved
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
Expand Down Expand Up @@ -150,7 +157,14 @@ spec:
storage: false
subresources:
status: {}
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Approved")].status
name: Approved
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ spec:
singular: clusterstagedupdaterun
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Initialized")].status
name: Initialized
type: string
- jsonPath: .status.conditions[?(@.type=="Succeeded")].status
name: Succeeded
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
Expand Down Expand Up @@ -1213,7 +1223,17 @@ spec:
storage: false
subresources:
status: {}
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Initialized")].status
name: Initialized
type: string
- jsonPath: .status.conditions[?(@.type=="Succeeded")].status
name: Succeeded
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: |-
Expand Down
12 changes: 6 additions & 6 deletions examples/stagedupdaterun/approvalRequest.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: placement.kubernetes-fleet.io/v1alpha1
apiVersion: placement.kubernetes-fleet.io/v1beta1
kind: ClusterApprovalRequest
metadata:
name: example-approvalrequest
labels:
TargetUpdateRun: example-clusterstagedupdaterun
TargetStage: stage1
IsLatestUpdateRunApproval: "true"
kubernetes-fleet.io/targetupdaterun: example-run
kubernetes-fleet.io/targetUpdatingStage: canary
kubernetes-fleet.io/isLatestUpdateRunApproval: "true"
spec:
parentStageRollout: example-run
targetStage: canary
status:
conditions:
- type: Approved
status: "True"
- type: Approved
status: "True"
4 changes: 2 additions & 2 deletions examples/stagedupdaterun/clusterStagedUpdateRun.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: placement.kubernetes-fleet.io/v1alpha1
apiVersion: placement.kubernetes-fleet.io/v1beta1
kind: ClusterStagedUpdateRun
metadata:
name: example-run
Expand Down Expand Up @@ -39,4 +39,4 @@ status:
- type: Progressing
status: "True"
- type: Succeeded
status: "False"
status: "False"
2 changes: 1 addition & 1 deletion examples/stagedupdaterun/example-crp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ spec:
- key: gpu-workload
operator: Exists
strategy:
type: External
type: External
4 changes: 2 additions & 2 deletions examples/stagedupdaterun/updateStrategy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: placement.kubernetes-fleet.io/v1alpha1
apiVersion: placement.kubernetes-fleet.io/v1beta1
kind: ClusterStagedUpdateStrategy
metadata:
name: example-strategy
Expand Down Expand Up @@ -26,4 +26,4 @@ spec:
afterStageTasks:
- type: Approval
- type: TimedWait
waitTime: 1h
waitTime: 1h

0 comments on commit 80b0d09

Please sign in to comment.