diff --git a/api/v1alpha1/proxmoxcluster_types.go b/api/v1alpha1/proxmoxcluster_types.go index 62988d3a..b93c03f3 100644 --- a/api/v1alpha1/proxmoxcluster_types.go +++ b/api/v1alpha1/proxmoxcluster_types.go @@ -25,14 +25,14 @@ import ( ) const ( - // ProxmoxClusterKind the ProxmoxCluster kind. + // ProxmoxClusterKind is the ProxmoxCluster kind. ProxmoxClusterKind = "ProxmoxCluster" - // ClusterFinalizer allows cleaning up resources associated with + // ClusterFinalizer allows cleaning up resources associated with a // ProxmoxCluster before removing it from the apiserver. ClusterFinalizer = "proxmoxcluster.infrastructure.cluster.x-k8s.io" ) -// ProxmoxClusterSpec defines the desired state of ProxmoxCluster. +// ProxmoxClusterSpec defines the desired state of a ProxmoxCluster. type ProxmoxClusterSpec struct { // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. // +optional @@ -50,20 +50,20 @@ type ProxmoxClusterSpec struct { SchedulerHints *SchedulerHints `json:"schedulerHints,omitempty"` // IPv4Config contains information about available IPV4 address pools and the gateway. - // this can be combined with ipv6Config in order to enable dual stack. - // either IPv4Config or IPv6Config must be provided. + // This can be combined with ipv6Config in order to enable dual stack. + // Either IPv4Config or IPv6Config must be provided. // +optional // +kubebuilder:validation:XValidation:rule="self.addresses.size() > 0",message="IPv4Config addresses must be provided" IPv4Config *IPConfigSpec `json:"ipv4Config,omitempty"` // IPv6Config contains information about available IPV6 address pools and the gateway. - // this can be combined with ipv4Config in order to enable dual stack. - // either IPv4Config or IPv6Config must be provided. + // This can be combined with ipv4Config in order to enable dual stack. + // Either IPv4Config or IPv6Config must be provided. // +optional // +kubebuilder:validation:XValidation:rule="self.addresses.size() > 0",message="IPv6Config addresses must be provided" IPv6Config *IPConfigSpec `json:"ipv6Config,omitempty"` - // DNSServers contains information about nameservers used by machines network-config. + // DNSServers contains information about nameservers used by machines' network config. // +kubebuilder:validation:MinItems=1 DNSServers []string `json:"dnsServers"` } @@ -105,14 +105,14 @@ func (sh *SchedulerHints) GetMemoryAdjustment() uint64 { return memoryAdjustment } -// ProxmoxClusterStatus defines the observed state of ProxmoxCluster. +// ProxmoxClusterStatus defines the observed state of a ProxmoxCluster. type ProxmoxClusterStatus struct { // Ready indicates that the cluster is ready. // +optional // +kubebuilder:default=false Ready bool `json:"ready"` - // InClusterIPPoolRef is the reference to the created in cluster ip pool + // InClusterIPPoolRef is the reference to the created in-cluster IP pool. // +optional InClusterIPPoolRef []corev1.LocalObjectReference `json:"inClusterIpPoolRef,omitempty"` @@ -129,11 +129,11 @@ type ProxmoxClusterStatus struct { // NodeLocations holds information about the deployment state of // control plane and worker nodes in Proxmox. type NodeLocations struct { - // ControlPlane contains all deployed control plane nodes + // ControlPlane contains all deployed control plane nodes. // +optional ControlPlane []NodeLocation `json:"controlPlane,omitempty"` - // Workers contains all deployed worker nodes + // Workers contains all deployed worker nodes. // +optional Workers []NodeLocation `json:"workers,omitempty"` } @@ -141,10 +141,10 @@ type NodeLocations struct { // NodeLocation holds information about a single VM // in Proxmox. type NodeLocation struct { - // Machine is the reference of the proxmoxmachine + // Machine is the reference to the ProxmoxMachine. Machine corev1.LocalObjectReference `json:"machine"` - // Node is the Proxmox node + // Node is the Proxmox node. Node string `json:"node"` } @@ -210,7 +210,7 @@ func (c *ProxmoxCluster) SetInClusterIPPoolRef(pool client.Object) { } // AddNodeLocation will add a node location to either the control plane or worker -// node locations based on the `isControlPlane` parameter. +// node locations based on the isControlPlane parameter. func (c *ProxmoxCluster) AddNodeLocation(loc NodeLocation, isControlPlane bool) { if c.Status.NodeLocations == nil { c.Status.NodeLocations = new(NodeLocations) diff --git a/api/v1alpha1/proxmoxmachine_types.go b/api/v1alpha1/proxmoxmachine_types.go index 222362b5..b8012901 100644 --- a/api/v1alpha1/proxmoxmachine_types.go +++ b/api/v1alpha1/proxmoxmachine_types.go @@ -30,7 +30,7 @@ const ( // ProxmoxMachineKind is the ProxmoxMachine kind. ProxmoxMachineKind = "ProxmoxMachine" - // MachineFinalizer allows cleaning up resources associated with + // MachineFinalizer allows cleaning up resources associated with a // ProxmoxMachine before removing it from the API Server. MachineFinalizer = "proxmoxmachine.infrastructure.cluster.x-k8s.io" @@ -50,7 +50,7 @@ const ( IPV6Format = "v6" ) -// ProxmoxMachineSpec defines the desired state of ProxmoxMachine. +// ProxmoxMachineSpec defines the desired state of a ProxmoxMachine. type ProxmoxMachineSpec struct { VirtualMachineCloneSpec `json:",inline"` @@ -59,7 +59,7 @@ type ProxmoxMachineSpec struct { // +optional ProviderID *string `json:"providerID,omitempty"` - // VirtualMachineID is the Proxmox identifier for the ProxmoxMachine vm. + // VirtualMachineID is the Proxmox identifier for the ProxmoxMachine VM. // +optional VirtualMachineID *int64 `json:"virtualMachineID,omitempty"` @@ -249,7 +249,7 @@ type RouteSpec struct { Table uint32 `json:"table,omitempty"` } -// RoutingPolicySpec is a linux FIB rule. +// RoutingPolicySpec is a Linux FIB rule. type RoutingPolicySpec struct { // To is the subnet of the target. // +optional @@ -259,11 +259,11 @@ type RoutingPolicySpec struct { // +optional From string `json:"from,omitempty"` - // Table is the routing table id. + // Table is the routing table ID. // +optional Table uint32 `json:"table,omitempty"` - // Priority is the position in the ip rule fib table. + // Priority is the position in the ip rule FIB table. // +kubebuilder:validation:Maximum=4294967295 // +kubebuilder:validation:XValidation:message="Cowardly refusing to insert fib rule matching kernel rules",rule="(self > 0 && self < 32765) || (self > 32766)" // +optional @@ -276,7 +276,7 @@ type VRFDevice struct { Interfaces []string `json:"interfaces,omitempty"` // Name is the virtual network device name. - // must be unique within the virtual machine. + // Must be unique within the virtual machine. // +kubebuilder:validation:MinLength=3 Name string `json:"name"` @@ -294,15 +294,15 @@ type VRFDevice struct { // +kubebuilder:validation:MinItems=1 Routes []RouteSpec `json:"routes,omitempty"` - // RoutingPolicy is the l3mdev policy inserted into FiB. + // RoutingPolicy is the l3mdev policy inserted into FIB. // +optional // +kubebuilder:validation:MinItems=1 RoutingPolicy []RoutingPolicySpec `json:"routingPolicy,omitempty"` } -// VirtualNetworkDevices defines linux software networking devices. +// VirtualNetworkDevices defines Linux software networking devices. type VirtualNetworkDevices struct { - // Definition of a Vrf Device. + // Definition of a VRF Device. // +optional // +listType=map // +listMapKey=name @@ -342,7 +342,7 @@ type AdditionalNetworkDevice struct { NetworkDevice `json:",inline"` // Name is the network device name. - // must be unique within the virtual machine and different from the primary device 'net0'. + // Must be unique within the virtual machine and different from the primary device 'net0'. // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:XValidation:rule="self != 'net0'",message="additional network devices doesn't allow net0" Name string `json:"name"` @@ -370,7 +370,7 @@ type AdditionalNetworkDevice struct { DNSServers []string `json:"dnsServers,omitempty"` } -// ProxmoxMachineStatus defines the observed state of ProxmoxMachine. +// ProxmoxMachineStatus defines the observed state of a ProxmoxMachine. type ProxmoxMachineStatus struct { // Ready indicates the Docker infrastructure has been provisioned and is ready. // +optional @@ -457,11 +457,11 @@ type ProxmoxMachineStatus struct { // IPAddress defines the IP addresses of a network interface. type IPAddress struct { - // IPV4 is the IP v4 address. + // IPV4 is the IPv4 address. // +optional IPV4 string `json:"ipv4,omitempty"` - // IPV6 is the IP v6 address. + // IPV6 is the IPv6 address. // +optional IPV6 string `json:"ipv6,omitempty"` } diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxclusters.yaml index 45d09b39..c5b04f26 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxclusters.yaml @@ -48,7 +48,7 @@ spec: metadata: type: object spec: - description: ProxmoxClusterSpec defines the desired state of ProxmoxCluster. + description: ProxmoxClusterSpec defines the desired state of a ProxmoxCluster. properties: allowedNodes: description: AllowedNodes specifies all Proxmox nodes which will be @@ -74,15 +74,15 @@ spec: type: object dnsServers: description: DNSServers contains information about nameservers used - by machines network-config. + by machines' network config. items: type: string minItems: 1 type: array ipv4Config: description: IPv4Config contains information about available IPV4 - address pools and the gateway. this can be combined with ipv6Config - in order to enable dual stack. either IPv4Config or IPv6Config must + address pools and the gateway. This can be combined with ipv6Config + in order to enable dual stack. Either IPv4Config or IPv6Config must be provided. properties: addresses: @@ -107,8 +107,8 @@ spec: rule: self.addresses.size() > 0 ipv6Config: description: IPv6Config contains information about available IPV6 - address pools and the gateway. this can be combined with ipv4Config - in order to enable dual stack. either IPv4Config or IPv6Config must + address pools and the gateway. This can be combined with ipv4Config + in order to enable dual stack. Either IPv4Config or IPv6Config must be provided. properties: addresses: @@ -154,7 +154,7 @@ spec: - message: at least one ip config must be set, either ipv4Config or ipv6Config rule: self.ipv4Config != null || self.ipv6Config != null status: - description: ProxmoxClusterStatus defines the observed state of ProxmoxCluster. + description: ProxmoxClusterStatus defines the observed state of a ProxmoxCluster. properties: conditions: description: Conditions defines current service state of the ProxmoxCluster. @@ -202,8 +202,8 @@ spec: type: object type: array inClusterIpPoolRef: - description: InClusterIPPoolRef is the reference to the created in - cluster ip pool + description: InClusterIPPoolRef is the reference to the created in-cluster + IP pool. items: description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. @@ -221,13 +221,13 @@ spec: properties: controlPlane: description: ControlPlane contains all deployed control plane - nodes + nodes. items: description: NodeLocation holds information about a single VM in Proxmox. properties: machine: - description: Machine is the reference of the proxmoxmachine + description: Machine is the reference to the ProxmoxMachine. properties: name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names @@ -236,7 +236,7 @@ spec: type: object x-kubernetes-map-type: atomic node: - description: Node is the Proxmox node + description: Node is the Proxmox node. type: string required: - machine @@ -244,13 +244,13 @@ spec: type: object type: array workers: - description: Workers contains all deployed worker nodes + description: Workers contains all deployed worker nodes. items: description: NodeLocation holds information about a single VM in Proxmox. properties: machine: - description: Machine is the reference of the proxmoxmachine + description: Machine is the reference to the ProxmoxMachine. properties: name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names @@ -259,7 +259,7 @@ spec: type: object x-kubernetes-map-type: atomic node: - description: Node is the Proxmox node + description: Node is the Proxmox node. type: string required: - machine diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachines.yaml index a3198b03..6420c5cf 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachines.yaml @@ -59,7 +59,7 @@ spec: metadata: type: object spec: - description: ProxmoxMachineSpec defines the desired state of ProxmoxMachine. + description: ProxmoxMachineSpec defines the desired state of a ProxmoxMachine. properties: description: description: Description for the new VM. @@ -213,7 +213,7 @@ spec: minimum: 1 type: integer name: - description: Name is the network device name. must be unique + description: Name is the network device name. Must be unique within the virtual machine and different from the primary device 'net0'. minLength: 1 @@ -273,7 +273,7 @@ spec: - bridge type: object vrfs: - description: Definition of a Vrf Device. + description: Definition of a VRF Device. items: description: VRFDevice defines Virtual Routing Flow devices. properties: @@ -352,7 +352,7 @@ spec: GlobalInClusterIPPool rule: self.kind == 'InClusterIPPool' || self.kind == 'GlobalInClusterIPPool' name: - description: Name is the virtual network device name. must + description: Name is the virtual network device name. Must be unique within the virtual machine. minLength: 3 type: string @@ -383,16 +383,16 @@ spec: type: array routingPolicy: description: RoutingPolicy is the l3mdev policy inserted - into FiB. + into FIB. items: - description: RoutingPolicySpec is a linux FIB rule. + description: RoutingPolicySpec is a Linux FIB rule. properties: from: description: From is the subnet of the source. type: string priority: description: Priority is the position in the ip rule - fib table. + FIB table. format: int32 maximum: 4294967295 type: integer @@ -401,7 +401,7 @@ spec: kernel rules rule: (self > 0 && self < 32765) || (self > 32766) table: - description: Table is the routing table id. + description: Table is the routing table ID. format: int32 type: integer to: @@ -479,7 +479,7 @@ spec: type: integer virtualMachineID: description: VirtualMachineID is the Proxmox identifier for the ProxmoxMachine - vm. + VM. format: int64 type: integer required: @@ -489,7 +489,7 @@ spec: - message: Must set full=true when specifying format rule: self.full && self.format != '' status: - description: ProxmoxMachineStatus defines the observed state of ProxmoxMachine. + description: ProxmoxMachineStatus defines the observed state of a ProxmoxMachine. properties: addresses: description: Addresses contains the Proxmox VM instance associated @@ -595,10 +595,10 @@ spec: description: IPAddress defines the IP addresses of a network interface. properties: ipv4: - description: IPV4 is the IP v4 address. + description: IPV4 is the IPv4 address. type: string ipv6: - description: IPV6 is the IP v6 address. + description: IPV6 is the IPv6 address. type: string type: object description: IPAddresses are the IP addresses used to access the virtual diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachinetemplates.yaml index 55ba572a..6b558213 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachinetemplates.yaml @@ -62,7 +62,8 @@ spec: type: object type: object spec: - description: ProxmoxMachineSpec defines the desired state of ProxmoxMachine. + description: ProxmoxMachineSpec defines the desired state of a + ProxmoxMachine. properties: description: description: Description for the new VM. @@ -231,7 +232,7 @@ spec: minimum: 1 type: integer name: - description: Name is the network device name. must + description: Name is the network device name. Must be unique within the virtual machine and different from the primary device 'net0'. minLength: 1 @@ -293,7 +294,7 @@ spec: - bridge type: object vrfs: - description: Definition of a Vrf Device. + description: Definition of a VRF Device. items: description: VRFDevice defines Virtual Routing Flow devices. @@ -385,7 +386,7 @@ spec: == 'GlobalInClusterIPPool' name: description: Name is the virtual network device - name. must be unique within the virtual machine. + name. Must be unique within the virtual machine. minLength: 3 type: string routes: @@ -416,9 +417,9 @@ spec: type: array routingPolicy: description: RoutingPolicy is the l3mdev policy - inserted into FiB. + inserted into FIB. items: - description: RoutingPolicySpec is a linux FIB + description: RoutingPolicySpec is a Linux FIB rule. properties: from: @@ -426,7 +427,7 @@ spec: type: string priority: description: Priority is the position in the - ip rule fib table. + ip rule FIB table. format: int32 maximum: 4294967295 type: integer @@ -436,7 +437,7 @@ spec: rule: (self > 0 && self < 32765) || (self > 32766) table: - description: Table is the routing table id. + description: Table is the routing table ID. format: int32 type: integer to: @@ -515,7 +516,7 @@ spec: type: integer virtualMachineID: description: VirtualMachineID is the Proxmox identifier for - the ProxmoxMachine vm. + the ProxmoxMachine VM. format: int64 type: integer required: