Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions config/crds/machine_v1beta1_machine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,37 @@ metadata:
controller-tools.k8s.io: "1.0"
name: machines.machine.openshift.io
spec:
additionalPrinterColumns:
- JSONPath: .metadata.annotations['machine\.openshift\.io/instance-state']
description: State of instance
name: State
type: string
- JSONPath: .metadata.labels['machine\.openshift\.io/instance-type']
description: Type of instance
name: Type
type: string
- JSONPath: .metadata.labels['machine\.openshift\.io/region']
description: Region associated with machine
name: Region
type: string
- JSONPath: .metadata.labels['machine\.openshift\.io/zone']
description: Zone associated with machine
name: Zone
type: string
- JSONPath: .metadata.creationTimestamp
description: Machine age
name: Age
type: date
- JSONPath: .status.nodeRef.name
description: Node associated with machine
name: Node
priority: 1
type: string
- JSONPath: .spec.providerID
description: Provider ID of machine created in cloud provider
name: ProviderID
priority: 1
type: string
group: machine.openshift.io
names:
kind: Machine
Expand Down
21 changes: 21 additions & 0 deletions config/crds/machine_v1beta1_machineset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ metadata:
controller-tools.k8s.io: "1.0"
name: machinesets.machine.openshift.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.replicas
description: Desired Replicas
name: Desired
type: integer
- JSONPath: .status.replicas
description: Current Replicas
name: Current
type: integer
- JSONPath: .status.readyReplicas
description: Ready Replicas
name: Ready
type: integer
- JSONPath: .status.availableReplicas
description: Observed number of available replicas
name: Available
type: string
- JSONPath: .metadata.creationTimestamp
description: Machineset age
name: Age
type: date
group: machine.openshift.io
names:
kind: MachineSet
Expand Down
7 changes: 7 additions & 0 deletions pkg/apis/machine/v1beta1/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ const (
// Machine is the Schema for the machines API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".metadata.annotations['machine\.openshift\.io/instance-state']",description="State of instance"
// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".metadata.labels['machine\.openshift\.io/instance-type']",description="Type of instance"
// +kubebuilder:printcolumn:name="Region",type="string",JSONPath=".metadata.labels['machine\.openshift\.io/region']",description="Region associated with machine"
// +kubebuilder:printcolumn:name="Zone",type="string",JSONPath=".metadata.labels['machine\.openshift\.io/zone']",description="Zone associated with machine"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Machine age"
// +kubebuilder:printcolumn:name="Node",type="string",JSONPath=".status.nodeRef.name",description="Node associated with machine",priority=1
// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID of machine created in cloud provider",priority=1
type Machine struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/machine/v1beta1/machineset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ import (
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector
// +kubebuilder:printcolumn:name="Desired",type="integer",JSONPath=".spec.replicas",description="Desired Replicas"
// +kubebuilder:printcolumn:name="Current",type="integer",JSONPath=".status.replicas",description="Current Replicas"
// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Ready Replicas"
// +kubebuilder:printcolumn:name="Available",type="string",JSONPath=".status.availableReplicas",description="Observed number of available replicas"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Machineset age"
type MachineSet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
12 changes: 12 additions & 0 deletions pkg/controller/machine/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ const (

// ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set
ExcludeNodeDrainingAnnotation = "machine.openshift.io/exclude-node-draining"

// MachineRegionLabelName as annotation name for a machine region
MachineRegionLabelName = "machine.openshift.io/region"

// MachineAZLabelName as annotation name for a machine AZ
MachineAZLabelName = "machine.openshift.io/zone"

// MachineInstanceStateAnnotationName as annotation name for a machine instance state
MachineInstanceStateAnnotationName = "machine.openshift.io/instance-state"

// MachineInstanceTypeLabelName as annotation name for a machine instance type
MachineInstanceTypeLabelName = "machine.openshift.io/instance-type"
)

var DefaultActuator Actuator
Expand Down