Skip to content

Commit 2b9eb08

Browse files
committed
Fixed a couple of issues during machine creation and LBPlaceholder management
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
1 parent 7464158 commit 2b9eb08

10 files changed

+530
-120
lines changed

api/v1alpha1/harvestermachine_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ type VolumeType string
110110
// HarvesterMachineStatus defines the observed state of HarvesterMachine.
111111
type HarvesterMachineStatus struct {
112112
// Ready is true when the provider resource is ready.
113-
Ready bool `json:"ready"`
113+
Ready bool `json:"ready,omitempty"`
114114

115115
Conditions []capiv1beta1.Condition `json:"conditions,omitempty"`
116116

config/crd/bases/infrastructure.cluster.x-k8s.io_harvesterclusters.yaml

+24-22
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
name: v1alpha1
3333
schema:
3434
openAPIV3Schema:
35-
description: HarvesterCluster is the Schema for the harvesterclusters API
35+
description: HarvesterCluster is the Schema for the harvesterclusters API.
3636
properties:
3737
apiVersion:
3838
description: 'APIVersion defines the versioned schema of this representation
@@ -47,7 +47,7 @@ spec:
4747
metadata:
4848
type: object
4949
spec:
50-
description: HarvesterClusterSpec defines the desired state of HarvesterCluster
50+
description: HarvesterClusterSpec defines the desired state of HarvesterCluster.
5151
properties:
5252
controlPlaneEndpoint:
5353
description: ControlPlaneEndpoint represents the endpoint used to
@@ -69,11 +69,11 @@ spec:
6969
file.
7070
properties:
7171
name:
72-
description: Name is the name of the required Identity Secret
72+
description: Name is the name of the required Identity Secret.
7373
type: string
7474
namespace:
7575
description: Namespace is the namespace in which the required
76-
Identity Secret should be found
76+
Identity Secret should be found.
7777
type: string
7878
required:
7979
- name
@@ -89,36 +89,38 @@ spec:
8989
type: string
9090
ipPool:
9191
description: IpPool defines a new IpPool that will be added to
92-
Harvester. This field is mutually exclusive with "IpPoolRef"
92+
Harvester. This field is mutually exclusive with "IpPoolRef".
9393
properties:
9494
gateway:
9595
description: Gateway is the IP Address that should be used
9696
by the Gateway on the Subnet. It should be a valid address
97-
inside the subnet e.g. 172.17.1.1
97+
inside the subnet. e.g. 172.17.1.1.
9898
type: string
9999
subnet:
100100
description: Subnet is a string describing the subnet that
101101
should be used by the IP Pool, it should have the CIDR Format
102-
of an IPv4 Address e.g. 172.17.1.0/24
102+
of an IPv4 Address. e.g. 172.17.1.0/24.
103103
type: string
104104
vmNetwork:
105105
description: VMNetwork is the name of an existing VM Network
106-
in Harvester where the IPPool should exist.
106+
in Harvester where the IPPool should exist. The reference
107+
can have the format "namespace/name" or just "name" if the
108+
object is in the same namespace as the HarvesterCluster.
107109
type: string
108110
required:
109111
- gateway
110112
- subnet
111113
- vmNetwork
112114
type: object
113115
ipPoolRef:
114-
description: IpPoolRef is a reference to an existing IpPool object
115-
in Harvester's cluster in the same namespace. This field is
116-
mutually exclusive with "ipPool"
116+
description: 'IpPoolRef is a reference to an existing IpPool object
117+
in Harvester''s cluster. This field is mutually exclusive with
118+
"ipPool". TODO: To be implemented'
117119
type: string
118120
ipamType:
119121
description: IPAMType is the configuration of IP addressing for
120122
the control plane load balancer. This can take two values, either
121-
"dhcp" or "ippool"
123+
"dhcp" or "ippool".
122124
enum:
123125
- dhcp
124126
- pool
@@ -128,25 +130,25 @@ spec:
128130
on the load balancer.
129131
items:
130132
description: Listener is a description of a new Listener to
131-
be created on the Load Balancer
133+
be created on the Load Balancer.
132134
properties:
133135
backendPort:
134136
description: TargetPort is the port that the listener should
135-
forward traffic to
137+
forward traffic to.
136138
format: int32
137139
type: integer
138140
name:
139-
description: Name is the name of the listener
141+
description: Name is the name of the listener.
140142
type: string
141143
port:
142144
description: Port is the port that the listener should listen
143-
on
145+
on.
144146
format: int32
145147
type: integer
146148
protocol:
147149
default: TCP
148150
description: Protocol is the protocol that the listener
149-
should use, either TCP or UDP
151+
should use, either TCP or UDP.
150152
enum:
151153
- TCP
152154
- UDP
@@ -166,15 +168,15 @@ spec:
166168
type: string
167169
targetNamespace:
168170
description: TargetNamespace is the namespace on the Harvester cluster
169-
where VMs, Load Balancers, etc. should be created
171+
where VMs, Load Balancers, etc. should be created.
170172
type: string
171173
required:
172174
- identitySecret
173175
- loadBalancerConfig
174176
- targetNamespace
175177
type: object
176178
status:
177-
description: HarvesterClusterStatus defines the observed state of HarvesterCluster
179+
description: HarvesterClusterStatus defines the observed state of HarvesterCluster.
178180
properties:
179181
conditions:
180182
description: Conditions defines current service state of the Harvester
@@ -224,15 +226,15 @@ spec:
224226
type: array
225227
failureMessage:
226228
description: FailureMessage is a full error message dump of the above
227-
failureReason
229+
failureReason.
228230
type: string
229231
failureReason:
230232
description: FailureReason is the short name for the reason why a
231-
failure might be happening that makes the cluster not ready
233+
failure might be happening that makes the cluster not ready.
232234
type: string
233235
ready:
234236
description: Reddy describes if the Harvester Cluster can be considered
235-
ready for machine creation
237+
ready for machine creation.
236238
type: boolean
237239
required:
238240
- ready

config/crd/bases/infrastructure.cluster.x-k8s.io_harvestermachines.yaml

+19-15
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
- name: v1alpha1
1919
schema:
2020
openAPIV3Schema:
21-
description: HarvesterMachine is the Schema for the harvestermachines API
21+
description: HarvesterMachine is the Schema for the harvestermachines API.
2222
properties:
2323
apiVersion:
2424
description: 'APIVersion defines the versioned schema of this representation
@@ -33,7 +33,7 @@ spec:
3333
metadata:
3434
type: object
3535
spec:
36-
description: HarvesterMachineSpec defines the desired state of HarvesterMachine
36+
description: HarvesterMachineSpec defines the desired state of HarvesterMachine.
3737
properties:
3838
cpu:
3939
description: CPU is the number of CPU to assign to the VM.
@@ -44,11 +44,12 @@ spec:
4444
type: string
4545
memory:
4646
description: Memory is the memory size to assign to the VM (should
47-
be similar to pod.spec.containers.resources.limits)
47+
be similar to pod.spec.containers.resources.limits).
4848
type: string
4949
networks:
50-
description: Networks is a list of Networks to attach to the VM. Networks
51-
are referenced by their names.
50+
description: Networks is a list of Networks to attach to the VM. Each
51+
item in the list can have the format "namespace/name" or just "name"
52+
if the object is in the same namespace as the HarvesterMachine.
5253
items:
5354
type: string
5455
type: array
@@ -250,13 +251,15 @@ spec:
250251
x-kubernetes-map-type: atomic
251252
type: object
252253
providerID:
253-
description: ProviderID will be the ID of the machine used by the
254-
controller. This will be "<harvester vm namespace>-<harvester vm
255-
name>"
254+
description: ProviderID will be the ID of the VM in the provider (Harvester).
255+
This is set by the Cloud provider on the Workload cluster node and
256+
replicated by CAPI.
256257
type: string
257258
sshKeyPair:
258259
description: SSHKeyPair is the name of the SSH key pair to use for
259-
SSH access to the VM (this keyPair should be created in Harvester)
260+
SSH access to the VM (this keyPair should be created in Harvester).
261+
The reference can be in the format "namespace/name" or just "name"
262+
if the object is in the same namespace as the HarvesterMachine.
260263
type: string
261264
sshUser:
262265
description: SSHUser is the user that should be used to connect to
@@ -268,12 +271,15 @@ spec:
268271
properties:
269272
bootOrder:
270273
description: BootOrder is an integer that determines the order
271-
of priority of volumes for booting the VM If absent, the sequence
272-
with which volumes appear in the manifest will be used.
274+
of priority of volumes for booting the VM. If absent, the
275+
sequence with which volumes appear in the manifest will be
276+
used.
273277
type: integer
274278
imageName:
275279
description: ImageName is the name of the image to use if the
276-
volumeType is "image"
280+
volumeType is "image" ImageName can be in the format "namespace/name"
281+
or just "name" if the object is in the same namespace as the
282+
HarvesterMachine.
277283
type: string
278284
storageClass:
279285
description: StorageClass is the name of the storage class to
@@ -598,7 +604,7 @@ spec:
598604
- volumes
599605
type: object
600606
status:
601-
description: HarvesterMachineStatus defines the observed state of HarvesterMachine
607+
description: HarvesterMachineStatus defines the observed state of HarvesterMachine.
602608
properties:
603609
addresses:
604610
items:
@@ -668,8 +674,6 @@ spec:
668674
ready:
669675
description: Ready is true when the provider resource is ready.
670676
type: boolean
671-
required:
672-
- ready
673677
type: object
674678
type: object
675679
served: true

