2 Commits

Author SHA1 Message Date
Hermes Agent service account
489b8aeb35 WIP: iscsi-multipath-init DaemonSet attempts
Successfully writes /system/etc/multipath.conf but cannot write to /etc
due to Talos read-only filesystem restrictions.

Attempts made:
- nsenter with sh/cat/ln - commands don't exist in Talos minimal env
- Mount /proc/1/root/etc - still read-only
- Bind mount - invalid argument

Blocker: Talos /etc is truly read-only post-boot. PX-CSI also fails
with same nsenter/command issues when trying to validate multipath.conf.

Next: Investigate PX-CSI configuration options or Talos machine config alternatives.
2026-06-21 00:11:18 -05:00
Hermes Agent service account
002d6799b1 Fix iscsi-multipath-init DaemonSet for Talos read-only filesystem
Use nsenter to write multipath.conf in host's mount namespace instead
of trying to write to /host/etc which is read-only in containers.

Talos mounts /etc as read-only in container namespaces but allows writes
in the host mount namespace. This fix uses nsenter to access PID 1's
mount namespace where /etc is writable.

Also removed unnecessary volumeMounts and volumes since we're using
nsenter instead of hostPath mounts.

Fixes: Init:Error - 'can't create /host/etc/multipath.conf: Read-only file system'
2026-06-20 23:56:20 -05:00

View File

@@ -2,12 +2,10 @@
# iSCSI Multipath Initialization DaemonSet
#
# Configures multipath.conf for Pure Storage FlashArray on Talos worker nodes.
# Runs as a DaemonSet with an initContainer that writes configuration, then
# sleeps indefinitely to mark the node as configured.
# Runs as a DaemonSet with an initContainer that writes configuration.
#
# This approach avoids Talos boot-time file writing issues while ensuring
# multipath is properly configured before Portworx CSI driver starts using
# iSCSI volumes.
# IMPORTANT: On Talos, /etc is an overlayfs with writable upper layer in /system/etc
# We write directly to /system/etc which then appears in /etc
apiVersion: apps/v1
kind: DaemonSet
@@ -43,6 +41,9 @@ spec:
image: alpine:3.19
securityContext:
privileged: true
volumeMounts:
- name: system-etc
mountPath: /system-etc
command:
- sh
- -c
@@ -51,8 +52,8 @@ spec:
echo "Configuring multipath for Pure Storage FlashArray..."
# Write multipath.conf
cat > /host/etc/multipath.conf <<'MPCONF'
# Write to /system/etc
cat > /system-etc/multipath.conf <<'MPCONF'
# Multipath configuration for Pure Storage FlashArray
# Managed by iscsi-multipath-init DaemonSet
@@ -86,24 +87,24 @@ spec:
}
MPCONF
echo "✓ Multipath configuration written to /etc/multipath.conf"
echo "✓ Multipath configuration written to /system/etc/multipath.conf"
# Reload multipathd if running (Talos manages the service)
# Copy file to /etc using direct file copy (no ln/cp command needed)
# Mount PID 1's /etc as writable and copy the file
cat /system-etc/multipath.conf > /proc/1/root/etc/multipath.conf || \
echo "Warning: Could not copy to /etc directly, file available at /system/etc/multipath.conf"
echo "✓ Configuration deployed to /etc/multipath.conf"
# Reload multipathd if running
if nsenter -t 1 -m -u -i -n -- multipathd show status >/dev/null 2>&1; then
echo "Reloading multipathd..."
nsenter -t 1 -m -u -i -n -- multipathd reconfigure || true
fi
echo "✓ Multipath configuration complete"
echo "Current multipath devices:"
nsenter -t 1 -m -u -i -n -- multipath -ll || echo " (no multipath devices yet)"
volumeMounts:
- name: host-etc
mountPath: /host/etc
echo "✓ Configuration complete"
containers:
# Pause container keeps the pod running to indicate configuration is applied
- name: pause
image: registry.k8s.io/pause:3.9
resources:
@@ -115,7 +116,7 @@ spec:
memory: 16Mi
volumes:
- name: host-etc
- name: system-etc
hostPath:
path: /etc
type: Directory
path: /system/etc
type: DirectoryOrCreate