-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
category: context linuxLinux OS contextualization packagesLinux OS contextualization packagestype: featureA new feature planned for implementationA new feature planned for implementation
Milestone
Description
Because of the cluster-api implementation for OpenNebula we found ourselves in a need to parse cloud-init compatible user-data structure in one-context (linux).
For now the requirement is to support basic yaml structure like the following:
#cloud-config
write_files:
- path: /run/cluster-api/placeholder
owner: root:root
permissions: '0640'
content: "This placeholder file is used to create the /run/cluster-api sub directory in a way that is compatible with both Linux and Windows (mkdir -p /run/cluster-api does not work with Windows)"
runcmd:
- 'kubeadm init --config /run/kubeadm/kubeadm.yaml && echo success > /run/cluster-api/bootstrap-success.complete'
- "set -e; if test -d /etc/kubernetes/super-admin.conf; then\n\n mv /etc/kubernetes/manifests/kube-vip.yaml /var/tmp/;\n sleep 1;\n rmdir /etc/kubernetes/super-admin.conf/ || true;\n kubeadm init phase kubeconfig super-admin || true;\n mv /var/tmp/kube-vip.yaml /etc/kubernetes/manifests/; fi"- Fully implemented
write_files:andruncmd:is something we need to progress with cluster API, one-context (linux) has to decode and parse the userdata, then create files and run commands. - This solution https://github.com/canonical/cloud-init/blob/197409efda9e7f6feec1d6a85f7a6b2ad7ad1ec5/cloudinit/sources/DataSourceOpenNebula.py#L465-L480 for passing the yaml userdata in the VM context seems reasonable.
- An example config in a running VM in OpenNebula would look like:
CONTEXT = [ USER_DATA = "<some base64 string here>", USER_DATA_ENCODING = "base64" ] - For parsing the yaml itself ruby can be used as it's assumed to be available.
Reactions are currently unavailable
Metadata
Metadata
Labels
category: context linuxLinux OS contextualization packagesLinux OS contextualization packagestype: featureA new feature planned for implementationA new feature planned for implementation