-
Notifications
You must be signed in to change notification settings - Fork 321
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 PowerVS platform support #1225
Conversation
✅ Deploy Preview for hypershift-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mkumatag The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cc @dharaneeshvrd |
@mkumatag: GitHub didn't allow me to request PR reviews from the following users: dharaneeshvrd. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
e486d63
to
b9c13ea
Compare
Co-authored-by: Dharaneeshwaran Ravichandran <dharanish185@gmail.com>
/retest |
@mkumatag: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/cc @enxebre |
/assign |
@@ -139,6 +139,7 @@ func applyPlatformSpecificsValues(ctx context.Context, exampleOptions *apifixtur | |||
PowerVSCloudConnection: opts.PowerVSPlatform.PowerVSCloudConnection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please conflate this commit with e10d67b
// PowerVSPlatformSpec defines IBMCloud PowerVS specific settings for components | ||
type PowerVSPlatformSpec struct { | ||
// ResourceGroup is the IBMCloud Resource Group in which the cluster resides. If not | ||
// specified then default resource group of the account will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// specified then default resource group of the account will be used.
I don't see this default implemented in the controller so I assume is how ibm cloud behaves?
I see this is omitempty but Can we also add the +optional to be more explicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we initially thought will do this but this value is required for setting up the CCM, so will make this required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless marked as optional (omitempty / //optional) it's required so just need to change that and verify in the CRD generation.
// Zone is the availability zone where control plane cloud resources are | ||
// created. | ||
// | ||
// +immutable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's omitempty here, can we add +optional tag too consistently everywhere is optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again we need this value required as well for CCM code, will make this required.
// Subnet is the subnet to use for control plane cloud resources. | ||
// | ||
// +optional | ||
Subnet *PowerVSResourceReference `json:"subnet,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be optional, what happens if it's not set?
Actually I can't see where this is consumed, is it used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, these can't be optional. This is not used anywhere because we are using Subnet from PowerVSNodePoolPlatform for the machines, but we need this in the future to create new nodepool(will submit a follow up PR)
Subnet *PowerVSResourceReference `json:"subnet,omitempty"` | ||
|
||
// ServiceInstanceID is the ServiceInstance to use for control plane cloud resources. | ||
ServiceInstanceID string `json:"serviceInstanceID,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be optional, what happens if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, can't be optional.
// plane. | ||
// | ||
// +immutable | ||
VPC *PowerVSVPC `json:"vpc,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be optional, what happens if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't be optional.
// TODO(dan): document the "cloud controller policy" | ||
// | ||
// +immutable | ||
KubeCloudControllerCreds corev1.LocalObjectReference `json:"kubeCloudControllerCreds"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I brought this up in the past: I wonder if both KubeCloudControllerCreds and NodePoolManagementCreds should belong to the generic spec.
// on IBMCloud PowerVS platform. | ||
type PowerVSNodePoolPlatform struct { | ||
// ServiceInstanceID is the ServiceInstance to use for control plane cloud resources. | ||
ServiceInstanceID string `json:"serviceInstanceID"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which "control plane cloud resources" does this refer to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, this should be NodePool
|
||
// ProcType (dedicated, shared, capped) | ||
// +optional | ||
ProcType string `json:"procType,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add open api enum validation tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be optional, what happens if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a web hook in the capibm controller to set some of these value default, rightnow I'm not deploying that part of the deployment(future plan is to add support).
So my next question is how are we dealing with other providers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that should make any difference, I see webhooks as an additional UX layer. The API need to be solid even nevertheless. If a ProcType is necessary for the controller to work, then the field must be mark as required not optional (or alternative optional and use openAPI crd defaulting, but I rather do the former to avoid surprising opinions/assumptions for consumers). Then in the CLI we can give it a happy path/convenience value by default if we want to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I will make enum and default.
|
||
// Memory specifies the amount of memory specified in GBs | ||
// +optional | ||
Memory string `json:"memory,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do this a resource quantity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be optional, what happens if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to build api accepts value only in GiB format, I'm afraid that user won't be able to take advantage of resource quantity
ProcType string `json:"procType,omitempty"` | ||
|
||
// Processors specifies the number of processors allocated | ||
// +optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be optional, what happens if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, setting defaults in the capibm webhook
|
||
// Image used for deploying the nodes | ||
// +optional | ||
Image *PowerVSResourceReference `json:"image,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be optional, what happens if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In hypershift we create IBMPowerVSImage
resource to onboard the image from release artefacts, but if user wants to test with a different image which is already onboarded into the service then this field is useful, place we are overriding it here: https://github.com/mkumatag/hypershift/blob/1e9207ea17296fca53960b1d5dd44b37c6b3ba45/hypershift-operator/controllers/nodepool/nodepool_controller.go#L519:L537
|
||
// StorageType for the image and nodes | ||
// +optional | ||
StorageType string `json:"storageType,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this enum type validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add the enum and default
// Subnet is the subnet to use for control plane cloud resources. | ||
// | ||
// +optional | ||
Subnet *PowerVSResourceReference `json:"subnet,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which control plane resources does this refer to?
How can this be optional, what happens if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typical copy/paste error, need to be required
// DeletePolicy for the image | ||
// | ||
// +optional | ||
DeletePolicy string `json:"deletePolicy,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this enum type validation?
How can this be optional, what happens if it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add the enum and default
func NewCreateCommand(opts *core.CreateOptions) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "powervs", | ||
Short: "Creates basic functional HostedCluster resources on PowerVS PowerVS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo remove one "PowerVS"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix
} | ||
|
||
cmd.Flags().StringVar(&opts.PowerVSPlatform.ResourceGroup, "resource-group", "", "IBM Cloud Resource group") | ||
cmd.Flags().StringVar(&opts.PowerVSPlatform.PowerVSRegion, "powervs-region", opts.PowerVSPlatform.PowerVSRegion, "IBM Cloud PowerVS region") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of this needs the "powervs-" prefix since this is the powervs subcommand already.
hcluster *hyperv1.HostedCluster, | ||
controlPlaneNamespace string, | ||
apiEndpoint hyperv1.APIEndpoint) (client.Object, error) { | ||
if hcluster.Spec.Platform.IBMCloud != nil && hcluster.Spec.Platform.IBMCloud.ProviderType == configv1.IBMCloudProviderTypeUPI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given IBMCloud.ProviderType is a discriminator union PowerVS definition should live there
type IBMCloudPlatformSpec struct {
// ProviderType is a specific supported infrastructure provider within IBM Cloud.
ProviderType configv1.IBMCloudProviderType `json:"providerType,omitempty"`
PowerVS PowerVSPlatformSpec
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a copy/paste error from ibmcloud, this is not required.
} | ||
} | ||
|
||
func ibmPowerVSMachineTemplateSpec(nodePool *hyperv1.NodePool, ami string) *capipowervs.IBMPowerVSMachineTemplateSpec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is an ami in IBM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In PowerVS it is called BootImage
or just Image
Thanks @mkumatag! this is great work. For the sake of doing reasonable reviews and moving small chunks faster I suggest we split this in multiple PRs: |
closing in favour of #1255 |
@enxebre: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does / why we need it:
Add PowerVS platform support, reference to the openshift enhancement proposal for platform addition.
Which issue(s) this PR fixes (optional, use
fixes #<issue_number>(, fixes #<issue_number>, ...)
format, where issue_number might be a GitHub issue, or a Jira story:Fixes #
Checklist