config/crd/bases/infrastructure.cluster.x-k8s.io_harvestermachinetemplates.yaml

+16-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
schema:
2020
openAPIV3Schema:
2121
description: HarvesterMachineTemplate is the Schema for the harvestermachinetemplates
22-
API
22+
API.
2323
properties:
2424
apiVersion:
2525
description: 'APIVersion defines the versioned schema of this representation
@@ -35,7 +35,7 @@ spec:
3535
type: object
3636
spec:
3737
description: HarvesterMachineTemplateSpec defines the desired state of
38-
HarvesterMachineTemplate
38+
HarvesterMachineTemplate.
3939
properties:
4040
template:
4141
description: Template is the HarvesterMachineTemplate template
@@ -53,11 +53,13 @@ spec:
5353
type: string
5454
memory:
5555
description: Memory is the memory size to assign to the VM
56-
(should be similar to pod.spec.containers.resources.limits)
56+
(should be similar to pod.spec.containers.resources.limits).
5757
type: string
5858
networks:
5959
description: Networks is a list of Networks to attach to the
60-
VM. Networks are referenced by their names.
60+
VM. Each item in the list can have the format "namespace/name"
61+
or just "name" if the object is in the same namespace as
62+
the HarvesterMachine.
6163
items:
6264
type: string
6365
type: array
@@ -279,14 +281,16 @@ spec:
279281
x-kubernetes-map-type: atomic
280282
type: object
281283
providerID:
282-
description: ProviderID will be the ID of the machine used
283-
by the controller. This will be "<harvester vm namespace>-<harvester
284-
vm name>"
284+
description: ProviderID will be the ID of the VM in the provider
285+
(Harvester). This is set by the Cloud provider on the Workload
286+
cluster node and replicated by CAPI.
285287
type: string
286288
sshKeyPair:
287289
description: SSHKeyPair is the name of the SSH key pair to
288290
use for SSH access to the VM (this keyPair should be created
289-
in Harvester)
291+
in Harvester). The reference can be in the format "namespace/name"
292+
or just "name" if the object is in the same namespace as
293+
the HarvesterMachine.
290294
type: string
291295
sshUser:
292296
description: SSHUser is the user that should be used to connect
@@ -299,13 +303,15 @@ spec:
299303
properties:
300304
bootOrder:
301305
description: BootOrder is an integer that determines
302-
the order of priority of volumes for booting the VM
306+
the order of priority of volumes for booting the VM.
303307
If absent, the sequence with which volumes appear
304308
in the manifest will be used.
305309
type: integer
306310
imageName:
307311
description: ImageName is the name of the image to use
308-
if the volumeType is "image"
312+
if the volumeType is "image" ImageName can be in the
313+
format "namespace/name" or just "name" if the object
314+
is in the same namespace as the HarvesterMachine.
309315
type: string
310316
storageClass:
311317
description: StorageClass is the name of the storage

0 commit comments

Comments
 (0)