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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ metadata:
name: vsphere-creds
{{- else if .CloudCreds.Ovirt}}
name: ovirt-credentials
{{- else if .CloudCreds.Nutanix}}
name: nutanix-credentials
{{- end}}
data:
{{- if .CloudCreds.AWS}}
Expand Down Expand Up @@ -45,4 +47,9 @@ data:
ovirt_password: {{.CloudCreds.Ovirt.Base64encodePassword}}
ovirt_insecure: {{.CloudCreds.Ovirt.Base64encodeInsecure}}
ovirt_ca_bundle: {{.CloudCreds.Ovirt.Base64encodeCABundle}}
{{- else if .CloudCreds.Nutanix}}
Comment thread
thunderboltsid marked this conversation as resolved.
NUTANIX_ENDPOINT: {{.CloudCreds.Nutanix.Base64encodeEndpoint}}
NUTANIX_PORT: {{.CloudCreds.Nutanix.Base64encodePort}}
NUTANIX_USER: {{.CloudCreds.Nutanix.Base64encodeUsername}}
NUTANIX_PASSWORD: {{.CloudCreds.Nutanix.Base64encodePassword}}
{{- end}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ metadata:
name: vsphere-creds-secret-reader
{{- else if .CloudCreds.Ovirt}}
name: ovirt-creds-secret-reader
{{- else if .CloudCreds.Nutanix}}
name: nutanix-creds-secret-reader
{{- end}}
rules:
- apiGroups: [""]
Expand All @@ -34,5 +36,7 @@ rules:
resourceNames: ["vsphere-creds"]
{{- else if .CloudCreds.Ovirt}}
resourceNames: ["ovirt-credentials"]
{{- else if .CloudCreds.Nutanix}}
resourceNames: ["nutanix-credentials"]
{{- end}}
verbs: ["get"]
3 changes: 2 additions & 1 deletion pkg/asset/manifests/cloudproviderconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud"
libvirttypes "github.com/openshift/installer/pkg/types/libvirt"
nonetypes "github.com/openshift/installer/pkg/types/none"
nutanixtypes "github.com/openshift/installer/pkg/types/nutanix"
openstacktypes "github.com/openshift/installer/pkg/types/openstack"
ovirttypes "github.com/openshift/installer/pkg/types/ovirt"
powervstypes "github.com/openshift/installer/pkg/types/powervs"
Expand Down Expand Up @@ -92,7 +93,7 @@ func (cpc *CloudProviderConfig) Generate(dependencies asset.Parents) error {
}

switch installConfig.Config.Platform.Name() {
case libvirttypes.Name, nonetypes.Name, baremetaltypes.Name, ovirttypes.Name:
case libvirttypes.Name, nonetypes.Name, baremetaltypes.Name, ovirttypes.Name, nutanixtypes.Name:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit surprised that there is not a cloud provider config. Is the name of the secret with the creds hard-coded somewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, yes. nutanix-credentials is the credential name.

return nil
case awstypes.Name:
// Store the additional trust bundle in the ca-bundle.pem key if the cluster is being installed on a C2S region.
Expand Down
3 changes: 2 additions & 1 deletion pkg/asset/manifests/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud"
libvirttypes "github.com/openshift/installer/pkg/types/libvirt"
nonetypes "github.com/openshift/installer/pkg/types/none"
nutanixtypes "github.com/openshift/installer/pkg/types/nutanix"
openstacktypes "github.com/openshift/installer/pkg/types/openstack"
ovirttypes "github.com/openshift/installer/pkg/types/ovirt"
powervstypes "github.com/openshift/installer/pkg/types/powervs"
Expand Down Expand Up @@ -159,7 +160,7 @@ func (d *DNS) Generate(dependencies asset.Parents) error {
config.Spec.PrivateZone = &configv1.DNSZone{
ID: zoneID,
}
case libvirttypes.Name, openstacktypes.Name, baremetaltypes.Name, nonetypes.Name, vspheretypes.Name, ovirttypes.Name:
case libvirttypes.Name, openstacktypes.Name, baremetaltypes.Name, nonetypes.Name, vspheretypes.Name, ovirttypes.Name, nutanixtypes.Name:
default:
return errors.New("invalid Platform")
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/asset/manifests/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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 Down Expand Up @@ -224,6 +225,14 @@ func (i *Infrastructure) Generate(dependencies asset.Parents) error {
Zone: installConfig.Config.Platform.PowerVS.Zone,
CISInstanceCRN: cisInstanceCRN,
}
case nutanix.Name:
config.Spec.PlatformSpec.Type = configv1.NutanixPlatformType
if installConfig.Config.Nutanix.APIVIP != "" {
config.Status.PlatformStatus.Nutanix = &configv1.NutanixPlatformStatus{
APIServerInternalIP: installConfig.Config.Nutanix.APIVIP,
IngressIP: installConfig.Config.Nutanix.IngressVIP,
}
}
default:
config.Spec.PlatformSpec.Type = configv1.NonePlatformType
}
Expand Down
12 changes: 11 additions & 1 deletion pkg/asset/manifests/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
baremetaltypes "github.com/openshift/installer/pkg/types/baremetal"
gcptypes "github.com/openshift/installer/pkg/types/gcp"
ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud"
nutanixtypes "github.com/openshift/installer/pkg/types/nutanix"
openstacktypes "github.com/openshift/installer/pkg/types/openstack"
ovirttypes "github.com/openshift/installer/pkg/types/ovirt"
vspheretypes "github.com/openshift/installer/pkg/types/vsphere"
Expand Down Expand Up @@ -211,6 +212,15 @@ func (o *Openshift) Generate(dependencies asset.Parents) error {
Base64encodeCABundle: base64.StdEncoding.EncodeToString([]byte(conf.CABundle)),
},
}
case nutanixtypes.Name:
cloudCreds = cloudCredsSecretData{
Nutanix: &NutanixCredsSecretData{
Base64encodeEndpoint: base64.StdEncoding.EncodeToString([]byte(installConfig.Config.Nutanix.PrismCentral)),
Base64encodePort: base64.StdEncoding.EncodeToString([]byte(installConfig.Config.Nutanix.Port)),
Base64encodeUsername: base64.StdEncoding.EncodeToString([]byte(installConfig.Config.Nutanix.Username)),
Base64encodePassword: base64.StdEncoding.EncodeToString([]byte(installConfig.Config.Nutanix.Password)),
},
}
}

