Open thoro opened 1 month ago
this is not possible at the moment, but this can be made configurable via ExtensionServiceConfig
Do you have an example how this could be integrated into an extension? I maybe would be willing to create a PR for the mdadm extension then.
you can take a look at nut-client extension, the mdadm extension probably needs a flag to point to a config file
mdadm implicitly reads the config file, because it's called via udevd (rules defined in the extension)
the usual place is /etc/mdadm.conf, can you also set it at this location via the ExtensionServiceConfig?
mdadm implicitly reads the config file, because it's called via udevd (rules defined in the extension)
the usual place is /etc/mdadm.conf, can you also set it at this location via the ExtensionServiceConfig?
we might have to compile mdadm to use a custom path then, extensions only allow /usr/local
I tried to just apply an ExtensionServiceConfig now, but talosctl ls /usr/local/etc/mdadm.conf
reports non-existing.
apiVersion: v1alpha1
kind: ExtensionServiceConfig
name: mdadm
configFiles:
- content: |-
AUTO -all
mountPath: /usr/local/etc/mdadm.conf
When are those configs applied? Do you need to run a container in the extension? Are the names supposed to be the same as the extension?
I tried to just apply an ExtensionServiceConfig now, but
talosctl ls /usr/local/etc/mdadm.conf
reports non-existing.apiVersion: v1alpha1 kind: ExtensionServiceConfig name: mdadm configFiles: - content: |- AUTO -all mountPath: /usr/local/etc/mdadm.conf
When are those configs applied? Do you need to run a container in the extension? Are the names supposed to be the same as the extension?
yes, it only gets in effect when there is an extension with the same name
I checked the executable, and looks like the path is sadly not compiled in correctly.
salt/talos (k8s: admin@dc-at-prod-02) $ talosctl --talosconfig=.talosconfig -n dc-at-prod-02-h01 get extensions 2
NODE NAMESPACE TYPE ID VERSION NAME VERSION
dc-at-prod-02-h01 runtime ExtensionStatus 2 1 mdadm v4.2
salt/talos (k8s: admin@dc-at-prod-02) $ talosctl --talosconfig=.talosconfig -n dc-at-prod-02-h01 get extensionserviceconfig mdadm
NODE NAMESPACE TYPE ID VERSION
dc-at-prod-02-h01 runtime ExtensionServiceConfig mdadm 1
salt/talos (k8s: admin@dc-at-prod-02) $ talosctl --talosconfig=.talosconfig -n dc-at-prod-02-h01 get extensionserviceconfig mdadm -o yaml;
node: dc-at-prod-02-h01
metadata:
namespace: runtime
type: ExtensionServiceConfigs.runtime.talos.dev
id: mdadm
version: 1
owner: runtime.ExtensionServiceConfigController
phase: running
created: 2024-07-18T12:05:45Z
updated: 2024-07-18T12:05:45Z
spec:
files:
- content: AUTO -all
mountPath: /usr/local/etc/mdadm.conf
salt/talos (k8s: admin@dc-at-prod-02) $ talosctl --talosconfig=.talosconfig -n dc-at-prod-02-h01 ls /usr/local/etc/mdadm.conf
NODE NAME
1 error occurred:
rpc error: code = Unknown desc = lstat /usr/local/etc/mdadm.conf: no such file or directory
I have readded the mdadm extension to my cluster, but the ExtensionServiceConfig is still not applied as expected - ideas?
@frezbo Can you check this one here: https://github.com/siderolabs/extensions/pull/430 ?
ahh ExtensionServiceConfig
is currently only for extension services, not plain extensions
Also can we specify the config file here: https://github.com/siderolabs/extensions/blob/main/storage/mdadm/files/udev-md-raid-arrays.rules#L20?
~sadly not, it's hardcoded in the source via define, there's no option to pass config file via cli args~
Edit: Sorry, I was wrong .. seems to be a -c option!
~is there a build services to get a test image out of the PR - I can't build it on my M2 mac~ Edit: solved it, I added by mistake a space into the pkg.yaml, that removed an important build env var.
@frezbo I added the the -c option to specify the config file in the udev rules. What I do not understand yet, is how to get a config file into that folder anyways 😃
Edit: I think the config file is rather well stored under /var/lib/mdadm/mdadm.conf but please let me know what's the correct destination, and how to actually edit that file then.
@frezbo I added the the -c option to specify the config file in the udev rules. What I do not understand yet, is how to get a config file into that folder anyways 😃
Edit: I think the config file is rather well stored under /var/lib/mdadm/mdadm.conf but please let me know what's the correct destination, and how to actually edit that file then.
we don't have a good way in talos now to get a config file or have a default one so that the it doesn't break existing config, let's keep a hold on to this until we have a better solution from talos/extensions side
Hello,
I do not want mdadm to auto assemble arrays for me, how can I add:
to the mdadm.conf file?