Skip to content

Commit 0324f33

Browse files
committed
PowerVC: Add new platform for PowerVC
PowerVC is an OpenStack based cloud provider with some significant differences. Since we can use the OpenStack provider for most of the work, we will create a thin provider which will only handle the differences.
1 parent 5b7289b commit 0324f33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1138
-31
lines changed

OWNERS_ALIASES

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ aliases:
3333
- mandre
3434
- pierreprinetti
3535
- stephenfin
36+
powervc-approvers:
37+
- hamzy
38+
- mjturek
39+
- prb112
40+
- Prashanth684
41+
powervc-reviewers:
42+
- hamzy
43+
- mjturek
44+
- prb112
45+
- Prashanth684
3646
powervs-approvers:
3747
- clnperez
3848
- mkumatag

cmd/openshift-install/destroy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
_ "github.com/openshift/installer/pkg/destroy/nutanix"
2626
_ "github.com/openshift/installer/pkg/destroy/openstack"
2727
_ "github.com/openshift/installer/pkg/destroy/ovirt"
28+
_ "github.com/openshift/installer/pkg/destroy/powervc"
2829
_ "github.com/openshift/installer/pkg/destroy/powervs"
2930
_ "github.com/openshift/installer/pkg/destroy/vsphere"
3031
)

data/data/install.openshift.io_installconfigs.yaml

Lines changed: 450 additions & 0 deletions
Large diffs are not rendered by default.

docs/user/openstack/powervc.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# PowerVC Platform Customization
2+
3+
PowerVC is based on OpenStack and shares many similarities. So some of the documents would be helpful here. However, there are major differences. Please see [this](../powervc/powervc.md) document for more information.

