CSE 2.6 template customization
We normally complement the CSE catalog, adding to the templates provided by VMware some additional ones with our custom content. In CSE 1.x, since the scripts for template generation were local, this was easy to do. Now that the CSE config.yaml file references a remote template cookbook URL, how do you recommend that we create that customization? Do we have to download the standard templates and scripts from the VMware Github and create our own HTTP repository with the standard templates and our custom ones? Is there a simpler alternative?
Hi Miguel,
CSE can still work with customized templates but as you have already noticed the process has changed a little bit.
Yes, you need to host your customized script on a local HTTP server, it can even be served statically from the same machine via nginx or tomcat. The local template repo doesn't need to host all the VMware template definitions, it can just host the customized template definition. Service provider can switch between these two urls while installing the templates. Once the templates are installed in the system, CSE wouldn't go out of its way and try to download anything from the template repo during cluster creation (or other related operations).
We should keep in mind that if you host a custom template repo, you will need to provide the following
- template.yaml - Contains the definition of the template e.g. link to the base os image, name of the template, revision# of the template etc.
- scripts files - The script folder should be placed next to the template.yaml file. The name of the script folder is
[template name]_rev[template_revision].
There are primarily 5 scripts,
- init.sh - which is passed as is to the temp vm as guest customization script during the first phase of template creation.
- cust.sh - This script is run on the temp vm once it has been deployed from the base OS ova. Typically this script contains all the logic to install security updates, and common software like docker etc.
- mstr.sh - This script is run on all master nodes after they are instantiated from the template.
- node.sh - This script is run on all worker nodes after they are instantiated from the template.
- nfsd.sh - This script is run on all nfs nodes that might be added to a cluster to provide PV.
Additionally there are some more scripts kept in a folder called 'cluster-upgrade' e.g. https://github.com/vmware/container-service-extension-templates/tree/upgrades/scripts/ubuntu-16.04_k8-1.16_weave-2.6.0_rev1 This contains cluster K8s upgrade specific scripts (this is already getting a bit out of scope for this issue). However you can just create dummy blank scripts in that folder mirroring the example url I posted above.
Let us know, if you have any other questions or need some help with this.
Regards Aritra Sen