Skip to content

Commit

Permalink
Fixed a couple of issues during machine creation and LBPlaceholder ma…
Browse files Browse the repository at this point in the history
…nagement

Signed-off-by: Mohamed Belgaied Hassine <[email protected]>
  • Loading branch information
belgaied2 committed Jun 14, 2024
1 parent 7464158 commit 2b9eb08
Show file tree
Hide file tree
Showing 10 changed files with 530 additions and 120 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/harvestermachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ type VolumeType string
// HarvesterMachineStatus defines the observed state of HarvesterMachine.
type HarvesterMachineStatus struct {
// Ready is true when the provider resource is ready.
Ready bool `json:"ready"`
Ready bool `json:"ready,omitempty"`

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
description: HarvesterCluster is the Schema for the harvesterclusters API
description: HarvesterCluster is the Schema for the harvesterclusters API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -47,7 +47,7 @@ spec:
metadata:
type: object
spec:
description: HarvesterClusterSpec defines the desired state of HarvesterCluster
description: HarvesterClusterSpec defines the desired state of HarvesterCluster.
properties:
controlPlaneEndpoint:
description: ControlPlaneEndpoint represents the endpoint used to
Expand All @@ -69,11 +69,11 @@ spec:
file.
properties:
name:
description: Name is the name of the required Identity Secret
description: Name is the name of the required Identity Secret.
type: string
namespace:
description: Namespace is the namespace in which the required
Identity Secret should be found
Identity Secret should be found.
type: string
required:
- name
Expand All @@ -89,36 +89,38 @@ spec:
type: string
ipPool:
description: IpPool defines a new IpPool that will be added to
Harvester. This field is mutually exclusive with "IpPoolRef"
Harvester. This field is mutually exclusive with "IpPoolRef".
properties:
gateway:
description: Gateway is the IP Address that should be used
by the Gateway on the Subnet. It should be a valid address
inside the subnet e.g. 172.17.1.1
inside the subnet. e.g. 172.17.1.1.
type: string
subnet:
description: Subnet is a string describing the subnet that
should be used by the IP Pool, it should have the CIDR Format
of an IPv4 Address e.g. 172.17.1.0/24
of an IPv4 Address. e.g. 172.17.1.0/24.
type: string
vmNetwork:
description: VMNetwork is the name of an existing VM Network
in Harvester where the IPPool should exist.
in Harvester where the IPPool should exist. The reference
can have the format "namespace/name" or just "name" if the
object is in the same namespace as the HarvesterCluster.
type: string
required:
- gateway
- subnet
- vmNetwork
type: object
ipPoolRef:
description: IpPoolRef is a reference to an existing IpPool object
in Harvester's cluster in the same namespace. This field is
mutually exclusive with "ipPool"
description: 'IpPoolRef is a reference to an existing IpPool object
in Harvester''s cluster. This field is mutually exclusive with
"ipPool". TODO: To be implemented'
type: string
ipamType:
description: IPAMType is the configuration of IP addressing for
the control plane load balancer. This can take two values, either
"dhcp" or "ippool"
"dhcp" or "ippool".
enum:
- dhcp
- pool
Expand All @@ -128,25 +130,25 @@ spec:
on the load balancer.
items:
description: Listener is a description of a new Listener to
be created on the Load Balancer
be created on the Load Balancer.
properties:
backendPort:
description: TargetPort is the port that the listener should
forward traffic to
forward traffic to.
format: int32
type: integer
name:
description: Name is the name of the listener
description: Name is the name of the listener.
type: string
port:
description: Port is the port that the listener should listen
on
on.
format: int32
type: integer
protocol:
default: TCP
description: Protocol is the protocol that the listener
should use, either TCP or UDP
should use, either TCP or UDP.
enum:
- TCP
- UDP
Expand All @@ -166,15 +168,15 @@ spec:
type: string
targetNamespace:
description: TargetNamespace is the namespace on the Harvester cluster
where VMs, Load Balancers, etc. should be created
where VMs, Load Balancers, etc. should be created.
type: string
required:
- identitySecret
- loadBalancerConfig
- targetNamespace
type: object
status:
description: HarvesterClusterStatus defines the observed state of HarvesterCluster
description: HarvesterClusterStatus defines the observed state of HarvesterCluster.
properties:
conditions:
description: Conditions defines current service state of the Harvester
Expand Down Expand Up @@ -224,15 +226,15 @@ spec:
type: array
failureMessage:
description: FailureMessage is a full error message dump of the above
failureReason
failureReason.
type: string
failureReason:
description: FailureReason is the short name for the reason why a
failure might be happening that makes the cluster not ready
failure might be happening that makes the cluster not ready.
type: string
ready:
description: Reddy describes if the Harvester Cluster can be considered
ready for machine creation
ready for machine creation.
type: boolean
required:
- ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: HarvesterMachine is the Schema for the harvestermachines API
description: HarvesterMachine is the Schema for the harvestermachines API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -33,7 +33,7 @@ spec:
metadata:
type: object
spec:
description: HarvesterMachineSpec defines the desired state of HarvesterMachine
description: HarvesterMachineSpec defines the desired state of HarvesterMachine.
properties:
cpu:
description: CPU is the number of CPU to assign to the VM.
Expand All @@ -44,11 +44,12 @@ spec:
type: string
memory:
description: Memory is the memory size to assign to the VM (should
be similar to pod.spec.containers.resources.limits)
be similar to pod.spec.containers.resources.limits).
type: string
networks:
description: Networks is a list of Networks to attach to the VM. Networks
are referenced by their names.
description: Networks is a list of Networks to attach to the VM. Each
item in the list can have the format "namespace/name" or just "name"
if the object is in the same namespace as the HarvesterMachine.
items:
type: string
type: array
Expand Down Expand Up @@ -250,13 +251,15 @@ spec:
x-kubernetes-map-type: atomic
type: object
providerID:
description: ProviderID will be the ID of the machine used by the
controller. This will be "<harvester vm namespace>-<harvester vm
name>"
description: ProviderID will be the ID of the VM in the provider (Harvester).
This is set by the Cloud provider on the Workload cluster node and
replicated by CAPI.
type: string
sshKeyPair:
description: SSHKeyPair is the name of the SSH key pair to use for
SSH access to the VM (this keyPair should be created in Harvester)
SSH access to the VM (this keyPair should be created in Harvester).
The reference can be in the format "namespace/name" or just "name"
if the object is in the same namespace as the HarvesterMachine.
type: string
sshUser:
description: SSHUser is the user that should be used to connect to
Expand All @@ -268,12 +271,15 @@ spec:
properties:
bootOrder:
description: BootOrder is an integer that determines the order
of priority of volumes for booting the VM If absent, the sequence
with which volumes appear in the manifest will be used.
of priority of volumes for booting the VM. If absent, the
sequence with which volumes appear in the manifest will be
used.
type: integer
imageName:
description: ImageName is the name of the image to use if the
volumeType is "image"
volumeType is "image" ImageName can be in the format "namespace/name"
or just "name" if the object is in the same namespace as the
HarvesterMachine.
type: string
storageClass:
description: StorageClass is the name of the storage class to
Expand Down Expand Up @@ -598,7 +604,7 @@ spec:
- volumes
type: object
status:
description: HarvesterMachineStatus defines the observed state of HarvesterMachine
description: HarvesterMachineStatus defines the observed state of HarvesterMachine.
properties:
addresses:
items:
Expand Down Expand Up @@ -668,8 +674,6 @@ spec:
ready:
description: Ready is true when the provider resource is ready.
type: boolean
required:
- ready
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
schema:
openAPIV3Schema:
description: HarvesterMachineTemplate is the Schema for the harvestermachinetemplates
API
API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -35,7 +35,7 @@ spec:
type: object
spec:
description: HarvesterMachineTemplateSpec defines the desired state of
HarvesterMachineTemplate
HarvesterMachineTemplate.
properties:
template:
description: Template is the HarvesterMachineTemplate template
Expand All @@ -53,11 +53,13 @@ spec:
type: string
memory:
description: Memory is the memory size to assign to the VM
(should be similar to pod.spec.containers.resources.limits)
(should be similar to pod.spec.containers.resources.limits).
type: string
networks:
description: Networks is a list of Networks to attach to the
VM. Networks are referenced by their names.
VM. Each item in the list can have the format "namespace/name"
or just "name" if the object is in the same namespace as
the HarvesterMachine.
items:
type: string
type: array
Expand Down Expand Up @@ -279,14 +281,16 @@ spec:
x-kubernetes-map-type: atomic
type: object
providerID:
description: ProviderID will be the ID of the machine used
by the controller. This will be "<harvester vm namespace>-<harvester
vm name>"
description: ProviderID will be the ID of the VM in the provider
(Harvester). This is set by the Cloud provider on the Workload
cluster node and replicated by CAPI.
type: string
sshKeyPair:
description: SSHKeyPair is the name of the SSH key pair to
use for SSH access to the VM (this keyPair should be created
in Harvester)
in Harvester). The reference can be in the format "namespace/name"
or just "name" if the object is in the same namespace as
the HarvesterMachine.
type: string
sshUser:
description: SSHUser is the user that should be used to connect
Expand All @@ -299,13 +303,15 @@ spec:
properties:
bootOrder:
description: BootOrder is an integer that determines
the order of priority of volumes for booting the VM
the order of priority of volumes for booting the VM.
If absent, the sequence with which volumes appear
in the manifest will be used.
type: integer
imageName:
description: ImageName is the name of the image to use
if the volumeType is "image"
if the volumeType is "image" ImageName can be in the
format "namespace/name" or just "name" if the object
is in the same namespace as the HarvesterMachine.
type: string
storageClass:
description: StorageClass is the name of the storage
Expand Down
Loading

0 comments on commit 2b9eb08

Please sign in to comment.