Files
seaweedfs/seaweed-block/deploy/k8s/alpha/csi-node.yaml
T
pingqiuandClaude Opus 5.5 f7f3b56298 k8s: each in-cluster client gets its own certificate with the least role
The CSI node and the status operator mount viewer certificates; the CSI
controller (it deletes volumes) and the failback executor mount admin
ones. The alpha certificate helper issues one certificate, role-file line
and Secret per client, and the chart takes one Secret per client
(tls.clientSecrets). A chart-render test fails when a client mounts a
Secret other than its own, when an admin Secret appears outside the CSI
controller and the failback executor, or when the role file gives a
client more than its role. A node's refused reattach event is one log
line and is not retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:41:00 -08:00

110 lines
3.4 KiB
YAML

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: sw-block-csi-node
namespace: kube-system
spec:
selector:
matchLabels:
app: sw-block-csi-node
template:
metadata:
labels:
app: sw-block-csi-node
spec:
serviceAccountName: sw-block-csi
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
hostPID: true
initContainers:
- name: load-iscsi-tcp
image: sw-block-csi:local
imagePullPolicy: Never
command: ["/bin/sh", "-c"]
args:
- "modprobe iscsi_tcp || true; modprobe nvme_tcp || true; modprobe dm_multipath || true; modprobe scsi_dh_alua || true"
securityContext:
privileged: true
volumeMounts:
- name: modules-dir
mountPath: /lib/modules
readOnly: true
containers:
- name: block-csi
image: sw-block-csi:local
imagePullPolicy: Never
args:
- "--endpoint=unix:///csi/csi.sock"
- "--master=$(BLOCKMASTER_ADDR)"
- "--node-id=$(NODE_NAME)"
- "--master-tls-cert=/etc/sw-block/master-tls/tls.crt"
- "--master-tls-key=/etc/sw-block/master-tls/tls.key"
- "--master-ca=/etc/sw-block/master-tls/ca.crt"
env:
- name: BLOCKMASTER_ADDR
value: "blockmaster.kube-system.svc.cluster.local:9333"
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
securityContext:
privileged: true
volumeMounts:
- name: master-tls
mountPath: /etc/sw-block/master-tls
readOnly: true
- name: socket-dir
mountPath: /csi
- name: kubelet-dir
mountPath: /var/lib/kubelet
mountPropagation: Bidirectional
- name: dev
mountPath: /dev
- name: iscsi-dir
mountPath: /etc/iscsi
- name: udev-run
mountPath: /run/udev
readOnly: true
- name: csi-node-driver-registrar
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.13.0
args:
- "--csi-address=/csi/csi.sock"
- "--kubelet-registration-path=/var/lib/kubelet/plugins/block.csi.seaweedfs.com/csi.sock"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
volumes:
- name: master-tls
secret:
secretName: sw-block-csi-node-tls
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/block.csi.seaweedfs.com
type: DirectoryOrCreate
- name: kubelet-dir
hostPath:
path: /var/lib/kubelet
type: Directory
- name: dev
hostPath:
path: /dev
type: Directory
- name: iscsi-dir
hostPath:
path: /etc/iscsi
type: DirectoryOrCreate
- name: udev-run
hostPath:
path: /run/udev
type: Directory
- name: modules-dir
hostPath:
path: /lib/modules
type: Directory
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry
type: Directory