Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add NetworkConfigurations, VMTemplate to FailureDomain #3049

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions apis/v1alpha3/topology_conversion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Copyright 2024 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 v1alpha3

import (
conversion "k8s.io/apimachinery/pkg/conversion"
v1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1"
)

func Convert_v1beta1_Topology_To_v1alpha3_Topology(in *v1beta1.Topology, out *Topology, s conversion.Scope) error {
return autoConvert_v1beta1_Topology_To_v1alpha3_Topology(in, out, s)
}
40 changes: 28 additions & 12 deletions apis/v1alpha3/zz_generated.conversion.go

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

26 changes: 26 additions & 0 deletions apis/v1alpha4/topology_conversion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Copyright 2024 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 (
conversion "k8s.io/apimachinery/pkg/conversion"
v1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1"
)

func Convert_v1beta1_Topology_To_v1alpha4_Topology(in *v1beta1.Topology, out *Topology, s conversion.Scope) error {
return autoConvert_v1beta1_Topology_To_v1alpha4_Topology(in, out, s)
}
40 changes: 28 additions & 12 deletions apis/v1alpha4/zz_generated.conversion.go

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

58 changes: 58 additions & 0 deletions apis/v1beta1/vspherefailuredomain_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -81,12 +82,69 @@ type Topology struct {
// +optional
Networks []string `json:"networks,omitempty"`

// NetworkConfigurations is a list of network configurations within this failure domain.
// +optional
// +listType=map
// +listMapKey=name
NetworkConfigurations []NetworkConfiguration `json:"networkConfigs,omitempty"`
Nutrymaco marked this conversation as resolved.
Show resolved Hide resolved

// Datastore is the name or inventory path of the datastore in which the
// virtual machine is created/located.
// +optional
Datastore string `json:"datastore,omitempty"`
}

// NetworkConfiguration defines a network configuration that should be used when consuming
// a failure domain.
type NetworkConfiguration struct {
// NetworkName is the network name for this machine's VM.
// +kubebuilder:validation:Required
NetworkName string `json:"name"`

// DHCP4 is a flag that indicates whether or not to use DHCP for IPv4.
// +optional
DHCP4 *bool `json:"dhcp4,omitempty"`

// DHCP6 is a flag that indicates whether or not to use DHCP for IPv6.
// +optional
DHCP6 *bool `json:"dhcp6,omitempty"`

// Nameservers is a list of IPv4 and/or IPv6 addresses used as DNS
// nameservers.
// Please note that Linux allows only three nameservers (https://linux.die.net/man/5/resolv.conf).
// +optional
Nameservers []string `json:"nameservers,omitempty"`

// SearchDomains is a list of search domains used when resolving IP
// addresses with DNS.
// +optional
SearchDomains []string `json:"searchDomains,omitempty"`

// DHCP4Overrides allows for the control over several DHCP behaviors.
// Overrides will only be applied when the corresponding DHCP flag is set.
// Only configured values will be sent, omitted values will default to
// distribution defaults.
// Dependent on support in the network stack for your distribution.
// For more information see the netplan reference (https://netplan.io/reference#dhcp-overrides)
// +optional
DHCP4Overrides *DHCPOverrides `json:"dhcp4Overrides,omitempty"`

// DHCP6Overrides allows for the control over several DHCP behaviors.
// Overrides will only be applied when the corresponding DHCP flag is set.
// Only configured values will be sent, omitted values will default to
// distribution defaults.
// Dependent on support in the network stack for your distribution.
// For more information see the netplan reference (https://netplan.io/reference#dhcp-overrides)
// +optional
DHCP6Overrides *DHCPOverrides `json:"dhcp6Overrides,omitempty"`

// AddressesFromPools is a list of IPAddressPools that should be assigned
// to IPAddressClaims. The machine's cloud-init metadata will be populated
// with IPAddresses fulfilled by an IPAM provider.
// +optional
AddressesFromPools []corev1.TypedLocalObjectReference `json:"addressesFromPools,omitempty"`
}

// FailureDomainHosts has information required for placement of machines on VSphere hosts.
type FailureDomainHosts struct {
// VMGroupName is the name of the VM group
Expand Down
59 changes: 59 additions & 0 deletions apis/v1beta1/zz_generated.deepcopy.go

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

Loading
Loading