Open Cajga opened 6 months ago
Workaround in case someone run into this: Set up a VS in apache that serves the file based on source IP
# cat /etc/httpd/conf.d/eks-serving-files-vs.conf
<VirtualHost *:8080>
ServerName eks-a-admin01.example.com
ServerAlias ip.of.admin.host
DocumentRoot /var/www/html
RewriteEngine On
RewriteCond %{REMOTE_ADDR} 10.0.0.1
RewriteRule ^/config\.yaml$ /var/www/html/netplan/host1.yaml
RewriteCond %{REMOTE_ADDR} 10.0.0.2
RewriteRule ^/config\.yaml$ /var/www/html/netplan/host2.yaml
RewriteCond %{REMOTE_ADDR} 10.0.0.3
RewriteRule ^/config\.yaml$ /var/www/html/netplan/host3.yaml
RewriteCond %{REMOTE_ADDR} 10.0.0.4
RewriteRule ^/config\.yaml$ /var/www/html/netplan/host4.yaml
RewriteCond %{REMOTE_ADDR} 10.0.0.5
RewriteRule ^/config\.yaml$ /var/www/html/netplan/host5.yaml
RewriteCond %{REMOTE_ADDR} 10.0.0.6
RewriteRule ^/config\.yaml$ /var/www/html/netplan/host6.yaml
RewriteCond %{REMOTE_ADDR} 10.0.0.7
RewriteRule ^/config\.yaml$ /var/www/html/netplan/host7.yaml
</VirtualHost>
Then use the following CMD_LINE: CMD_LINE: curl --output /etc/netplan/config.yaml http://ip.of.admin.host:8080/config.yaml && chown 0:0 /etc/netplan/config.yaml && chmod 0644 /etc/netplan/config.yaml
What would you like to be added: We have the need to modify the default netplan config for Bare Metal (ubuntu), to be able to use bonding configuration with static IP assignment (we have 2 bonds, one for storage one for data traffic). We generated the
TinkerbellTemplateConfig
witheksctl anywhere generate tinkerbelltemplateconfig -f cluster.yaml
and noticed that some templating can be used for the actions:Our plan is to fetch the netplan files from the admin host using curl (using a cexec action). As we need a per host based netplan, it would be nice to include the hostname in the URL through a template like the following (see CMD_LINE):
Unfortunately, we could not find any documentation about this templating. However from the upstream code, it seems, only disks are added to the
.Hardware
at the moment: https://github.com/tinkerbell/tink/blob/v0.10.0/internal/workflow/reconciler.go#L134Is this findings correct? Would it be possible to extend this struct with more information like
hostname
so, we can use it in TinkerbellTemplateConfig actions?Why is this needed: Currently, we have very limited possibilities in TinkerbellTemplateConfig when it comes to a per host property that is not exposed in any way (like an IP address of a storage bond interface). Basically, this forces us to define a TinkerbellTemplateConfig per host. If the templating could be extended with per host based variables (like hostname) then, a single TinkerbellTemplateConfig could be used for many real life use cases.