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 KubeVirt platform as infrastructure for Openshift installation #4350
Conversation
f6fcc06
to
69b999d
Compare
1168e07
to
6b0ed2d
Compare
/retest |
/retest |
2 similar comments
/retest |
/retest |
data/data/kubevirt/masters/main.tf
Outdated
path = "/etc/hostname" | ||
|
||
content { | ||
content = <<EOF |
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.
couldn't this be a one-liner?
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.
Fixed
@@ -0,0 +1,64 @@ | |||
variable "cluster_id" { | |||
description = "The ID of Openshift cluster" |
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.
nit: OpenShift
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.
Fixed
|
||
variable "pv_access_mode" { | ||
type = string | ||
description = "The access mode which all the persistant volumes should be created with [ReadWriteOnce,ReadOnlyMany,ReadWriteMany]" |
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.
ReadOnlyMany doesn't make sense here, I think its not worth mentioning
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.
Fixed
pkg/tfvars/kubevirt/kubevirt.go
Outdated
"encoding/json" | ||
|
||
v1 "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1" | ||
// "github.com/openshift/installer/pkg/rhcos" |
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.
remove unused imports
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.
Fixed
description: Kubevirt is the configuration used when installing on Kubevirt. | ||
properties: | ||
cpu: | ||
description: CPU is the mount of cpus 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.
mount/amount - need to change in go code and regenerate
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.
Fixed
description: DefaultMachinePlatform is the default configuration used when installing on Kubevirt for machine pools which do not define their own platform configuration. | ||
properties: | ||
cpu: | ||
description: CPU is the mount of cpus 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.
mount/amount
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.
Fixed
pkg/types/kubevirt/machinepool.go
Outdated
// MachinePool stores the configuration for a machine pool installed | ||
// on kubevirt. | ||
type MachinePool struct { | ||
// CPU is the mount of cpus 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.
s/mount/amount
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.
Fixed
// NewClient creates our client wrapper object for the actual kubeVirt and kubernetes clients we use. | ||
func NewClient() (Client, error) { | ||
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() | ||
// if you want to change the loading rules (which files in which order), you can do so here |
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.
those comments are from the example, I'm not sure we need those here.
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.
Removed comments
return result, nil | ||
} | ||
|
||
// VirtualMachine |
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.
needed?
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.
Removed the comments
return nil, err | ||
} | ||
msg := fmt.Sprintf("Failed to get VirtualMachine, with error: %v", err) | ||
log.Printf("[Error] %s", msg) |
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.
why not log.Errorf?
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.
Fixed
|
||
// NetworkAttachmentDefinition | ||
|
||
func (c *client) GetNetworkAttachmentDefinition(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error) { |
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.
ctx unused
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.
Fixed
return c.kubernetesClient.CoreV1().Secrets(namespace).List(context.Background(), metav1.ListOptions{}) | ||
} | ||
|
||
func (c *client) DeleteSecret(namespace string, name string) error { |
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.
add context?
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.
The context is created internally in the client using context.Background()
return c.kubernetesClient.CoreV1().Secrets(namespace).Get(context.Background(), name, metav1.GetOptions{}) | ||
} | ||
|
||
func (c *client) ListSecret(namespace string) (*corev1.SecretList, error) { |
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.
add context?
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.
The context is created internally in the client using context.Background()
* Add specific parameters to request from user * Add an option to request "Mobile Network CIDR" from user, enabled only in kubevirt platform
…rt provider * Those configurations are used in the "manifests" stage * Use providerSpec (declared in cluster_api_provider_kubevirt) inside the configurations
* Use provider Infra cluster kubeconfig to generate the following secrets: - cloud-creds-secret.yaml template - role-cloud-creds-secret-reader.yaml template * Add kubevirt platform parameters to cloudproviderconfig, include: namespace * Skip DNS config and its CRD generation for kubevirt platform * Modify bootstrap bootkube.sh data/data/bootstrap
…ions (multus network) * Set APIVIP for ignition access * Set mcscertkey for APIVIP
* Use the same image used by openstack and ovirt
* Update tfvars with cluster's values * Update metadata object, Saved for destroy operation
This is done in order to allow the bootstrap to notify the cluster when it done
/test e2e-gcp |
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: staebler The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Holding for gcp and azure tests, since they have some vendor changes. /test e2e-azure |
/retest |
1 similar comment
/retest |
@nirarg: The following tests failed, say
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. |
The Azure installation is succeeding but the e2e tests are failing. /hold cancel |
This PR is part of task done to add KubeVirt platform as infra provider for Openshift.
The change introduced in this PR purpose is to provide a way to install Openshift on KubeVirt infrastructure
For more information:
Add enhancement: IPI kubevirt provider enhancements#417
Related PRs/changes done as part of this task:
openshift/cluster-api-provider-kubevirt
repository, hosts an implementation of a provider for KubeVirt for the OpenShift machine-api: https://github.com/openshift/cluster-api-provider-kubevirtopenshift/machine-api-operator
: Add Kubevirt provider machine-api-operator#716 (comment)openshift/cloud-credential-operator
: Add kubevirt platform cloud-credential-operator#260openshift/machine-config-operator
: Add kubevirt platform machine-config-operator#2098openshift/api
: Add KubeVirt platform type api#734Additional job is done to have tests and CI coverage (work in progress in github.com/openshift/release repository)