Skip to content

Commit

Permalink
Introduce NetworkBinding to HCO CRD
Browse files Browse the repository at this point in the history
The next commit will propogate the binding configured in the HCO
to the kubevirt CR.

Signed-off-by: Alona Paz <[email protected]>
  • Loading branch information
AlonaKaplan committed Nov 12, 2023
1 parent 89f636b commit 4c519f8
Show file tree
Hide file tree
Showing 12 changed files with 144 additions and 2 deletions.
5 changes: 5 additions & 0 deletions api/v1beta1/hyperconverged_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ type HyperConvergedSpec struct {
// the enabling the KSM in the nodes (if available).
// +optional
KSMConfiguration *v1.KSMConfiguration `json:"ksmConfiguration,omitempty"`

// NetworkBinding defines the network binding plugins.
// Those bindings can be used when defining virtual machine interfaces.
// +optional
NetworkBinding map[string]v1.InterfaceBindingPlugin `json:"networkBinding,omitempty"`
}

// CertRotateConfigCA contains the tunables for TLS certificates.
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion api/v1beta1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions config/crd/bases/hco.kubevirt.io_hyperconvergeds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2361,6 +2361,23 @@ spec:
or mediatedDevicesTypes(deprecated) is required
rule: (has(self.mediatedDeviceTypes) && size(self.mediatedDeviceTypes)>0)
|| (has(self.mediatedDevicesTypes) && size(self.mediatedDevicesTypes)>0)
networkBinding:
additionalProperties:
properties:
networkAttachmentDefinition:
description: 'NetworkAttachmentDefinition references to a NetworkAttachmentDefinition
CR object. Format: <name>, <namespace>/<name>. If namespace
is not specified, VMI namespace is assumed. version: 1alphav1'
type: string
sidecarImage:
description: 'SidecarImage references a container image that
runs in the virt-launcher pod. The sidecar handles (libvirt)
domain configuration and optional services. version: 1alphav1'
type: string
type: object
description: NetworkBinding defines the network binding plugins. Those
bindings can be used when defining virtual machine interfaces.
type: object
obsoleteCPUs:
description: ObsoleteCPUs allows avoiding scheduling of VMs for obsolete
CPU models
Expand Down
17 changes: 17 additions & 0 deletions deploy/crds/hco00.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2361,6 +2361,23 @@ spec:
or mediatedDevicesTypes(deprecated) is required
rule: (has(self.mediatedDeviceTypes) && size(self.mediatedDeviceTypes)>0)
|| (has(self.mediatedDevicesTypes) && size(self.mediatedDevicesTypes)>0)
networkBinding:
additionalProperties:
properties:
networkAttachmentDefinition:
description: 'NetworkAttachmentDefinition references to a NetworkAttachmentDefinition
CR object. Format: <name>, <namespace>/<name>. If namespace
is not specified, VMI namespace is assumed. version: 1alphav1'
type: string
sidecarImage:
description: 'SidecarImage references a container image that
runs in the virt-launcher pod. The sidecar handles (libvirt)
domain configuration and optional services. version: 1alphav1'
type: string
type: object
description: NetworkBinding defines the network binding plugins. Those
bindings can be used when defining virtual machine interfaces.
type: object
obsoleteCPUs:
description: ObsoleteCPUs allows avoiding scheduling of VMs for obsolete
CPU models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2361,6 +2361,23 @@ spec:
or mediatedDevicesTypes(deprecated) is required
rule: (has(self.mediatedDeviceTypes) && size(self.mediatedDeviceTypes)>0)
|| (has(self.mediatedDevicesTypes) && size(self.mediatedDevicesTypes)>0)
networkBinding:
additionalProperties:
properties:
networkAttachmentDefinition:
description: 'NetworkAttachmentDefinition references to a NetworkAttachmentDefinition
CR object. Format: <name>, <namespace>/<name>. If namespace
is not specified, VMI namespace is assumed. version: 1alphav1'
type: string
sidecarImage:
description: 'SidecarImage references a container image that
runs in the virt-launcher pod. The sidecar handles (libvirt)
domain configuration and optional services. version: 1alphav1'
type: string
type: object
description: NetworkBinding defines the network binding plugins. Those
bindings can be used when defining virtual machine interfaces.
type: object
obsoleteCPUs:
description: ObsoleteCPUs allows avoiding scheduling of VMs for obsolete
CPU models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2361,6 +2361,23 @@ spec:
or mediatedDevicesTypes(deprecated) is required
rule: (has(self.mediatedDeviceTypes) && size(self.mediatedDeviceTypes)>0)
|| (has(self.mediatedDevicesTypes) && size(self.mediatedDevicesTypes)>0)
networkBinding:
additionalProperties:
properties:
networkAttachmentDefinition:
description: 'NetworkAttachmentDefinition references to a NetworkAttachmentDefinition
CR object. Format: <name>, <namespace>/<name>. If namespace
is not specified, VMI namespace is assumed. version: 1alphav1'
type: string
sidecarImage:
description: 'SidecarImage references a container image that
runs in the virt-launcher pod. The sidecar handles (libvirt)
domain configuration and optional services. version: 1alphav1'
type: string
type: object
description: NetworkBinding defines the network binding plugins. Those
bindings can be used when defining virtual machine interfaces.
type: object
obsoleteCPUs:
description: ObsoleteCPUs allows avoiding scheduling of VMs for obsolete
CPU models
Expand Down
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ HyperConvergedSpec defines the desired state of HyperConverged
| virtualMachineOptions | VirtualMachineOptions holds the cluster level information regarding the virtual machine. | *[VirtualMachineOptions](#virtualmachineoptions) | | false |
| commonBootImageNamespace | CommonBootImageNamespace override the default namespace of the common boot images, in order to hide them.\n\nIf not set, HCO won't set any namespace, letting SSP to use the default. If set, use the namespace to create the DataImportCronTemplates and the common image streams, with this namespace. This field is not set by default. | *string | | false |
| ksmConfiguration | KSMConfiguration holds the information regarding the enabling the KSM in the nodes (if available). | *v1.KSMConfiguration | | false |
| networkBinding | NetworkBinding defines the network binding plugins. Those bindings can be used when defining virtual machine interfaces. | map[string]v1.InterfaceBindingPlugin | | false |

[Back to TOC](#table-of-contents)

Expand Down
19 changes: 19 additions & 0 deletions docs/cluster-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,25 @@ spec:
kubeSecondaryDNSNameServerIP: "127.0.0.1"
```

## Network Binding plugin
In order to set NetworkBinding, set it on HyperConverged CR under spec.networkBinding field.
Default: empty map (no binding plugins).

### Network Binding plugin example
```yaml
apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
name: kubevirt-hyperconverged
spec:
networkBinding:
custom-binding1:
sidecarImage: quay.io/custom-binding1-image
custom-binding2:
sidecarImage: quay.io/custom-binding2-image
networkAttachmentDefinition: customBinding2Nad
```

## Modify common golden images
Golden images are root disk images for commonly used operating systems. HCO provides several common images, but it is possible to modify them, if needed.

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c519f8

Please sign in to comment.