Skip to content

Commit 0f7c1aa

Browse files
authored
Update the examples folder (#733)
* add documentation for rhel os and kubevirt cloud provider Signed-off-by: Moath Qasim <[email protected]> Signed-off-by: Moath Qasim <[email protected]> * addressing PR review Signed-off-by: Moath Qasim <[email protected]> Signed-off-by: Moath Qasim <[email protected]> * updating machine-deployment manifests Signed-off-by: Moath Qasim <[email protected]> Signed-off-by: Moath Qasim <[email protected]>
1 parent 0537cf3 commit 0f7c1aa

10 files changed

+100
-8
lines changed

docs/kubevirt.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,29 @@ are some things you need to keep in mind:
88

99
* The machine-controller will create `VMIs` that have the same name as the underlying `machine`. To
1010
avoid collisions, use one namespace per cluster that runs the `machine-controller`
11-
* Service CIDR range: The CIDR ranges of the cluster that runs Kubevirt and the cluster that hosts the machine-controller must not overlap, otherwise routing of services that run in the kubevirt cluster
12-
wont work anymore. THis is especially important for the DNS ClusterIP.
13-
* In order to create VirtualMachineInstances deployed with CoreOS, you should use `coreos_production_qemu_image.img.bz2`, which can be found in the stable releases
14-
[here](https://stable.release.core-os.net/amd64-usr/).
11+
* Service CIDR range: The CIDR ranges of the cluster that runs Kubevirt and the cluster that hosts the machine-controller must not overlap,
12+
otherwise routing of services that run in the kubevirt cluster wont work anymore. This is especially important for the DNS ClusterIP.
13+
* In order to create VirtualMachineInstances deployed with CoreOS, you should use `coreos_production_qemu_image.img.bz2`, which can be found in
14+
the stable releases [here](https://stable.release.core-os.net/amd64-usr/).
15+
16+
## Serving Supported Images
17+
18+
For KubeVirt clusters, we use Containerized Data Importer (CDI), which is is a utility to import, upload and clone
19+
Virtual Machine images for use with KubeVirt. At a high level, a persistent volume claim (PVC), which defines VM-suitable
20+
storage via a storage class, is created.
21+
22+
The Containerized Data Importer is capable of performing certain functions that streamline its use with KubeVirt. It automatically
23+
decompresses gzip and xz files, and un-tar’s tar archives. Also, qcow2 images are converted into the raw format which is required by KubeVirt,
24+
resulting in the final file being a simple .img file.
25+
26+
Supported file formats are:
27+
28+
- Tar archive
29+
- Gzip compressed file
30+
- XZ compressed file
31+
- Raw image data
32+
- ISO image data
33+
- Qemu qcow2 image data
34+
35+
KubeVirt reads those images from an http endpoint which is passed to the `MachineDeployment` spec. The field that should be used
36+
for to import those images is `sourceURL`.

docs/rhel-custom-image.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# RedHat Enterprise Linux
2+
3+
Cloud providers which are listed below, support using rhel as an operating system option:
4+
5+
- AWS
6+
- Azure
7+
- GCE
8+
- KubeVirt
9+
- Openstack
10+
- vSphere
11+
12+
#### AWS:
13+
For amazon web service cloud provider, First of all the RHEL gold image AMIs have to be enabled from the
14+
[RedHat Customer Portal](https://access.redhat.com/public-cloud/aws) (this requires a [cloud-provider subscription](https://access.redhat.com/public-cloud)).
15+
.Afterwards, new images will be added to the aws account under EC2-> Images-> AMIs-> Private Images. Once the images are available in the aws account,
16+
the image id for rhel(at the moment we only support 8.x.x versions) should be then added to the `MachineDeployment` spec to the field `ami`.
17+
18+
#### Azure
19+
RedHat provides images for Azure, [documentation](https://access.redhat.com/articles/uploading-rhel-image-to-azure) is available on RH customer portal.
20+
The `MachineDeployment` field `.spec.template.spec.providerSpec.value.cloudProviderSpec.imageID` should reference the ID of the uploaded VM.
21+
22+
**Note:**
23+
Azure rhel images starting from 7.6.x don't support cloud-init as their documentation states [here](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/using-cloud-init#rhel).
24+
Thus, custom images can be used with a cloud-init pre-installed to solve this issue. Follow this [documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cloudinit-prepare-custom-image)
25+
to prepare an image with cloud-init support.
26+
27+
#### GCE
28+
RedHat also provides Gold Access Image for GCE and those can be fetched just like aws and azure. The `MachineDeployment` field `.spec.template.spec.providerSpec.value.cloudProviderSpec.customImage` should reference the ID of the used image.
29+
30+
**Note:**
31+
Same as for Azure, rhel images in GCE don't support cloud-init. Thus, custom images can be used with a cloud-init pre-installed
32+
to solve this issue. Follow this [documentation](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_red_hat_enterprise_linux_8_on_public_cloud_platforms/assembly_deploying-a-rhel-image-as-a-compute-engine-instance-on-google-cloud-platform_deploying-a-virtual-machine-on-aws) to upload custom rhel
33+
images in order to use it for running rhel instances.
34+
35+
#### KubeVirt
36+
In order to create machines which run rhel as an operating system in KubeVirt cloud provider, the image should be available and fetched
37+
via an endpoint. This endpoint should be then added to the `MachineDeployment` field `.spec.template.spec.providerSpec.value.cloudProviderSpec.sourceURL`. For more information about
38+
the supported images please refer to this documentation from KubeVirt CDI [here](https://kubevirt.io/2018/containerized-data-importer.html)
39+
40+
#### Openstack
41+
Once RHEL images(e.g: Red Hat Enterprise Linux 8.x KVM Guest Image) is uploaded to openstack, the image name should be used in
42+
the `MachineDeployment` field `.spec.template.spec.providerSpec.value.cloudProviderSpec.image`.
43+
44+
#### vSphere
45+
To rhel os for vSphere instance, a template for the rhel machine should be created or a clone from a rhel machine. To upload rhel
46+
image to vSphere, follow these steps to create instances from a cloned machine:
47+
48+
- Download Red Hat Enterprise Linux 8.x KVM Guest Image from Red Hat Customer Portal.
49+
- The image has the format `qcow2` thus should be converted to `vmdk` by running the command: `qemu-img convert -f qcow2 rhel.qcow2 -O vmdk newRHEL.vmdk`
50+
- Run `vmkfstools -i myImage.vmdk outputName.vmdk -d thin To ensure that the` to ensure that, the `vmdk` is ESXi compatible.
51+
- Upload the image to vSphere Datastore. Preferably use [`govc`](https://github.com/vmware/govmomi/blob/master/govc/USAGE.md#datastoreupload)
52+
- Once the image is uploaded create a new instance using that image. During the machine creation process, at the `Customize Hardware`
53+
step, press on ADD NEW DEVICE and select Existing Hard Disk.
54+
- In the Existing Hard Disk wizard select the rhel image file and then create the instance.
55+
- Use the instance name to clone rhel machine by updating the `MachineDeployment` field `.spec.template.spec.providerSpec.value.cloudProviderSpec.templateVMName`.

examples/alibaba-machinedeployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ spec:
5151
key: accessKeySecret
5252
instanceType: "ecs.t1.xsmall"
5353
instanceName: "alibaba-instance"
54+
internetMaxBandwidthOut: 10
5455
regionID: eu-central-1
55-
imageID: "aliyun_2_1903_64_20G_alibase_20190829.vhd"
56+
vSwitchID: "vswitchID"
57+
zoneID: eu-central-1a
5658
diskType: "cloud_efficiency"
5759
diskSize: "40"
5860
operatingSystem: "ubuntu"
5961
operatingSystemSpec:
6062
distUpgradeOnBoot: false
63+
disableAutoUpdate: true
6164
versions:
6265
kubelet: 1.13.1

examples/aws-machinedeployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,18 @@ spec:
5959
diskSize: 50
6060
diskType: "gp2"
6161
ebsVolumeEncrypted: false
62+
ami: "my-custom-ami"
6263
## Only application if diskType = io1
6364
diskIops: 500
6465
# Assign a public IP to this instance. Default: true
6566
assignPublicIP: false
6667
tags:
6768
"KubernetesCluster": "6qsm86c2d"
68-
# Can be 'ubuntu', 'coreos' ,'centos' or 'sles'
69+
# Can be 'ubuntu', 'coreos' ,'centos', `rhel` or 'sles'
6970
operatingSystem: "coreos"
7071
operatingSystemSpec:
7172
disableAutoUpdate: true
73+
distUpgradeOnBoot: false
7274
# 'rhelSubscriptionManagerUser' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_USER`
7375
rhelSubscriptionManagerUser: "<< RHEL_SUBSCRIPTION_MANAGER_USER >>"
7476
# 'rhelSubscriptionManagerPassword' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_PASSWORD`

examples/azure-machinedeployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,21 @@ spec:
6464
key: subscriptionID
6565
location: "westeurope"
6666
resourceGroup: "<< YOUR_RESOURCE_GROUP >>"
67-
vmSize: "Standard_B1ms"
67+
vmSize: "Standard_F2"
6868
# optional disk size values in GB. If not set, the defaults for the vmSize will be used.
6969
osDiskSize: 30
7070
dataDiskSize: 30
7171
vnetName: "<< VNET_NAME >>"
7272
subnetName: "<< SUBNET_NAME >>"
7373
routeTableName: "<< ROUTE_TABLE_NAME >>"
74+
imageID: "myImageID"
7475
assignPublicIP: false
7576
securityGroupName: my-security-group
77+
# Can be 'ubuntu', 'coreos' ,'centos' or 'rhel'
7678
operatingSystem: "coreos"
7779
operatingSystemSpec:
7880
distUpgradeOnBoot: false
81+
disableAutoUpdate: true
7982
# 'rhelSubscriptionManagerUser' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_USER`
8083
rhelSubscriptionManagerUser: "<< RHEL_SUBSCRIPTION_MANAGER_USER >>"
8184
# 'rhelSubscriptionManagerPassword' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_PASSWORD`

examples/gce-machinedeployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ spec:
6262
"kubernetes_cluster": "my-cluster"
6363
# Whether to assign a public IP Address. Required for Internet access
6464
assignPublicIPAddress: true
65-
# Can be 'ubuntu' or 'coreos'
65+
customImage: "myCustomImage"
66+
# Can be 'ubuntu' 'rhel' or 'coreos'
6667
operatingSystem: "coreos"
6768
operatingSystemSpec:
6869
disableAutoUpdate: true

examples/openstack-machinedeployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ spec:
112112
operatingSystem: "ubuntu"
113113
operatingSystemSpec:
114114
distUpgradeOnBoot: true
115+
disableAutoUpdate: true
115116
# 'rhelSubscriptionManagerUser' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_USER`
116117
rhelSubscriptionManagerUser: "<< RHEL_SUBSCRIPTION_MANAGER_USER >>"
117118
# 'rhelSubscriptionManagerPassword' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_PASSWORD`

examples/vsphere-datastore-cluster-machinedeployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
operatingSystem: "ubuntu"
6767
operatingSystemSpec:
6868
distUpgradeOnBoot: false
69+
disableAutoUpdate: true
6970
# 'rhelSubscriptionManagerUser' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_USER`
7071
rhelSubscriptionManagerUser: "<< RHEL_SUBSCRIPTION_MANAGER_USER >>"
7172
# 'rhelSubscriptionManagerPassword' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_PASSWORD`

examples/vsphere-machinedeployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
operatingSystem: "ubuntu"
6767
operatingSystemSpec:
6868
distUpgradeOnBoot: false
69+
disableAutoUpdate: true
6970
# 'rhelSubscriptionManagerUser' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_USER`
7071
rhelSubscriptionManagerUser: "<< RHEL_SUBSCRIPTION_MANAGER_USER >>"
7172
# 'rhelSubscriptionManagerPassword' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_PASSWORD`

test/e2e/provisioning/testdata/machinedeployment-vsphere-datastore-cluster.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@ spec:
4545
rhelSubscriptionManagerUser: "<< RHEL_SUBSCRIPTION_MANAGER_USER >>"
4646
# 'rhelSubscriptionManagerPassword' is only used for rhel os and can be set via env var `RHEL_SUBSCRIPTION_MANAGER_PASSWORD`
4747
rhelSubscriptionManagerPassword: "<< RHEL_SUBSCRIPTION_MANAGER_PASSWORD >>"
48+
# 'rhsmOfflineToken' if it was provided red hat systems subscriptions will be removed upon machines deletions, and if wasn't
49+
# provided the rhsm will be disabled and any created subscription won't be removed automatically
50+
rhsmOfflineToken: "<< REDHAT_SUBSCRIPTIONS_OFFLINE_TOKEN >>"
4851
versions:
4952
kubelet: "<< KUBERNETES_VERSION >>"

0 commit comments

Comments
 (0)