Compare commits
2 Commits
150cef1aca
...
489b8aeb35
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
489b8aeb35 | ||
|
|
002d6799b1 |
@@ -2,12 +2,10 @@
|
|||||||
# iSCSI Multipath Initialization DaemonSet
|
# iSCSI Multipath Initialization DaemonSet
|
||||||
#
|
#
|
||||||
# Configures multipath.conf for Pure Storage FlashArray on Talos worker nodes.
|
# Configures multipath.conf for Pure Storage FlashArray on Talos worker nodes.
|
||||||
# Runs as a DaemonSet with an initContainer that writes configuration, then
|
# Runs as a DaemonSet with an initContainer that writes configuration.
|
||||||
# sleeps indefinitely to mark the node as configured.
|
|
||||||
#
|
#
|
||||||
# This approach avoids Talos boot-time file writing issues while ensuring
|
# IMPORTANT: On Talos, /etc is an overlayfs with writable upper layer in /system/etc
|
||||||
# multipath is properly configured before Portworx CSI driver starts using
|
# We write directly to /system/etc which then appears in /etc
|
||||||
# iSCSI volumes.
|
|
||||||
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: DaemonSet
|
kind: DaemonSet
|
||||||
@@ -43,6 +41,9 @@ spec:
|
|||||||
image: alpine:3.19
|
image: alpine:3.19
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: system-etc
|
||||||
|
mountPath: /system-etc
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
@@ -51,8 +52,8 @@ spec:
|
|||||||
|
|
||||||
echo "Configuring multipath for Pure Storage FlashArray..."
|
echo "Configuring multipath for Pure Storage FlashArray..."
|
||||||
|
|
||||||
# Write multipath.conf
|
# Write to /system/etc
|
||||||
cat > /host/etc/multipath.conf <<'MPCONF'
|
cat > /system-etc/multipath.conf <<'MPCONF'
|
||||||
# Multipath configuration for Pure Storage FlashArray
|
# Multipath configuration for Pure Storage FlashArray
|
||||||
# Managed by iscsi-multipath-init DaemonSet
|
# Managed by iscsi-multipath-init DaemonSet
|
||||||
|
|
||||||
@@ -86,24 +87,24 @@ spec:
|
|||||||
}
|
}
|
||||||
MPCONF
|
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
|
if nsenter -t 1 -m -u -i -n -- multipathd show status >/dev/null 2>&1; then
|
||||||
echo "Reloading multipathd..."
|
echo "Reloading multipathd..."
|
||||||
nsenter -t 1 -m -u -i -n -- multipathd reconfigure || true
|
nsenter -t 1 -m -u -i -n -- multipathd reconfigure || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "✓ Multipath configuration complete"
|
echo "✓ 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
|
|
||||||
|
|
||||||
containers:
|
containers:
|
||||||
# Pause container keeps the pod running to indicate configuration is applied
|
|
||||||
- name: pause
|
- name: pause
|
||||||
image: registry.k8s.io/pause:3.9
|
image: registry.k8s.io/pause:3.9
|
||||||
resources:
|
resources:
|
||||||
@@ -115,7 +116,7 @@ spec:
|
|||||||
memory: 16Mi
|
memory: 16Mi
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: host-etc
|
- name: system-etc
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /etc
|
path: /system/etc
|
||||||
type: Directory
|
type: DirectoryOrCreate
|
||||||
|
|||||||
Reference in New Issue
Block a user