Skip to content

Commit

Permalink
feat: Adding printer columns on v1 NodeClaims (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam committed Jun 28, 2024
1 parent 1b1cf03 commit d1132ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions kwok/charts/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ spec:
- jsonPath: .metadata.labels.node\.kubernetes\.io/instance-type
name: Type
type: string
- jsonPath: .metadata.labels.karpenter\.sh/capacity-type
name: Capacity
type: string
- jsonPath: .metadata.labels.topology\.kubernetes\.io/zone
name: Zone
type: string
Expand All @@ -32,8 +35,8 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .metadata.labels.karpenter\.sh/capacity-type
name: Capacity
- jsonPath: .status.providerID
name: ID
priority: 1
type: string
- jsonPath: .metadata.labels.karpenter\.sh/nodepool
Expand Down
7 changes: 5 additions & 2 deletions pkg/apis/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ spec:
- jsonPath: .metadata.labels.node\.kubernetes\.io/instance-type
name: Type
type: string
- jsonPath: .metadata.labels.karpenter\.sh/capacity-type
name: Capacity
type: string
- jsonPath: .metadata.labels.topology\.kubernetes\.io/zone
name: Zone
type: string
Expand All @@ -32,8 +35,8 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .metadata.labels.karpenter\.sh/capacity-type
name: Capacity
- jsonPath: .status.providerID
name: ID
priority: 1
type: string
- jsonPath: .metadata.labels.karpenter\.sh/nodepool
Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/v1/nodeclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,12 @@ type Provider = runtime.RawExtension
// +kubebuilder:resource:path=nodeclaims,scope=Cluster,categories=karpenter
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".metadata.labels.node\\.kubernetes\\.io/instance-type",description=""
// +kubebuilder:printcolumn:name="Capacity",type="string",JSONPath=".metadata.labels.karpenter\\.sh/capacity-type",description=""
// +kubebuilder:printcolumn:name="Zone",type="string",JSONPath=".metadata.labels.topology\\.kubernetes\\.io/zone",description=""
// +kubebuilder:printcolumn:name="Node",type="string",JSONPath=".status.nodeName",description=""
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
// +kubebuilder:printcolumn:name="Capacity",type="string",JSONPath=".metadata.labels.karpenter\\.sh/capacity-type",priority=1,description=""
// +kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.providerID",priority=1,description=""
// +kubebuilder:printcolumn:name="NodePool",type="string",JSONPath=".metadata.labels.karpenter\\.sh/nodepool",priority=1,description=""
// +kubebuilder:printcolumn:name="NodeClass",type="string",JSONPath=".spec.nodeClassRef.name",priority=1,description=""
type NodeClaim struct {
Expand Down

0 comments on commit d1132ab

Please sign in to comment.