--- # 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. # # 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 metadata: name: iscsi-multipath-init namespace: kube-system labels: app: iscsi-multipath-init component: storage spec: selector: matchLabels: app: iscsi-multipath-init template: metadata: labels: app: iscsi-multipath-init component: storage spec: hostNetwork: true hostPID: true # Only run on worker nodes with iSCSI storage network nodeSelector: node-role.kubernetes.io/worker: "" tolerations: - effect: NoSchedule key: node-role.kubernetes.io/control-plane initContainers: - name: configure-multipath image: alpine:3.19 securityContext: privileged: true volumeMounts: - name: system-etc mountPath: /system-etc command: - sh - -c - | set -e echo "Configuring multipath for Pure Storage FlashArray..." # Write to /system/etc cat > /system-etc/multipath.conf <<'MPCONF' # Multipath configuration for Pure Storage FlashArray # Managed by iscsi-multipath-init DaemonSet defaults { polling_interval 10 find_multipaths yes user_friendly_names no } devices { device { vendor "PURE" product "FlashArray" path_selector "service-time 0" path_grouping_policy group_by_prio prio alua path_checker tur fast_io_fail_tmo 10 user_friendly_names no no_path_retry 0 hardware_handler "1 alua" dev_loss_tmo 600 failback immediate } } # Blacklist Portworx virtual block devices blacklist { devnode "^pxd[0-9]*" devnode "^pxd.*" } MPCONF echo "✓ Multipath configuration written to /system/etc/multipath.conf" # 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 "✓ Configuration complete" containers: - name: pause image: registry.k8s.io/pause:3.9 resources: requests: cpu: 1m memory: 8Mi limits: cpu: 10m memory: 16Mi volumes: - name: system-etc hostPath: path: /system/etc type: DirectoryOrCreate