-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: bulild vsphere template in air gapped environment #246
Conversation
rhel79-ova: build | ||
rhel79-ova: ## Build RHEL 7.9 image | ||
./bin/konvoy-image build images/ova/rhel-79.yaml \ | ||
.PHONY: rhel84-ova-offline |
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.
Makefile target clutter is getting worse. I will have a PR in next sprint to fix this.
@@ -0,0 +1,765 @@ | |||
# Cloud-Init Datasource for VMware Guestinfo |
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.
copied from upstream to make it work in offline mode. PR description for details. any suggestion for better way to make this work?
Minimum allowed coverage is Generated by 🐒 cobertura-action against f8fdfb7 |
@@ -0,0 +1,71 @@ | |||
#!/bin/sh |
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 users still be able to have their own cloud-init?
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.
Theoretically yes. However it would require an extra setup outside our normal flow : Create template using KIB -> Extra steps: (convert template to VM, change VM config go add userdata using UI or govc CLI or API), convert vm back to template) -> reference template name in DKP CLI when creating cluster.
govc command: https://github.com/mevansam/vsphere-govmomi/blob/master/govc/USAGE.md#vmchange
govc vm.change -vm "${VM}" \
-e guestinfo.metadata="${METADATA}" \
-e guestinfo.metadata.encoding="gzip+base64" \
-e guestinfo.userdata="${USERDATA}" \
-e guestinfo.userdata.encoding="gzip+base64"
The cluster-api uses it to configure VM using data from KubeadmConfigTemplate
https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/master/pkg/services/govmomi/extra/config.go#L42
echo "netifaces is required" 1>&2 | ||
exit 1 | ||
fi | ||
|
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.
Its not needed now, since even RHEL9 only has 21.1
and the provider is in 21.3
but should we check if ${PY_MOD_CLOUD_INIT}/sources/DataSourceVMware.py
exists, and then bail early?
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 a good change, as this will prevent us from overriding latest DS whenever it is available. I have made this change
eb5bbab
to
f8fdfb7
Compare
@jkoelker I had to change dependency order of |
:sad-panda:, yep that should be fine, the |
What problem does this PR solve?:
Which issue(s) does this PR fix?:
Output:
Following template was created in airgapped VM network.
The packer job to create image in template was run from a bastion VM on the same
airgapped
network as the VM.Special notes for your reviewer:
issues and workarounds:
Issue: The cloud-init datasource for vmware guestinfo was merged in Aug 2021 (Datasource for VMware canonical/cloud-init#953) and only available in cloud-init > 21.3 . The cloud-init rpms that are available in Centos7/RHEL repos is > 19.4-7.
issue: The vmware cloudinit datasource module requires 8.1>pip<21.6 for Centos7/RHEL7. The pip-8.1.2 is default version. The latest pip version breaks on the Centos7/RHEL7
20.3.4
that is < 21.6 for offline buildsissue: unable to run packer job for airgapped environment from laptop or teamcity job as the VMs created in airgapped environments are not accessible from outside.
should we
embed
ansible playbooks in the konvoy-binary too?