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.
This commit is contained in:
Hermes Agent service account
2026-06-21 00:11:18 -05:00
parent 002d6799b1
commit 489b8aeb35

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,9 +52,8 @@ spec:
echo "Configuring multipath for Pure Storage FlashArray..."
# Write multipath.conf using nsenter to access host's writable filesystem
# Talos mounts /etc as read-only in containers, but writable in host namespace
nsenter -t 1 -m -u -i -n -- sh -c 'cat > /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
@@ -87,20 +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)"
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:
@@ -110,3 +114,9 @@ spec:
limits:
cpu: 10m
memory: 16Mi
volumes:
- name: system-etc
hostPath:
path: /system/etc
type: DirectoryOrCreate