Skip to content
Merged
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
133 changes: 133 additions & 0 deletions data/data/install.openshift.io_installconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,35 @@ spec:
description: Libvirt is the configuration used when installing
on libvirt.
type: object
nutanix:
description: Nutanix is the configuration used when installing
on Nutanix.
properties:
coresPerSocket:
description: NumCoresPerSocket is the number of cores per
socket in a vm. The number of vCPUs on the vm will be
NumCPUs/NumCoresPerSocket.
format: int64
type: integer
cpus:
description: NumCPUs is the total number of virtual processor
cores to assign a vm.
format: int64
type: integer
memoryMiB:
description: Memory is the size of a VM's memory in MiB.
format: int64
type: integer
osDisk:
description: OSDisk defines the storage for instance.
properties:
diskSizeMiB:
description: DiskSizeMiB defines the size of disk in
MiB.
format: int64
type: integer
type: object
type: object
openstack:
description: OpenStack is the configuration used when installing
on OpenStack.
Expand Down Expand Up @@ -888,6 +917,33 @@ spec:
description: Libvirt is the configuration used when installing
on libvirt.
type: object
nutanix:
description: Nutanix is the configuration used when installing
on Nutanix.
properties:
coresPerSocket:
description: NumCoresPerSocket is the number of cores per
socket in a vm. The number of vCPUs on the vm will be NumCPUs/NumCoresPerSocket.
format: int64
type: integer
cpus:
description: NumCPUs is the total number of virtual processor
cores to assign a vm.
format: int64
type: integer
memoryMiB:
description: Memory is the size of a VM's memory in MiB.
format: int64
type: integer
osDisk:
description: OSDisk defines the storage for instance.
properties:
diskSizeMiB:
description: DiskSizeMiB defines the size of disk in MiB.
format: int64
type: integer
type: object
type: object
openstack:
description: OpenStack is the configuration used when installing
on OpenStack.
Expand Down Expand Up @@ -2019,6 +2075,83 @@ spec:
description: None is the empty configuration used when installing
on an unsupported platform.
type: object
nutanix:
description: Nutanix is the configuration used when installing on
Nutanix.
properties:
apiVIP:
description: APIVIP is the virtual IP address for the api endpoint
type: string
clusterOSImage:
description: ClusterOSImage overrides the url provided in rhcos.json
to download the RHCOS Image
type: string
defaultMachinePlatform:
description: DefaultMachinePlatform is the default configuration
used when installing on Nutanix for machine pools which do not
define their own platform configuration.
properties:
coresPerSocket:
description: NumCoresPerSocket is the number of cores per
socket in a vm. The number of vCPUs on the vm will be NumCPUs/NumCoresPerSocket.
format: int64
type: integer
cpus:
description: NumCPUs is the total number of virtual processor
cores to assign a vm.
format: int64
type: integer
memoryMiB:
description: Memory is the size of a VM's memory in MiB.
format: int64
type: integer
osDisk:
description: OSDisk defines the storage for instance.
properties:
diskSizeMiB:
description: DiskSizeMiB defines the size of disk in MiB.
format: int64
type: integer
type: object
type: object
defaultStorageContainer:
description: DefaultStorageContainer is the default datastore
to use for provisioning volumes.
type: string
ingressVIP:
description: IngressVIP is the virtual IP address for ingress
type: string
password:
description: Password is the password for the user to use to connect
to the Prism Central.
type: string
port:
description: Port is the port to use to connect to the Prism Central.
type: string
prismCentral:
description: PrismCentral is the domain name or IP address of
the Prism Central.
type: string
prismElementUUID:
description: PrismElementUUID is the UUID of the Prism Element
cluster to use in the Prism Central.
type: string
subnetUUID:
description: SubnetUUID specifies the UUID of the subnet to be
used by the cluster.
type: string
username:
description: Username is the name of the user to use to connect
to the Prism Central.
type: string
required:
- defaultStorageContainer
- password
- port
- prismCentral
- prismElementUUID
- username
type: object
openstack:
description: OpenStack is the configuration used when installing on
OpenStack.
Expand Down
3 changes: 3 additions & 0 deletions pkg/explain/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ func Test_PrintFields(t *testing.T) {
none <object>
None is the empty configuration used when installing on an unsupported platform.

nutanix <object>
Nutanix is the configuration used when installing on Nutanix.

openstack <object>
OpenStack is the configuration used when installing on OpenStack.

Expand Down
5 changes: 5 additions & 0 deletions pkg/types/clustermetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/openshift/installer/pkg/types/gcp"
"github.com/openshift/installer/pkg/types/ibmcloud"
"github.com/openshift/installer/pkg/types/libvirt"
"github.com/openshift/installer/pkg/types/nutanix"
"github.com/openshift/installer/pkg/types/openstack"
"github.com/openshift/installer/pkg/types/ovirt"
"github.com/openshift/installer/pkg/types/powervs"
Expand Down Expand Up @@ -39,6 +40,7 @@ type ClusterPlatformMetadata struct {
Ovirt *ovirt.Metadata `json:"ovirt,omitempty"`
PowerVS *powervs.Metadata `json:"powervs,omitempty"`
VSphere *vsphere.Metadata `json:"vsphere,omitempty"`
Nutanix *nutanix.Metadata `json:"nutanix,omitempty"`
}

// Platform returns a string representation of the platform
Expand Down Expand Up @@ -81,5 +83,8 @@ func (cpm *ClusterPlatformMetadata) Platform() string {
if cpm.VSphere != nil {
return vsphere.Name
}
if cpm.Nutanix != nil {
return nutanix.Name
}
return ""
}
4 changes: 4 additions & 0 deletions pkg/types/defaults/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
ibmclouddefaults "github.com/openshift/installer/pkg/types/ibmcloud/defaults"
libvirtdefaults "github.com/openshift/installer/pkg/types/libvirt/defaults"
nonedefaults "github.com/openshift/installer/pkg/types/none/defaults"
nutanixdefaults "github.com/openshift/installer/pkg/types/nutanix/defaults"
openstackdefaults "github.com/openshift/installer/pkg/types/openstack/defaults"
ovirtdefaults "github.com/openshift/installer/pkg/types/ovirt/defaults"
powervsdefaults "github.com/openshift/installer/pkg/types/powervs/defaults"
Expand Down Expand Up @@ -110,5 +111,8 @@ func SetInstallConfigDefaults(c *types.InstallConfig) {
powervsdefaults.SetPlatformDefaults(c.Platform.PowerVS)
case c.Platform.None != nil:
nonedefaults.SetPlatformDefaults(c.Platform.None)
case c.Platform.Nutanix != nil:
nutanixdefaults.SetPlatformDefaults(c.Platform.Nutanix)
}

}
8 changes: 8 additions & 0 deletions pkg/types/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/openshift/installer/pkg/types/ibmcloud"
"github.com/openshift/installer/pkg/types/libvirt"
"github.com/openshift/installer/pkg/types/none"
"github.com/openshift/installer/pkg/types/nutanix"
"github.com/openshift/installer/pkg/types/openstack"
"github.com/openshift/installer/pkg/types/ovirt"
"github.com/openshift/installer/pkg/types/powervs"
Expand All @@ -40,6 +41,7 @@ var (
azure.Name,
gcp.Name,
ibmcloud.Name,
nutanix.Name,
openstack.Name,
ovirt.Name,
powervs.Name,
Expand Down Expand Up @@ -225,6 +227,10 @@ type Platform struct {
// Ovirt is the configuration used when installing on oVirt.
// +optional
Ovirt *ovirt.Platform `json:"ovirt,omitempty"`

// Nutanix is the configuration used when installing on Nutanix.
// +optional
Nutanix *nutanix.Platform `json:"nutanix,omitempty"`
}

// Name returns a string representation of the platform (e.g. "aws" if
Expand Down Expand Up @@ -258,6 +264,8 @@ func (p *Platform) Name() string {
return ovirt.Name
case p.PowerVS != nil:
return powervs.Name
case p.Nutanix != nil:
return nutanix.Name
default:
return ""
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/types/machinepools.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/openshift/installer/pkg/types/gcp"
"github.com/openshift/installer/pkg/types/ibmcloud"
"github.com/openshift/installer/pkg/types/libvirt"
"github.com/openshift/installer/pkg/types/nutanix"
"github.com/openshift/installer/pkg/types/openstack"
"github.com/openshift/installer/pkg/types/ovirt"
"github.com/openshift/installer/pkg/types/powervs"
Expand Down Expand Up @@ -104,6 +105,9 @@ type MachinePoolPlatform struct {

// PowerVS is the configuration used when installing on IBM Power VS.
PowerVS *powervs.MachinePool `json:"powervs,omitempty"`

// Nutanix is the configuration used when installing on Nutanix.
Nutanix *nutanix.MachinePool `json:"nutanix,omitempty"`
}

// Name returns a string representation of the platform (e.g. "aws" if
Expand Down Expand Up @@ -135,6 +139,8 @@ func (p *MachinePoolPlatform) Name() string {
return ovirt.Name
case p.PowerVS != nil:
return powervs.Name
case p.Nutanix != nil:
return nutanix.Name
default:
return ""
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/types/nutanix/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md
# This file just uses aliases defined in OWNERS_ALIASES.

approvers:
- nutanix-approvers
reviewers:
- nutanix-reviewers
8 changes: 8 additions & 0 deletions pkg/types/nutanix/defaults/platform.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package defaults

import (
"github.com/openshift/installer/pkg/types/nutanix"
)

// SetPlatformDefaults sets the defaults for the platform.
func SetPlatformDefaults(p *nutanix.Platform) {}
34 changes: 34 additions & 0 deletions pkg/types/nutanix/defaults/platform_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package defaults

import (
"testing"

"github.com/openshift/installer/pkg/types/nutanix"
"github.com/stretchr/testify/assert"
)

const testClusterName = "test-cluster"

func defaultPlatform() *nutanix.Platform {
return &nutanix.Platform{}
}

func TestSetPlatformDefaults(t *testing.T) {
cases := []struct {
name string
platform *nutanix.Platform
expected *nutanix.Platform
}{
{
name: "empty",
platform: &nutanix.Platform{},
expected: defaultPlatform(),
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
SetPlatformDefaults(tc.platform)
assert.Equal(t, tc.expected, tc.platform, "unexpected platform")
})
}
}
6 changes: 6 additions & 0 deletions pkg/types/nutanix/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Package nutanix contains Nutanix-specific structures for installer
// configuration and management.
package nutanix

// Name is the platform in the package
const Name = "nutanix"
57 changes: 57 additions & 0 deletions pkg/types/nutanix/machinepool.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package nutanix

// MachinePool stores the configuration for a machine pool installed
// on Nutanix.
type MachinePool struct {
// NumCPUs is the total number of virtual processor cores to assign a vm.
//
// +optional
NumCPUs int64 `json:"cpus,omitempty"`

// NumCoresPerSocket is the number of cores per socket in a vm. The number
// of vCPUs on the vm will be NumCPUs/NumCoresPerSocket.
//
// +optional
NumCoresPerSocket int64 `json:"coresPerSocket,omitempty"`

// Memory is the size of a VM's memory in MiB.
//
// +optional
MemoryMiB int64 `json:"memoryMiB,omitempty"`

// OSDisk defines the storage for instance.
//
// +optional
OSDisk `json:"osDisk,omitempty"`
}

// OSDisk defines the disk for a virtual machine.
type OSDisk struct {
// DiskSizeMiB defines the size of disk in MiB.
//
// +optional
DiskSizeMiB int64 `json:"diskSizeMiB,omitempty"`
}

// Set sets the values from `required` to `p`.
func (p *MachinePool) Set(required *MachinePool) {
if required == nil || p == nil {
return
}

if required.NumCPUs != 0 {
p.NumCPUs = required.NumCPUs
}

if required.NumCoresPerSocket != 0 {
p.NumCoresPerSocket = required.NumCoresPerSocket
}

if required.MemoryMiB != 0 {
p.MemoryMiB = required.MemoryMiB
}

if required.OSDisk.DiskSizeMiB != 0 {
p.OSDisk.DiskSizeMiB = required.OSDisk.DiskSizeMiB
}
}
13 changes: 13 additions & 0 deletions pkg/types/nutanix/metadata.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package nutanix

// Metadata contains Nutanix metadata (e.g. for uninstalling the cluster).
type Metadata struct {
// PrismCentral is the domain name or IP address of the Prism Central.
PrismCentral string `json:"prismCentral"`
// Username is the name of the user to use to connect to the Prism Central.
Username string `json:"username"`
// Password is the password for the user to use to connect to the Prism Central.
Password string `json:"password"`
// Port is the port used to connect to the Prism Central.
Port string `json:"port"`
}
Loading