-
Notifications
You must be signed in to change notification settings - Fork 84
/
ibmpowervsmachine_types.go
121 lines (91 loc) · 4.37 KB
/
ibmpowervsmachine_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha4
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
const (
// IBMPowerVSMachineFinalizer allows IBMPowerVSMachineReconciler to clean up resources associated with IBMPowerVSMachine before
// removing it from the apiserver.
IBMPowerVSMachineFinalizer = "ibmpowervsmachine.infrastructure.cluster.x-k8s.io"
)
// IBMPowerVSMachineSpec defines the desired state of IBMPowerVSMachine
type IBMPowerVSMachineSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
// ServiceInstanceID is the id of the power cloud instance where the vsi instance will get deployed
ServiceInstanceID string `json:"serviceInstanceID"`
// SSHKey is the name of the SSH key pair provided to the vsi for authenticating users
SSHKey string `json:"sshKey,omitempty"`
// ImageID is the id of OS image which would be install on the instance.
// Example: c57eef35-ea0b-45d7-b864-4b0d4893425b
ImageID string `json:"imageID"`
// SysType is the System type used to host the vsi
SysType string `json:"sysType"`
// ProcType is the processor type, e.g: dedicated, shared, capped
ProcType string `json:"procType"`
// Processors is Number of processors allocated
Processors string `json:"processors"`
// Memory is Amount of memory allocated (in GB)
Memory string `json:"memory"`
// NetworkID is network ID used for the VSI
NetworkID string `json:"networkID"`
// ProviderID is the unique identifier as specified by the cloud provider.
// +optional
ProviderID *string `json:"providerID,omitempty"`
}
// IBMPowerVSMachineStatus defines the observed state of IBMPowerVSMachine
type IBMPowerVSMachineStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
InstanceID string `json:"instanceID,omitempty"`
// Ready is true when the provider resource is ready.
// +optional
Ready bool `json:"ready"`
// Addresses contains the vsi associated addresses.
Addresses []v1.NodeAddress `json:"addresses,omitempty"`
// Health is the health of the vsi
// +optional
Health string `json:"health,omitempty"`
// InstanceState is the status of the vsi
InstanceState string `json:"instanceState"`
// Fault will report if any fault messages for the vsi
// +optional
Fault string `json:"fault,omitempty"`
}
// +kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this IBMPowerVSMachine belongs"
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for IBM PowerVS instances"
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="PowerVS instance state"
// +kubebuilder:printcolumn:name="Health",type="string",JSONPath=".status.health",description="PowerVS instance health"
// IBMPowerVSMachine is the Schema for the ibmpowervsmachines API
type IBMPowerVSMachine struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec IBMPowerVSMachineSpec `json:"spec,omitempty"`
Status IBMPowerVSMachineStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// IBMPowerVSMachineList contains a list of IBMPowerVSMachine
type IBMPowerVSMachineList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []IBMPowerVSMachine `json:"items"`
}
func init() {
SchemeBuilder.Register(&IBMPowerVSMachine{}, &IBMPowerVSMachineList{})
}