docs/user/powervc/powervc.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# PowerVC Platform Customization
2+
3+
Beyond the [platform-agnostic `install-config.yaml` properties](../customization.md#platform-customization), the installer supports additional, PowerVC-specific properties.
4+
5+
## Table of Contents
6+
7+
- [Example](#example)
8+
9+
## Example
10+
11+
An example `install-config.yaml` is shown below.
12+
13+
```yaml
14+
apiVersion: v1
15+
baseDomain: domain.net
16+
compute:
17+
- architecture: ppc64le
18+
hyperthreading: Enabled
19+
name: worker
20+
platform:
21+
powervc:
22+
zones:
23+
- s1022
24+
replicas: 3
25+
controlPlane:
26+
architecture: ppc64le
27+
hyperthreading: Enabled
28+
name: master
29+
platform:
30+
powervc:
31+
zones:
32+
- s1022
33+
replicas: 3
34+
metadata:
35+
name: rdr-openstack
36+
networking:
37+
clusterNetwork:
38+
- cidr: 10.116.0.0/14
39+
hostPrefix: 23
40+
machineNetwork:
41+
- cidr: 10.130.32.0/20
42+
networkType: OVNKubernetes
43+
serviceNetwork:
44+
- 172.30.0.0/16
45+
platform:
46+
powervc:
47+
loadBalancer:
48+
type: UserManaged
49+
apiVIPs:
50+
- 10.130.41.250
51+
cloud: cloud-name
52+
clusterOSImage: rhcos-9.6.20250826-1-openstack-ppc64le
53+
defaultMachinePlatform:
54+
type: flavor
55+
ingressVIPs:
56+
- 10.130.41.250
57+
controlPlanePort:
58+
fixedIPs:
59+
- subnet:
60+
id: deadbeef-0000-1111-2222-cafefade1234
61+
credentialsMode: Passthrough
62+
pullSecret: '{"auths": ...}'
63+
sshKey: ssh-ed25519 AAAA...
64+
```
65+
66+
`loadBalancer` can only be of type `UserManaged`. This means that the user must create a HAProxy server
67+
which acts as a load balancer. It must be updated during the cluster creation as new VMs are created. Both
68+
`apiVIPs` and `ingressVIPs` should be the same HAProxy server IP.
69+
70+
`clusterOSImage` is an image created in advance by the `powervc-image` tool. The source can only be a `ova.gz`
71+
72+
`credentialsMode` can only be `Passthrough`.

pkg/asset/cluster/metadata.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/openshift/installer/pkg/asset/cluster/nutanix"
1919
"github.com/openshift/installer/pkg/asset/cluster/openstack"
2020
"github.com/openshift/installer/pkg/asset/cluster/ovirt"
21+
"github.com/openshift/installer/pkg/asset/cluster/powervc"
2122
"github.com/openshift/installer/pkg/asset/cluster/powervs"
2223
"github.com/openshift/installer/pkg/asset/cluster/vsphere"
2324
"github.com/openshift/installer/pkg/asset/ignition/bootstrap"
@@ -34,6 +35,7 @@ import (
3435
nutanixtypes "github.com/openshift/installer/pkg/types/nutanix"
3536
openstacktypes "github.com/openshift/installer/pkg/types/openstack"
3637
ovirttypes "github.com/openshift/installer/pkg/types/ovirt"
38+
powervctypes "github.com/openshift/installer/pkg/types/powervc"
3739
powervstypes "github.com/openshift/installer/pkg/types/powervs"
3840
vspheretypes "github.com/openshift/installer/pkg/types/vsphere"
3941
)
@@ -97,6 +99,8 @@ func (m *Metadata) Generate(_ context.Context, parents asset.Parents) (err error
9799
metadata.ClusterPlatformMetadata.Ovirt = ovirt.Metadata(installConfig.Config)
98100
case vspheretypes.Name:
99101
metadata.ClusterPlatformMetadata.VSphere = vsphere.Metadata(installConfig.Config)
102+
case powervctypes.Name:
103+
metadata.ClusterPlatformMetadata.PowerVC = powervc.Metadata(clusterID.InfraID, installConfig.Config)
100104
case powervstypes.Name:
101105
metadata.ClusterPlatformMetadata.PowerVS, err = powervs.Metadata(installConfig.Config, installConfig.PowerVS)
102106
if err != nil {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package powervc
2+
3+
import (
4+
"github.com/openshift/installer/pkg/types"
5+
"github.com/openshift/installer/pkg/types/powervc"
6+
)
7+
8+
// Metadata converts an install configuration to PowerVC metadata.
9+
func Metadata(infraID string, config *types.InstallConfig) *powervc.Metadata {
10+
return &powervc.Metadata{
11+
Cloud: config.Platform.PowerVC.Cloud,
12+
Identifier: map[string]string{
13+
"openshiftClusterID": infraID,
14+
},
15+
}
16+
}

pkg/asset/cluster/tfvars/tfvars.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import (
5757
"github.com/openshift/installer/pkg/types/nutanix"
5858
"github.com/openshift/installer/pkg/types/openstack"
5959
"github.com/openshift/installer/pkg/types/ovirt"
60+
"github.com/openshift/installer/pkg/types/powervc"
6061
"github.com/openshift/installer/pkg/types/powervs"
6162
"github.com/openshift/installer/pkg/types/vsphere"
6263
ibmcloudprovider "github.com/openshift/machine-api-provider-ibmcloud/pkg/apis/ibmcloudprovider/v1"
@@ -746,7 +747,7 @@ func (t *TerraformVariables) Generate(ctx context.Context, parents asset.Parents
746747
Filename: TfPlatformVarsFileName,
747748
Data: data,
748749
})
749-
case openstack.Name:
750+
case openstack.Name, powervc.Name:
750751
data, err = openstacktfvars.TFVars(
751752
ctx,
752753
installConfig,

pkg/asset/ignition/machine/node.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
nutanixtypes "github.com/openshift/installer/pkg/types/nutanix"
1818
openstacktypes "github.com/openshift/installer/pkg/types/openstack"
1919
ovirttypes "github.com/openshift/installer/pkg/types/ovirt"
20+
powervctypes "github.com/openshift/installer/pkg/types/powervc"
2021
vspheretypes "github.com/openshift/installer/pkg/types/vsphere"
2122
)
2223

@@ -38,7 +39,7 @@ func pointerIgnitionConfig(installConfig *types.InstallConfig, rootCA []byte, ro
3839
if len(installConfig.Nutanix.APIVIPs) > 0 {
3940
ignitionHost = net.JoinHostPort(installConfig.Nutanix.APIVIPs[0], "22623")
4041
}
41-
case openstacktypes.Name:
42+
case openstacktypes.Name, powervctypes.Name:
4243
ignitionHost = net.JoinHostPort(installConfig.OpenStack.APIVIPs[0], "22623")
4344
case ovirttypes.Name:
4445
ignitionHost = net.JoinHostPort(installConfig.Ovirt.APIVIPs[0], "22623")

pkg/asset/installconfig/installconfig.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
icnutanix "github.com/openshift/installer/pkg/asset/installconfig/nutanix"
1717
icopenstack "github.com/openshift/installer/pkg/asset/installconfig/openstack"
1818
icovirt "github.com/openshift/installer/pkg/asset/installconfig/ovirt"
19+
icpowervc "github.com/openshift/installer/pkg/asset/installconfig/powervc"
1920
icpowervs "github.com/openshift/installer/pkg/asset/installconfig/powervs"
2021
icvsphere "github.com/openshift/installer/pkg/asset/installconfig/vsphere"
2122
"github.com/openshift/installer/pkg/types"
@@ -98,6 +99,7 @@ func (a *InstallConfig) Generate(ctx context.Context, parents asset.Parents) err
9899
a.Config.BareMetal = platform.BareMetal
99100
a.Config.Ovirt = platform.Ovirt
100101
a.Config.PowerVS = platform.PowerVS
102+
a.Config.PowerVC = platform.PowerVC
101103
a.Config.Nutanix = platform.Nutanix
102104

103105
defaults.SetInstallConfigDefaults(a.Config)
@@ -235,6 +237,13 @@ func (a *InstallConfig) platformValidation(ctx context.Context) error {
235237
if a.Config.Platform.Ovirt != nil {
236238
return icovirt.Validate(a.Config)
237239
}
240+
// Since PowerVC is a thin platform, allow it to fall through so that it can also test the OpenStack case.
241+
if a.Config.Platform.PowerVC != nil {
242+
err := icpowervc.Validate(a.Config)
243+
if err != nil {
244+
return err
245+
}
246+
}
238247
if a.Config.Platform.OpenStack != nil {
239248
return icopenstack.Validate(ctx, a.Config)
240249
}

0 commit comments

Comments
 (0)