templateData := &openshiftTemplateData{
Expand All @@ -236,7 +246,7 @@ func (o *Openshift) Generate(dependencies asset.Parents) error {
}

switch platform {
case awstypes.Name, openstacktypes.Name, vspheretypes.Name, azuretypes.Name, gcptypes.Name, ibmcloudtypes.Name, ovirttypes.Name:
case awstypes.Name, openstacktypes.Name, vspheretypes.Name, azuretypes.Name, gcptypes.Name, ibmcloudtypes.Name, ovirttypes.Name, nutanixtypes.Name:
if installConfig.Config.CredentialsMode != types.ManualCredentialsMode {
assetData["99_cloud-creds-secret.yaml"] = applyTemplateData(cloudCredsSecret.Files()[0].Data, templateData)
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/asset/manifests/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ type OvirtCredsSecretData struct {
Base64encodeCABundle string
}

// NutanixCredsSecretData holds encoded credentials and is used to generate cloud-creds secret
type NutanixCredsSecretData struct {
Base64encodeEndpoint string
Base64encodePort string
Base64encodeUsername string
Base64encodePassword string
}

type cloudCredsSecretData struct {
AWS *AwsCredsSecretData
Azure *AzureCredsSecretData
Expand All @@ -62,6 +70,7 @@ type cloudCredsSecretData struct {
OpenStack *OpenStackCredsSecretData
VSphere *VSphereCredsSecretData
Ovirt *OvirtCredsSecretData
Nutanix *NutanixCredsSecretData
}

type bootkubeTemplateData struct {
Expand Down