Compare commits
2 Commits
150cef1aca
...
489b8aeb35
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
489b8aeb35 | ||
|
|
002d6799b1 |
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user